We are trying to modify the Action attribute of the main ASP.NET form in the master page dynamically.
The page has a radio button, user selects one of the options and clicks on submit, on postback, based on the selection the Form's action attribute should be set and the form should be submitted again automatically.
We were trying to use JavaScript for the same.
document.forms[0].action = "option1.aspx";
document.forms[0].submit();
But this doesn't seem to be working, there is no impact on the action attribute.
if we don't use a master page, this can be achieved easily by using
this.Form.Action = "option1.aspx";
ClientScript.RegisterStartupScript(this.GetType(),"test1",
"document.form[0].submit();",true);
Sadly, we cant remove the master page .. any pointers on how can this be achieved.. ?