.net adds params cls and rid when submitting form

G

Guest

Hi,

I have an aspx page with a web form. I need to change the page that this
form posts to depending on certain conditions.

To do so, I have Javascript code on the page that looks like:

function OnLoadFunc()
{
if(document.Form1.elements["state"].value == 'regd')
{
document.Form1.action ="new.aspx";
document.Form1.method = "post";
document.Form1.submit();
}
}


This function is invoked in the onLoad event of the html body tag. And by
default the form's action="old.aspx", method=post.

The problem is that during submit, params 'cls', and 'rid' are appended to
the action URL, so that the post tries to go to URL:

http://localhost/new.aspx&cls=wi25&rid=c01.

This url, being bogus, results in an error. Why are these params being
added when the method is post? How cna I stop .net from doing so? Any other
way to do this?

Thanks.
-Shefali
 
C

Cor Ligthert [MVP]

Shefali,

Why are you taking this client side actions in ASPX, while it goes quiet
easy on the server side with just a respond.redirect statement?

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top