Delay the Page_Load event?

Results 1 to 2 of 2

Thread: Delay the Page_Load event?

  1. #1
    Join Date
    Dec 1969

    Default Delay the Page_Load event?

    Is there any way to dealy the Page_Load events until after a submit button click member function has been run, or at least be able to determine which button was pressed. So that certain events can not be run, since they are determined by the results of the submit information.

  2. #2
    Join Date
    Dec 1969

    Default RE: Delay the Page_Load event?

    St3v3,<BR><BR>Allow me to try and answer this for you. Let&#039;s assume that the certain event that you run conditionally is a routine that populates a Select Box and sets its Visible property to true....<BR><BR>Protected Sub DoConditionalStuff()<BR> ....<BR>End Sub<BR><BR>Now, in your Page_Load event you would like to run that the first time through..<BR><BR>Private Sub Page_Load()<BR> If Not Page.IsPostBack Then<BR> Call DoConditionalStuff()<BR> End If<BR>End Sub<BR><BR>That way the Sub will only automagically be called on the initial Page_Load and for any Postbacks you will need to force it to be called by explicitly calling it. Something like this...<BR><BR><BR>Protected Sub MyButton_Click ()<BR><BR> If someCondition = someValue Then<BR> Call DoConditionalStuff()<BR> End If<BR><BR>End Sub<BR><BR>Does all that make sense??

Posting Permissions

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