Guest sahil Posted November 3, 2005 Share Posted November 3, 2005 if i want to use two forms in one asp.net page .how could i do this.if i add attribute runat="server" in two form tags on same page ...it gives error as only one form can have runat="server" attribute Link to comment Share on other sites More sharing options...
kansasprog Posted November 20, 2005 Share Posted November 20, 2005 if i want to use two forms in one asp.net page .how could i do this.if i add attribute runat="server" in two form tags on same page ...it gives error as only one form can have runat="server" attribute<{POST_SNAPBACK}> use a user control for one of the forms Link to comment Share on other sites More sharing options...
aspnetguy Posted November 24, 2005 Share Posted November 24, 2005 Use only one form but have 2 submit buttons, create OnClick functions for each button. Each function can process the parts of the form you need.<body><script runat="server" language="c#">private void Page_Load(){}private void Button1_Click(object sender, System.EventArgs e){...do something}private void Button2_Click(object sender, System.EventArgs e){...do something}</script>...<form runat="server">...form fields, etc<input type="button" value="Button 1" id="Button1" runat="server" OnServerClick="Button1_Click" /><input type="button" value="Button 2" id="Button2" runat="server" OnServerClick="Button2_Click" /></form></body> Link to comment Share on other sites More sharing options...
ranw3schools Posted November 25, 2005 Share Posted November 25, 2005 if i want to use two forms in one asp.net page .how could i do this.if i add attribute runat="server" in two form tags on same page ...it gives error as only one form can have runat="server" attribute<{POST_SNAPBACK}> you can do this. use solution explorer->project->add pageto swith to the pagewrite code such as response.redirect("pagename.aspx") Link to comment Share on other sites More sharing options...
aspnetguy Posted December 1, 2005 Share Posted December 1, 2005 that is still only using one form per page and the same results can be acheived in 1 form and on only 1 page, that is why there are different event handlers.What is the specific reason you think you need to use 2 forms????Please post your needs and I can explain how to get it done. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now