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
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