Hugo Woesthuis Hugo Woesthuis - 1 year ago 73
JSON Question

Is it possible to programmatically execute JSON queries with C# (ASP.NET)

As the title says: is it possible?

You should think of the following scenario: I press a button in ASP.NET -> some C# backend -> Execute a JSON string

So something like this:

protected void Unnamed1_Click(object sender, EventArgs e)
string check = (string)(Session["usr"])

if(check == null;)
// Execute JSON

Does anyone know how to do this?

Thanks in advance.

Answer Source

You need to use this method

RegisterStartupScript(scriptname, jsonstring);

This will put the script on top of the html page. Further read:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download