Results 1 to 6 of 6

Thread: Page_Load event

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2001
    Posts
    37

    Page_Load event

    I have observed an effect on my aspx pages that I just need to confirm. If I put in my .aspx code-behind file a custom function and after that, the code of my Page_Load event, asp.net ignores my Load event. This way:

    Public Function MyFunction() As String

    End Function

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    But if I change the position between the two routines, the Load event runs. Is it really mandatory that my Page_Load be the first routine of my page?

    Thanks,

    Robert

  2. #2
    Junior Member
    Join Date
    Sep 2002
    Posts
    23
    I have one Public Function and a few Private Functions and Subs in front of my Page_Load with no problems. Do you have the latest SP (Sp1?) installed.

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2001
    Posts
    37
    Hi.

    Yes. I have installed the SP2 and still have the same effect.

    Thanks,

    Robert

  4. #4
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    shouldnt make any difference unless you have some code the MyFunction that is causing a problem.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  5. #5
    Junior Member
    Join Date
    Sep 2002
    Posts
    23
    Well, I will believe it. I have run into some minor glitches.
    VB.NET REPLACE is supposed to return a zero-length string if there is a zero-length string coming in but it returns NOTHING.
    Code:
            Dim strW As String
            strW = " "
            strW = Trim(strW)
            If strW Is Nothing Then Stop
            strW = Replace(strW, " ", "_")
            If strW Is Nothing Then Stop '<-- Stops here

  6. #6
    Hyperactive Member SoftwareMaker's Avatar
    Join Date
    Mar 2001
    Location
    Elbonia with Dilbert and Wally
    Posts
    322
    Hi Robert

    ASP.NET is of a event-driven programming model just like what VB6 was.

    So, NO where you place your routines doesnt matter which runs first or second.

    Check your codes again to make sure or post your codes so that we might be able to help
    William T
    Software Architect / Chief Software Developer
    Softwaremaker.Net Pte Ltd
    http://www.Softwaremaker.net

    *** Things are always the darkest before they go pitch black ***

Posting Permissions

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



Click Here to Expand Forum to Full Width