Javascript Code:
function jsfunction ()
{
var sayi = 9999;
alert('<%= cfunction("'+sayi+'")%>');
}
C# Code:
public string cfunction(string gelen)
{
return gelen;
}
Normally,There is should be 9999 value which is send to C# code from javascript code,but,this value returning as '+sayi+'.
Also,that’s gives me alert 9999.What am I wrong?
C# (server-side) can generate markup for client side, client side can’t call back up to server-side without some kind of Ajax type web request.
To do what you’re looking for you can create a C# webmethod
And consume the webmethod with a client-side jQuery.ajax() method (You’ll need the jQuery library script if you don’t have it already)