Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 9 of 9

Thread: Page_Load Method

  1. #1
    sam.bengtson is offline Member
    Join Date
    Jan 2011
    Posts
    64

    Default Page_Load Method

    Hey guys this page load method isn't running. Can anybody see whats wrong with this darn thing? Thanks
    Code:
    <script runat="server">
    
        
        public void  Page_Load(object sender, EventArgs e)
        {
            if (HttpContext.Current.User.Identity.IsAuthenticated != false)
            {
                
                user.Visible = true;
                loginUser.Visible = false;
                headerLabel2.Text = usernameLabel;
                headerLabel2.Visible = true;
                headerlabel1.Visible = false;
           
        }
    }
        
        </script>
    Last edited by sam.bengtson; 01-25-2011 at 03:27 PM. Reason: typo

  2. #2
    webopius is offline Senior Member
    Join Date
    Nov 2008
    Location
    London, UK
    Posts
    440

    Default

    Missing a } ?

  3. #3
    sam.bengtson is offline Member
    Join Date
    Jan 2011
    Posts
    64

    Default

    oh no haha I just copied it wrong. I fixed it in the post but thanks for the reply..anybody have any suggestions

  4. #4
    sam.bengtson is offline Member
    Join Date
    Jan 2011
    Posts
    64

    Default

    please? lol

  5. #5
    cjbarth is offline Senior Member
    Join Date
    Oct 2008
    Posts
    392

    Default

    Did you try stepping in to the code to see what is happening, particularly what the value of IsAuthenticated is?

    Try removing the If...Then statement and see if the code runs then. Otherwise, you might not have the event handlers hooked up.
    ML9.3.1.1
    SQL 2012 Express
    VS 2010
    Azure VM

  6. #6
    sam.bengtson is offline Member
    Join Date
    Jan 2011
    Posts
    64

    Default

    well I know the code works because I'm calling the exact same code elsewhere with an onClick tag. It just aint workin

  7. #7
    cjbarth is offline Senior Member
    Join Date
    Oct 2008
    Posts
    392

    Default

    It is probably that your event handlers aren't wired up correctly. Have you tried adding the Handles operator after the function definition?
    ML9.3.1.1
    SQL 2012 Express
    VS 2010
    Azure VM

  8. #8
    sam.bengtson is offline Member
    Join Date
    Jan 2011
    Posts
    64

    Default

    hmm what do you mean? Can you give me an example of these examples?

  9. #9
    cjbarth is offline Senior Member
    Join Date
    Oct 2008
    Posts
    392

    Default

    Code:
            Protected Sub quickorderform_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    
            End Sub
    ML9.3.1.1
    SQL 2012 Express
    VS 2010
    Azure VM