Tech Support Guy banner
  • Please post in our Community Feedback thread for help with the new forum software! If you are having trouble logging in, please Contact Us for assistance.
Status
Not open for further replies.
1 - 2 of 2 Posts

·
Registered
Joined
·
32 Posts
Discussion Starter · #1 ·
HI all,

I've added the loginstatus on all the pages to show a login button when not logged in and log out button when loged in. Everytime i click a link to change the page (to another page where also ive added loginstatus) It gives me an error. can anyone help me resolve the issue ?

here is the code of loginstatus>
[*]
<asp:LoginStatus ID="LoginStatus1" runat="server"
LoginImageUrl="~/images/login1.JPG" LogoutImageUrl="~/images/logout.JPG" />
Log In


it gives me the following error>

Control 'LoginStatus1' of type 'LoginStatus' 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 'LoginStatus1' of type 'LoginStatus' 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 'LoginStatus1' of type 'LoginStatus' must be placed inside a form tag with runat=server.]
System.Web.UI.Page.VerifyRenderingInServerForm(Control control) +8691203
System.Web.UI.WebControls.LoginStatus.RenderContents(HtmlTextWriter writer) +38
System.Web.UI.WebControls.LoginStatus.Render(HtmlTextWriter writer) +10
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
System.Web.UI.Page.Render(HtmlTextWriter writer) +29
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +12
 

·
Registered
Joined
·
696 Posts
I haven't use asp in many years, but the error message seems to tell you exactly what is needed:

Control 'LoginStatus1' of type 'LoginStatus' must be placed inside a form tag with runat=server.
Just wrap your <asp runat=server> tag in tags. More may be needed, but in this case the error message is telling you the exact problem.
 
1 - 2 of 2 Posts
Status
Not open for further replies.
Top