I’m confused… I have a form on my aspx page which the text fields sit inside an update panel. I use this to validate a login. If the login is successful, I change the form action and I want the form to then submit to that url.
<form runat="server" id="form1">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<!--form fields-->
<asp:Button ID="btnSubmit" runat="server" onclick="btnSubmit_click" Text="Continue" />
</ContentTemplate>
</asp:UpdatePanel>
</form>
Then my codebehind
protected void btnSubmit_click(object sender, EventArgs e)
{
//do some validation, if ok then change the form action
form1.Action = "myurl2.aspx";
btnSubmit = "proceed to next url";
}
So once the user has been validated, I change the URL of the form to post to, then change the button name. When I then click the submit button nothing happens. How can I submit the form? I tried doing something like form1.submit but obviously that doesn’t exist!
Try calling
or