у меня работает один веб-проект.Теперь я просто проблема в моем коде.этот код дает мне одну ошибку, как Control 'lbut_logout' of type 'LinkButton' must be placed inside a form tag with runat=server.
это мой код оформления главной страницы:
<div class="top-menu">
<ul class="nav navbar-nav pull-right">
<li class="dropdown dropdown-user dropdown-dark"><a href="#" class="dropdown-toggle"
data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
<%--<img alt="" class="img-circle" src="img/avatar9.jpg">--%>
<span class="username username-hide-mobile">
<asp:Label ID="lblusername" runat="server"></asp:Label></span> </a>
<ul class="dropdown-menu dropdown-menu-default">
<li><a href="extra_profile.html"><i class="icon-user"></i>My Profile </a></li>
<li><a href="page_calendar.html"><i class="icon-calendar"></i>My Calendar </a></li>
<li><a href="inbox.html"><i class="icon-envelope-open"></i>My Inbox <span class="badge badge-danger">3 </span></a></li>
<li><a href="#"><i class="icon-rocket"></i>My Tasks <span class="badge badge-success">7 </span></a></li>
<li class="divider"></li>
<li><a href="extra_lock.html"><i class="icon-lock"></i>Lock Screen </a></li>
<li><asp:LinkButton ID="lbut_logout" runat="server" OnClick="lbut_logout_Click"><i class="icon-key"></i>Log Out</asp:LinkButton></li>
</ul>
</li>
</ul>
</div>
теперь это работает нормально при навигации по двум страницам моего веб-продукта и при переходе на страницузатем я получаю эту ошибку, например:
Server Error in '/' Application.
Control 'lbut_logout' of type 'LinkButton' must be placed inside a form tag with runat=server.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Control 'lbut_logout' of type 'LinkButton' must be placed inside a form tag with runat=server.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): Control 'lbut_logout' of type 'LinkButton' must be placed inside a form tag with runat=server.]
System.Web.UI.Page.VerifyRenderingInServerForm(Control control) +9645406
System.Web.UI.WebControls.LinkButton.AddAttributesToRender(HtmlTextWriter writer) +45
System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer) +20
System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +20
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +66
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +128
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +13
System.Web.UI.Control.Render(HtmlTextWriter writer) +12
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +66
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +128
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +13
System.Web.UI.Page.Render(HtmlTextWriter writer) +29
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +66
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1303