views:

46

answers:

2

Hi!

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 pages 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

+3  A: 

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

ngroot
Any idea on how I can work around this?
Tom Gullen
Paul Hadfield
It's a pain in the ass and inconsistant because I have other form tags that print out just fine.
Tom Gullen
ngroot
Thanks, but are there any workarounds, I don't want to end up posting all my values everywhere that would get messy and stop people being able to bookmark pages.
Tom Gullen
What does using character references within attributes have to do with bookmarking?
ngroot
Paul Hadfield
A: 

catID should be a property on the rather than a variable

Vinay B R