Order of loading pages...

Discussion in 'ASP .Net' started by Seth Broomer, Apr 29, 2004.

  1. Seth Broomer

    Seth Broomer Guest

    Hi, i have a .aspx Page, inside that page is a web user control.

    The user control is basically a login control.

    if the user is logged in the page shows one thing.
    if the user isn't logged in it shows something else (basically telling them
    to login)


    but i have noticed that when the user logs in through the control, first the
    page_load event on the .aspx page is ran,
    then the onclick event for the login image event on the web control is
    ran...but because of that order, now i need to access the page_load event on
    the .aspx page again... is there a way to reference that .aspx page?

    thanks
     
    Seth Broomer, Apr 29, 2004
    #1
    1. Advertising

  2. Seth Broomer

    matt Guest

    You can reference the Parent page that contains the user control using
    the syntax Parent.Page. This should give you access to al public
    properties and methods of the .aspx page.

    Matt
    http://www.3internet.co.uk



    "Seth Broomer" <> wrote in message
    news:...
    > Hi, i have a .aspx Page, inside that page is a web user control.
    >
    > The user control is basically a login control.
    >
    > if the user is logged in the page shows one thing.
    > if the user isn't logged in it shows something else (basically telling

    them
    > to login)
    >
    >
    > but i have noticed that when the user logs in through the control,

    first the
    > page_load event on the .aspx page is ran,
    > then the onclick event for the login image event on the web control is
    > ran...but because of that order, now i need to access the page_load

    event on
    > the .aspx page again... is there a way to reference that .aspx page?
    >
    > thanks
    >
    >
     
    matt, Apr 30, 2004
    #2
    1. Advertising

  3. Seth Broomer

    Sam Guest

    If your page class is called Default I believe you can go
    ((Default)this.Page) and access any properties. Someone else here can
    back me up on this.

    But there is no way to get back to PageLoad after OnClick of your user
    control. See this page for details:
    http://aspalliance.com/articleViewer.aspx?aId=134&pId=

    However, you should be able set any properties of the page or the user
    control in the OnClick event of the user control.

    What are you trying to do exactly?

    -Sam




    "Seth Broomer" <> wrote in message news:<>...
    > Hi, i have a .aspx Page, inside that page is a web user control.
    >
    > The user control is basically a login control.
    >
    > if the user is logged in the page shows one thing.
    > if the user isn't logged in it shows something else (basically telling them
    > to login)
    >
    >
    > but i have noticed that when the user logs in through the control, first the
    > page_load event on the .aspx page is ran,
    > then the onclick event for the login image event on the web control is
    > ran...but because of that order, now i need to access the page_load event on
    > the .aspx page again... is there a way to reference that .aspx page?
    >
    > thanks
     
    Sam, Apr 30, 2004
    #3
  4. Seth Broomer

    Seth Broomer Guest

    Sorry for taking so long.

    I have a login user control on the page.
    let say they come to a chat page, and they have a message that says they
    first have to login before they can chat. on the left hand side is the login
    control where they put their username and password.

    they then log in, and the chat page allows them to chat(by basically loading
    up a different part of the page)

    but i have a bunch of lil' pages like this, so that i can't specifically say
    check this page....so i have to reference the parent page. however when i
    try and do that, it doesn't like it...

    ugh!

    "Sam" <> wrote in message
    news:...
    > If your page class is called Default I believe you can go
    > ((Default)this.Page) and access any properties. Someone else here can
    > back me up on this.
    >
    > But there is no way to get back to PageLoad after OnClick of your user
    > control. See this page for details:
    > http://aspalliance.com/articleViewer.aspx?aId=134&pId=
    >
    > However, you should be able set any properties of the page or the user
    > control in the OnClick event of the user control.
    >
    > What are you trying to do exactly?
    >
    > -Sam
    >
    >
    >
    >
    > "Seth Broomer" <> wrote in message

    news:<>...
    > > Hi, i have a .aspx Page, inside that page is a web user control.
    > >
    > > The user control is basically a login control.
    > >
    > > if the user is logged in the page shows one thing.
    > > if the user isn't logged in it shows something else (basically telling

    them
    > > to login)
    > >
    > >
    > > but i have noticed that when the user logs in through the control, first

    the
    > > page_load event on the .aspx page is ran,
    > > then the onclick event for the login image event on the web control is
    > > ran...but because of that order, now i need to access the page_load

    event on
    > > the .aspx page again... is there a way to reference that .aspx page?
    > >
    > > thanks
     
    Seth Broomer, May 3, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. amw
    Replies:
    1
    Views:
    3,008
    Chris Smith
    Sep 25, 2003
  2. Soren Kuula
    Replies:
    2
    Views:
    503
    Soren Kuula
    Feb 1, 2004
  3. cspoh
    Replies:
    0
    Views:
    252
    cspoh
    Jul 31, 2003
  4. Stephan Kämper
    Replies:
    2
    Views:
    240
    Stephan Kämper
    Jan 18, 2004
  5. ofir
    Replies:
    0
    Views:
    187
Loading...

Share This Page