call JavaScript function from C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • iamthebest
    New Member
    • Mar 2007
    • 3

    call JavaScript function from C#

    Hello,

    I am trying to call a javscript function from c#. But it is not getting called. The error comes up saying funtionname is not defined even though it is defined and visible in page source.

    i have used Response.Write( "<script language='javas cript'>function name();</script>");

    and page.registercl ientscriptblock but both have the same problem.

    Any help is appreciated.
  • YKumar
    New Member
    • May 2007
    • 2

    #2
    I am also have the same doubt, Please reply if you know the answer.

    Comment

    • YKumar
      New Member
      • May 2007
      • 2

      #3
      I have the sameI have the sameI have the sameI have the sameI have the sameI have the sameI have the sameI have the sameI have the same

      Comment

      • Abdul Haque
        New Member
        • May 2007
        • 17

        #4
        have a look over this link
        http://www.codeproject .com/aspnet/ClientServer.as p

        Comment

        • Nikky
          New Member
          • Nov 2006
          • 25

          #5
          try this code
          At the
          <html>
          <head></head>
          <script language='javas cript'>
          function Hello()
          {
          alert("Hello Friends");
          }

          </script>
          </html>

          Call this function at Page_Load()
          {
          Button1.Attribu tes.Add("onClic k","Hello");
          }

          Comment

          Working...