Re: Form trouble

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



change the method to a get if you wat the form vriables on the url, or look in the form collection rather than the querystring collection

-- bruce (sqlwork.com)

Roshawn wrote:
Hi,

I have a web page that contains an html form and has a few controls in it. The html form and its controls are all server controls. However, I've set the enableViewState attribute of the html form and its controls to false as I can get this data from the querystring and set appropriate form values via code.

When I perform a postback, the form's action attribute gets set by ASP.NET. No biggie there as it was designed to do just that. However, when I make changes to the controls in the html form (i.e. set different search parameters) nothing changes. Here's an example: First I set these parameters on the form

Search.aspx?keyword=hat&price=10&size=2

I then press the button on the form and perform a postback. The form's action attribute looks just like the above. But when I change the parameters of my search like this:

Search.aspx?keyword=headband&price=5&size=1

and press the button, I get the same results as the original search. I've checked my code to see if I've made any errors but found none. Then I right-click the page and select View Source to have a look at what's there. To my dismay, the html form's action attribute is still set to this:

Search.aspx?keyword=hat&price=10&size=2


No matter how many times I make changes to the parameters of the search and post the page back, the form's action attribute is still the same value. I can't change it for the life of me.

What's the problem? It's been three days already and I'm running out of hair (been pulling it out). Any help would be greatly appreciated.

Thanks,
Roshawn


P.S. This page is a content page. Perhaps this could be the issue but I can't see it.
.



Relevant Pages

  • Re: Form trouble
    ... Gaurav Vaish | www.mastergaurav.com ... I have a web page that contains an html form and has a few controls in it. ... I then press the button on the form and perform a postback. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Form trouble
    ... I have a web page that contains an html form and has a few controls in it. ... The html form and its controls are all server controls. ... When I perform a postback, the form's action attribute gets set by ASP.NET. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: C# only DataGrid for WebForm? EASY QUES!!!
    ... "creating" the html form using the literal controls (containing ... >> datagrid isn't showing? ... >> some datagrid properties such as height, width, ID, yada yada I need ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Forms collection in ASP.NET
    ... > I have an .aspx page that is rendered using an xml file and an xsl file. ... > The xsl file renders an html form and a number of controls on the page, ... > neither the html form nor the other controls are server controls.) ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: User Controls Dynamically Loaded and Nested
    ... Ah yes - the good ole Form collection - can always go to that as a last ... > taking into account the nesting of the controls, ... a Postback occurs during which I'd like to retrieve the Text ... >> user controls being nested and dynamically loaded. ...
    (microsoft.public.dotnet.framework.aspnet)