Click here to Skip to main content
15,889,909 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
i have a aspx file which parse form control within form control. when this page is being viewed then nested form control is not there. but is viewing in red color when i see that page as view source. I want both form tag to work. nested form tag is coming on page dynamically.

What I have tried:

i don't want to javascript or jquery for putting form tag within a control.
Posted
Updated 6-Jan-17 0:51am
v2
Comments
F-ES Sitecore 6-Jan-17 4:52am    
You can't nest forms in html.
Gaurav Gupta A Tech Guy 6-Jan-17 4:56am    
i have aspx page which contain form tag by default. but there is need to put a form tag to post data.
F-ES Sitecore 6-Jan-17 5:11am    
This is a very common problem when coding with webforms, especially when using master pages. As I said, you can't nest forms, there is no way around that so simply forget it as a solution. The best solution depends where the form needs to post to. If it posts back to the same page then this is possible to get working, if it has to post to a different site then you're going to have to use javascript or change how your forms are laid out so that they are not nested.

1 solution

In asp.net webform We usually use postbackUrl property button to post to different page.
This looks like this
<asp:Button ID="Button1" runat="server" Text="Button" PostBackUrl="~/Contact.aspx" />

You can not use a nested form.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900