how to invoke javascrip alert() in page_load() of asp.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lathamoulali
    New Member
    • May 2008
    • 25

    how to invoke javascrip alert() in page_load() of asp.net

    Hello Frnds,

    I am new to the ASP.NET Programming.Ple ase help me out with this problem.
    I have a page_load() method in which i have to invoke the javascrip's alert method.I am using inline code.how to do this.?

    JavaScript:aler t('America');

    Thanks in advance.
    Latha.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Put your JavaScript into a function and then set your <body> tag to call the function that displays the alert.


    Eg:

    <body onload="loadFun ction()">


    Remember that the On_Load method in your .NET code is executed On the Server....the onload in your <body> tag is executed on the client's side (in the browser).

    -Frinny

    Comment

    Working...