Post-back and user controls

Discussion in 'ASP .Net' started by James T., Apr 29, 2005.

  1. James T.

    James T. Guest

    Hello!

    How I can force user controls to reload on post-back?

    Thank you!
    James
     
    James T., Apr 29, 2005
    #1
    1. Advertising

  2. James T.

    Brock Allen Guest

    What exactly do you mean? If the user Control is declared on the page (in
    the ASPX file) then it's automatically "reloaded" upon postback. If it's
    dynamically added, then you'll have to recreate it yourself manually upon
    postback. Here's a sample I posted a while back (it doesn't do user controls,
    but they should work just the same):

    http://groups-beta.google.com/group...ic controls viewstate&rnum=1#a5717a97bd32c450

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > Hello!
    >
    > How I can force user controls to reload on post-back?
    >
    > Thank you!
    > James
     
    Brock Allen, Apr 29, 2005
    #2
    1. Advertising

  3. James T.

    James T. Guest

    I use some user controls to customise page layout...There are two user
    controls that check if the user is authenticated or not and display data
    based on this.

    My problem is that if I call FormsAuthentication.SignOut() it causes
    post-back, but other user controls on the page don't detect that the user is
    logged-off.

    James

    "Brock Allen" <> wrote in message
    news:...
    > What exactly do you mean? If the user Control is declared on the page (in
    > the ASPX file) then it's automatically "reloaded" upon postback. If it's
    > dynamically added, then you'll have to recreate it yourself manually upon
    > postback. Here's a sample I posted a while back (it doesn't do user
    > controls, but they should work just the same):
    >
    > http://groups-beta.google.com/group...ic controls viewstate&rnum=1#a5717a97bd32c450
    >
    > -Brock
    > DevelopMentor
    > http://staff.develop.com/ballen
    >
    >
    >
    >> Hello!
    >>
    >> How I can force user controls to reload on post-back?
    >>
    >> Thank you!
    >> James

    >
    >
    >
     
    James T., Apr 29, 2005
    #3
  4. James T.

    Brock Allen Guest

    > My problem is that if I call FormsAuthentication.SignOut() it causes
    > post-back, but other user controls on the page don't detect that the
    > user is logged-off.


    It's because during the postback to log out you're still authenticated. I'd
    suggest doing a Response.Redirect(Request.Path) in your event handler when
    you detect they want to logout. It isn't pretty, but it works.

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen
     
    Brock Allen, Apr 29, 2005
    #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. sk2000
    Replies:
    2
    Views:
    4,490
    Kumar
    Nov 12, 2003
  2. Chris

    Post Back and HTML Controls

    Chris, Nov 25, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    519
    chris
    Nov 25, 2003
  3. Joby
    Replies:
    0
    Views:
    1,667
  4. =?Utf-8?B?Z29yaWxsYQ==?=
    Replies:
    1
    Views:
    825
    Masudur
    May 25, 2007
  5. Wolfgang Brucker

    user controls: dynamiclly added child controls dont survive post back ?

    Wolfgang Brucker, Jan 14, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    554
    Victor Garcia Aprea [MVP]
    Jan 14, 2004
Loading...

Share This Page