Page_Load subroutine

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Yongsub Eric Shin

    Page_Load subroutine

    Hi all.

    Just one question about Page_Load subroutine

    I have the following code

    <script runat="server">
    Sub Page_Load
    if Not Page.IsPostBack then
    dim mycountries=New ArrayList
    mycountries.Add ("Norway")
    mycountries.Add ("Sweden")
    mycountries.Add ("France")
    mycountries.Add ("Italy")
    end if
    end sub
    </script>

    and after all, i have this <asp:blahblah- /> line to
    display the elements in the array.

    but everytime when i looked at this page, i don't see any
    of the displays..

    i also tried

    sub Page_load
    msg1.text = "welcome"
    end sub

    and..<asp:label id = "msg1" runat ="server">

    but the text "welcome" does not show up.

    What's wrong with this?

    I need this really badly right now
    Thank you all

  • Natty Gur

    #2
    Re: Page_Load subroutine

    Hi,

    1) your function is missing eventhandler delegator parameters.
    2) you need to declare which event this function is handle.

    <script runat="server">
    Sub Page_Load(ByVal sender as System.Object, ByVal e as
    System.EventArg s) Handels MyBase.Load

    end sub
    ....


    Natty Gur[MVP]

    blog : http://weblogs.asp.net/ngur
    Mobile: +972-(0)58-888377


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!

    Comment

    Working...