Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. calling a .NET function within a javascript function

calling a .NET function within a javascript function

Scheduled Pinned Locked Moved Web Development
csharpquestionjavascripttutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tprashanth
    wrote on last edited by
    #1

    Hi, I have two functions; one is in C# and the other one is in javascipt. There is a need for me to call the C# function inside the javascipt function. How can I achieve this? (please give an example using either C# or VB.NET)

    K 1 Reply Last reply
    0
    • T tprashanth

      Hi, I have two functions; one is in C# and the other one is in javascipt. There is a need for me to call the C# function inside the javascipt function. How can I achieve this? (please give an example using either C# or VB.NET)

      K Offline
      K Offline
      ketankumar
      wrote on last edited by
      #2

      To the best of my knowledge, you cannot call a server side function from client side script (i.e. Javascript). I think there is only way to achieve this, i.e. use AJAX.

      R 1 Reply Last reply
      0
      • K ketankumar

        To the best of my knowledge, you cannot call a server side function from client side script (i.e. Javascript). I think there is only way to achieve this, i.e. use AJAX.

        R Offline
        R Offline
        RichardGrimmer
        wrote on last edited by
        #3

        Not strictly true - put a hidden button on the form (Width="0" NOT Visible="false" cos this will prevent it being rendered), then get the javascript to click the button using document.getElementById('myButton').click(); "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups