event order, confusing !

Results 1 to 4 of 4

Thread: event order, confusing !

  1. #1
    Join Date
    Dec 1969

    Default event order, confusing !

    hi all,<BR><BR>i am making a login user control, when a user logs in, Formsauthentication.SetAuthCookie(); is called...BUT the user is supposed to stay on that page..no redirection supposed to happen..only a message must be displayd upon a check for a cookie in the Page_Load() of that page.<BR><BR>the problem is that the cookie is created..i know that by Trace..but it seems that it is created after my code checks it !<BR>what should i do?!<BR><BR>

  2. #2

    Default RE: event order, confusing !

    Events happen after Page_Load.<BR>Is that your issue?

  3. #3
    Join Date
    Dec 1969

    Default does this mean..

    that anything to be changed in the page according to that event must be done in the event handler, if so..then yes ..this is my issue.<BR>i have to have the same code in both Page_Load and MyEventHandler methods, this is bad :(<BR>because i create the cookie in the event handler and check for it in the Page_Load. <BR>i did so because i wanted to check everytime he enters the page...( obviously this would not work on the first time when he clicks the button )<BR>thanx andrew :)

  4. #4

    Default RE: does this mean..

    Yes, but...<BR>You shouldn&#039;t repeat the code, break it out into annother function and call that function from Page_Load when required and from a handler when required.<BR><BR>I often have a Bind&#060;SomeName&#062;List() methods that have the logic required for binding a specific Datagrid/list/repeater<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts