How to Call Javascript funtion in a VB.net Code behind

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wolverine2512
    New Member
    • Jan 2008
    • 4

    #1

    How to Call Javascript funtion in a VB.net Code behind

    Hello .Net Wizards!

    I would like to seek your help on how to call javascript function from code behind of VB.net. I have javascript function named Openform() and i want to execute it on page load, if not page.ispostback ...

    I know how to do this on javascript (on load attribute on the body of html), what i want is to execute the javascript function through vb.net code behind...

    Thanks a lot....in advance.
  • Shashi Sadasivan
    Recognized Expert Top Contributor
    • Aug 2007
    • 1435

    #2
    You would have to use the Page.RegisterCl ientScriptBlock method, and pass the javascript function as a parameter

    You would not need the function to be explicitly written in the .aspx page, but needs to be stored as a string in your code which will be passed tot he method above

    Comment

    • maria80e
      New Member
      • Jan 2008
      • 12

      #3
      Could you please explain in detail with example?

      Comment

      Working...