Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > use client side code to trigger the load of page must use GET Protocol?

Reply
Thread Tools

use client side code to trigger the load of page must use GET Protocol?

 
 
Matt
Guest
Posts: n/a
 
      01-18-2004
The following code is the drop down box, and when user changes the
selection, it will display the value of the selection automatically by the
onchange event. This code works fine with GET Protocol.

<html>
<body>
<form name="eventform" action="eventtest3.asp" method="GET">
<select name="id" onchange="location.href='eventtest3.asp?id='+this. value">
<option value="select">select</option>
<option value="1001">1001</option>
<option value="1002">1002</option>
<option value="1003">1003</option>
</select>
<%= Request.Querystring("id") %>
</form>
</body>
</html>

However, if I use POST protocol, it doesn't work anymore.

<html>
<body>
<form name="eventform" action="eventtest4.asp" method="POST">
<select name="id" onchange="location.href='eventtest4.asp'">
<option value="select">select</option>
<option value="1001">1001</option>
<option value="1002">1002</option>
<option value="1003">1003</option>
</select>
<%= Request.Form("id") %>
</form>
</body>
</html>

My question is: do we need to use GET protocol to trigger the reload of the
page?? Can I use POST protocol to accomplish the same task??


Please advise. Thanks!



 
Reply With Quote
 
 
 
 
Brynn
Guest
Posts: n/a
 
      01-18-2004

Even with the GET protocol ... you are not submitting the form in
either example.

You are not getting the GET one because of submission, you are getting
it because it is in the link ... that's all ... the form is not doing
anything.

what you want to do in EACH form is have ....

<select name="id" onchange="document.eventform.submit()">

placing this line in each sample should make both of them work. The
querystring for the first will be built by the form submission.

Brynn
www.coolpier.com


On Sat, 17 Jan 2004 19:29:14 -0800, "Matt" <(E-Mail Removed)>
wrote:

>The following code is the drop down box, and when user changes the
>selection, it will display the value of the selection automatically by the
>onchange event. This code works fine with GET Protocol.
>
><html>
><body>
><form name="eventform" action="eventtest3.asp" method="GET">
> <select name="id" onchange="location.href='eventtest3.asp?id='+this. value">
> <option value="select">select</option>
> <option value="1001">1001</option>
> <option value="1002">1002</option>
> <option value="1003">1003</option>
> </select>
><%= Request.Querystring("id") %>
></form>
></body>
></html>
>
>However, if I use POST protocol, it doesn't work anymore.
>
><html>
><body>
><form name="eventform" action="eventtest4.asp" method="POST">
> <select name="id" onchange="location.href='eventtest4.asp'">
> <option value="select">select</option>
> <option value="1001">1001</option>
> <option value="1002">1002</option>
> <option value="1003">1003</option>
> </select>
><%= Request.Form("id") %>
></form>
></body>
></html>
>
>My question is: do we need to use GET protocol to trigger the reload of the
>page?? Can I use POST protocol to accomplish the same task??
>
>
>Please advise. Thanks!
>
>
>


I participate in the group to help give examples of code. I do not guarantee the effects of any code posted. Test all code before use!

Brynn
www.coolpier.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute client-side code _after_ client-side validation? Bogdan ASP .Net 2 06-09-2008 01:31 PM
LinkButton Client side code firing before server side code alexmac262@hotmail.com ASP .Net 1 03-22-2007 06:13 PM
server side code access the text of <asp:label> changed by client-side javascript code? nick ASP .Net 3 12-15-2004 06:26 PM
how client-side presentation code interacts with server-side sorting/filter code? jrefactors@hotmail.com Java 1 12-08-2004 12:30 AM
Safe to have client-side AND server-side page load event procedures? Fred ASP .Net 2 07-12-2004 06:46 PM



Advertisments