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. ASP.NET
  4. How to call server side method thru javascript

How to call server side method thru javascript

Scheduled Pinned Locked Moved ASP.NET
helptutorialquestionjavascriptsysadmin
5 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.
  • K Offline
    K Offline
    kantipudi
    wrote on last edited by
    #1

    Hi, I have a function in javascript which is called on 'onload ' event of the body. This function, takes the values from windows.dialogArguments and assigns it to textbox1.text. After this assignment, I want to call a server side function. But my problem is that, the server side function gets executed first before javascript function gets executed. How can I make it sequential? Here's the situation with example: javascript function function LoadFunc() { var val=window.dialogArguments; document.form1.txtMessage.value=val; <%databind()%> -- server side function. } This function is called on 'onload' event of the body tag. But the problem is databind() gets executed first! Any help is greatly appreciated.... Thanks,

    S 1 Reply Last reply
    0
    • K kantipudi

      Hi, I have a function in javascript which is called on 'onload ' event of the body. This function, takes the values from windows.dialogArguments and assigns it to textbox1.text. After this assignment, I want to call a server side function. But my problem is that, the server side function gets executed first before javascript function gets executed. How can I make it sequential? Here's the situation with example: javascript function function LoadFunc() { var val=window.dialogArguments; document.form1.txtMessage.value=val; <%databind()%> -- server side function. } This function is called on 'onload' event of the body tag. But the problem is databind() gets executed first! Any help is greatly appreciated.... Thanks,

      S Offline
      S Offline
      SHatchard
      wrote on last edited by
      #2

      I would look into PageMethods, its an ajax thing which allows you to call server side code from javascript.

      C K 2 Replies Last reply
      0
      • S SHatchard

        I would look into PageMethods, its an ajax thing which allows you to call server side code from javascript.

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        Is it an ASP.NET AJAX thing ? AJAX itself doesn't have anything like that AFAIK.

        Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        S 1 Reply Last reply
        0
        • S SHatchard

          I would look into PageMethods, its an ajax thing which allows you to call server side code from javascript.

          K Offline
          K Offline
          kantipudi
          wrote on last edited by
          #4

          I know about ajax and Icallback interfaces also,why dont you guys think in a different way...

          1 Reply Last reply
          0
          • C Christian Graus

            Is it an ASP.NET AJAX thing ? AJAX itself doesn't have anything like that AFAIK.

            Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

            S Offline
            S Offline
            SHatchard
            wrote on last edited by
            #5

            Sorry, should have mentioned that its part of the ASP.net AJAX framework, i am not sure if its included in any others.

            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