开发者

ASP.net renders form tag weirdly

My code on my ASPX page:

<form runat="server" action="productEditCat.aspx?mid=2&catID=<%=catID%>&action=update">

This is rendering as:

<form name="aspnetForm" method="post" action="productEditCat.aspx?mid=2&amp;catID=&lt;%=catID%>&amp;action=update" onsubmit="javascript:return WebForm_OnSubmit();" id="aspnetForm">

It seems to be url encoding the query? Any way to stop this?

The variable is being set in the page load:

protected void Page_Load(object sender, EventArgs e)
{
    // Get the 开发者_StackOverflowpages action
    string pageAction = Request.QueryString["action"];
    catID = int.Parse(Request.QueryString["catID"].ToString());

Edit: some forms allow it, some dont on my site which is very frustrating

Thanks!

tom


This is correct behavior; attributes in HTML tags should be HTML-encoded. (That's what you're seeing, not URL-encoding.)


catID should be a property on the rather than a variable

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜