473,387 Members | 1,540 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Form trouble

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.
Jan 15 '07 #1
4 1303
Form's action is set when the form is first loaded.
It will never change... the method is always post and that's what matters.
--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujini-labs.com
http://eduzine.edujinionline.com
-----------------------------------------
"Roshawn" <ra*********@yahoo.comwrote in message
news:eO**************@TK2MSFTNGP04.phx.gbl...
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.

Jan 15 '07 #2
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.
Jan 15 '07 #3
Gaurav Vaish (MasterGaurav) wrote:
Form's action is set when the form is first loaded.
It will never change... the method is always post and that's what matters.

Hmm, I wasn't aware of that. Thanks for the heads-up. :-)

Roshawn
Jan 15 '07 #4
bruce barker wrote:
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)
Are you saying that I can "set" the method property of an html form to "GET"? I thought that property was always set to
"POST" on a form created as a server control.

Hopefully, this could work.

Thanks again,
Roshawn
Jan 15 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Rick | last post by:
Hello, I'm having trouble with submitting my form when checking to see if data is present in the user-inputted fields. What I want to happen is for the user to input various pieces of data,...
2
by: chris vettese | last post by:
I've been having trouble with this for a long time. I have a form that has many subforms. In the subforms I have unbound text boxes in the footer that sum a field. I want to Display this sum on...
2
by: Julia Baresch | last post by:
Hi everyone, As some of you may know, we've been having trouble with an unrecognized database format error. Today I installed an unfinished project on the workstation of one of my users. ...
14
by: simonmarkjones | last post by:
Hi, I'm having a bit of trouble editing an old database that was created quite a while ago by someone else. There is a form that lets the user select a member of staff and show details about the...
7
by: Shaggyh | last post by:
hi im having trouble wondering can anyone help i have created a vb.net form in visual studio 2003 i would like to create a driver class to call this form in csharp im having trouble finding the...
8
by: AFN | last post by:
I want to have a routine in a page base class that will take all the text fields on a web form, and then HtmlEncode their values. I'm having trouble figuring out if I want to loop controls or...
15
by: carr4895 | last post by:
Hello. I was wondering if someone could help me too with a login form. Upon startup, I have to display a password screen and it should accept a user name and password. User name can be anything...
7
by: David | last post by:
Hi, I am having trouble with a form that I have loaded trying to access a procedure on the main form. The trouble seems to be that a Global Array that is declare in a Module is producing a...
0
by: scottf35 | last post by:
Hi, I am working on (read that - upgrading) an application. This application creates an HTTPWebRequest object, populates it with values which are then sucked out of the Request.Form object (eg...
2
by: Jaye | last post by:
Hi. I'm having some trouble with the code I'm using to validate a form. The form is used to query a database and users can enter multiple search criteria separated by commas. Since search criteria...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.