PRB: Cannot Change or Remove the QueryString Action for a Web Form on Postback (810218)
The information in this article applies to:
- Microsoft ASP.NET (included with the .NET Framework 1.1)
- Microsoft Visual Basic .NET (2003)
- Microsoft Visual C# .NET (2003)
- Microsoft ASP.NET (included with the .NET Framework) 1.0
- Microsoft Visual Basic .NET (2002)
- Microsoft Visual C# .NET (2002)
SYMPTOMSWhen you try to change the target of the postback by
including an action attribute in the HtmlForm tag, ASP.NET overrides the action
attribute and forces the form to post back to itself. This behavior forces all
the postbacks to hold the same QueryString.CAUSEThe action property of the HtmlForm tag is always the
current page. Although this change was intended to prevent cross-page changes
to the URL in a Web Form, this also prevents the change in the QueryString of a Web Form. You cannot change or remove the QueryString of a Web Form. WORKAROUNDTo work around this behavior, use client-side scripting to
handle the body.onload event, and then set the Action attribute of HtmlForm to strip the QueryString. For more information about how to do this, see the "More
Information" section of this article.STATUS This
behavior is by design.REFERENCESFor more information about ASP.NET, visit the following
MIcrosoft Web site: For tutorials about the Microsoft .NET Framework and Visual
Studio .NET, visit the following Microsoft Web site: For an introduction to ASP.NET, visit the following Microsoft Web
site:
Modification Type: | Minor | Last Reviewed: | 7/8/2003 |
---|
Keywords: | kbWebForms kbprb KB810218 kbAudDeveloper |
---|
|