Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. LoginStatus not working within master page

LoginStatus not working within master page

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptdebugginghelp
2 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jboyd111
    wrote on last edited by
    #1

    I have a user control on my site (in directory UserControls/UserInfo. When I drop the control onto a page created from my master page template, it does nothing (i.e. you click on the "login" link and nothing happens). I even added an explicit link to a Login.aspx url on the LoginStatus line, which will work. However, the LogOut link does not work. I've found I can drop this user control onto any new, blank (i.e. not derived from MasterPage.master) and all works as expected. Also, when I run in debug mode, I get the following error when I click on the Login link: "Microsoft JScript runtime error: Object doesn't support this property or method" The method highlighted is: "theForm.submit();" This call is in the javascript function created to do the postback: function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit(); } } The javascript issues I just listed may be a red herring. I've included the user control code below. Any assistance on why this doesn't work within master pages would be helpful and greatly appreciated. <%@ Control Language="C#" AutoEventWireup="true" CodeFile="UserInfo.ascx.cs" Inherits="UserControls_UserInfo" %>
    ReelPushMowers
    Catalog Admin

    Welcome!

    You are not logged in.

    L 1 Reply Last reply
    0
    • J jboyd111

      I have a user control on my site (in directory UserControls/UserInfo. When I drop the control onto a page created from my master page template, it does nothing (i.e. you click on the "login" link and nothing happens). I even added an explicit link to a Login.aspx url on the LoginStatus line, which will work. However, the LogOut link does not work. I've found I can drop this user control onto any new, blank (i.e. not derived from MasterPage.master) and all works as expected. Also, when I run in debug mode, I get the following error when I click on the Login link: "Microsoft JScript runtime error: Object doesn't support this property or method" The method highlighted is: "theForm.submit();" This call is in the javascript function created to do the postback: function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit(); } } The javascript issues I just listed may be a red herring. I've included the user control code below. Any assistance on why this doesn't work within master pages would be helpful and greatly appreciated. <%@ Control Language="C#" AutoEventWireup="true" CodeFile="UserInfo.ascx.cs" Inherits="UserControls_UserInfo" %>
      ReelPushMowers
      Catalog Admin

      Welcome!

      You are not logged in.

      L Offline
      L Offline
      LloydJJ
      wrote on last edited by
      #2

      ...make sure that you don't have any other form controls on your page that have ID="submit". This caused the same error on my system whilst converting an HTML layout to ASP.NET because JavaScript was referencing a form element called submit, rather than the submit() method of the form.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups