Looking to pass variables from c# to javascript to use some jquery code. Passing doubles, ints, strings, arrays. Does anyone know how to do this?
for example if I ha
You can use public properties on the code behind as well as the session. Here is a sample using public properties that can be read from a Javascript function.
Front End:
function IsAgentInProgram()
{
var optStatus = "<%=AgentOptInStatus%>";
if (optStatus == "True")
alert("You are opted in!");
else
alert ("You are opted OUT");
}
Code Behind:
public bool AgentOptInStatus;
private void Page_Load(object sender, System.EventArgs e)
{
this.AgentOptInStatus = true;
}