Home > Archive > ASP .NET > April 2005 > Post-back and user controls
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Post-back and user controls
|
|
| James T. 2005-04-29, 4:01 pm |
| Hello!
How I can force user controls to reload on post-back?
Thank you!
James
| |
| Brock Allen 2005-04-29, 4:01 pm |
| 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...5717a97bd32c450
-Brock
DevelopMentor
http://staff.develop.com/ballen
> Hello!
>
> How I can force user controls to reload on post-back?
>
> Thank you!
> James
| |
| James T. 2005-04-29, 4:01 pm |
| 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" <ballen@NOSPAMdevelop.com> wrote in message
news:590449632503754302860448@msnews.microsoft.com...
> 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...5717a97bd32c450
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
>
>
>
| |
| Brock Allen 2005-04-29, 8:59 pm |
| > 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
|
|
|
|
|