1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

loginstatus causing problems vs2008

Discussion in 'Software Development' started by bretta91, Dec 31, 2010.

Thread Status:
Not open for further replies.
  1. bretta91

    bretta91 Thread Starter

    Joined:
    May 22, 2010
    Messages:
    32
    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>
    <li><a href="login.aspx">
    <asp:LoginStatus ID="LoginStatus1" runat="server"
    LoginImageUrl="~/images/login1.JPG" LogoutImageUrl="~/images/logout.JPG" />
    <span class="dis_none">Log In</span>
    </a></li>





    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
     
  2. TerryNet

    TerryNet Moderator

    Joined:
    Mar 23, 2005
    Messages:
    78,197
    First Name:
    Terry
    Please do not start multiple threads on the same topic. Continue here.
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/971758

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice