开发者

ASP.net renders form tag weirdly

开发者 https://www.devze.com 2023-01-14 13:03 出处:网络
My code on my ASPX page: <form runat=\"server\" action=\"productEditCat.aspx?mid=2&catID=<%=catID%>&action=update\">

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

精彩评论

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

关注公众号