Geeks With Blogs
AzamSharp Some day I will know everything. I hope that day never comes.
How many times you have seen this error: Control 'Button2' of type 'Button' must be placed inside a form tag with runat=server. I bet lot of times. This error comes when you place your control outside the form tag. The fix is very easy just go to html view and cut the control code and paste it inside the form tags OR cut the form ending tag and place it after the control tag. A much better way is to actually see where the form tags end. You can easily see this in Visual Studio by selecting "View" and than "Details". Now you can see where the form tag starts and where it ends. This way you can just drag and drop your controls in the safe area between the form tags.
Posted on Tuesday, July 26, 2005 12:56 PM | Back to top


Comments on this post: Put an end to "Control 'Button2' of type 'Button' must be placed inside a form tag with runat=server"

# Thank you very mush dear
Requesting Gravatar...
you saved ME !!!!!!!!!!!!
Left by ali on Jun 08, 2007 4:04 AM

# re: Put an end to "Control 'Button2' of type 'Button' must be placed inside a form tag with runat=server"
Requesting Gravatar...
I am rendering ajax timer in following way
Timer1.RenderControl(htmlTextWriter);

I have taken every care that timer be present within form tag but I getting the same error "Control 'Timer1' of type 'Timer' must be placed inside a form tag with runat=server". please help me.
Left by Devendra on Mar 03, 2008 8:04 PM

# re: Put an end to "Control 'Button2' of type 'Button' must be placed inside a form tag with runat=server"
Requesting Gravatar...
i m getting error like dis
Left by ambi on May 14, 2008 6:34 PM

Your comment:
 (will show your gravatar)


Copyright © Mohammad Azam | Powered by: GeeksWithBlogs.net