How to call server side method thru javascript
-
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,
-
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,
-
I would look into PageMethods, its an ajax thing which allows you to call server side code from javascript.
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 )
-
I would look into PageMethods, its an ajax thing which allows you to call server side code from javascript.
-
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 )