user control event fires after content page page_load

M

mortb

Hi.

I have a page that has a user control as a header on it:

-------------------------------------------------------------------
| Header linkButton: logout |
-------------------------------------------------------------------
| Content page |
| |
| List of items |
| ------------- |
| Item1 |
| Item2 |
| etc... |
| |
| |
-------------------------------------------------------------------

(this user control header is to be used on all pages of my site)

As you can see from the draft above the header user control has a link to log out.
In the code behind the click event for this linkbutton calls FormsAuthenticaiton.SignOut.
My problem is that this does not redirect the user to the log in page specified in the web.config.
Instead the content page is displayed as if reloaded.
The user has to click the logout link two times(!) for him to be signed out and redirected.
I've tried to Response.Redirect to the login page from the link button click event, but as I have included the
header control on the login page as well this causes an infinite loop.

Any suggestions?
I think it would be neat if I can find a solution to this one, instead of having to re-think and re-write.

cheers,
mortb
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top