How can i call code behind ( C#) function from javascript?

Posted by See29ram under ASP.NET on 12/5/2011 | Points: 10 | Views : 2381 | Status : [Member] | Replies : 1
Suppose i have a function in code behind which loads a dropdownlist from database.I want to call this function from javascript.How it is possible?




Responses

Posted by: Arefin on: 12/5/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,

This is very simple. Just use following code in you javascript code:

<%= serverside_variable %>

here, serverside_variable is a variable used/initialized by code behind (c#);


Thanks,
Arefin

See29ram, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response