Nhuren
Nhuren

Reputation: 513

User control in Umbraco

Hey frenz I am new to Umbraco cms. And I am building site using it.Here I need to include the .net user control with some textboxs and submit button. But when I include the macro containing the .net user control in my templete and Run the site I got the error

Server Error in '/' Application.

Control 'ContentPlaceHolderDefault_News_2_Button1' of type 'Button' must be placed inside a form tag with runat=server.

I also watch the video tutorials about the Usercontrol in Umbraco. And followed the same process but i am still getting the error.

But it works fine if i used Html textbox and buttons

So, it there any solution for it.............

Upvotes: 0

Views: 1436

Answers (1)

idm
idm

Reputation: 1748

This is because the control 'ContentPlaceHolderDefault_News_2_Button1' of type 'Button' is not placed inside a form tag with runat=server. Every ASP>NET control that have attribute runat="server" must be placed inside a form tag with runat=server. The solution is easy:

  1. Put the form into your user control

or

  1. Make template that contains server form and acts as master page. Put your user control inside that template

Upvotes: 2

Related Questions