Skip to content

Instantly share code, notes, and snippets.

@sh0umik
Created July 18, 2016 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sh0umik/06148d6314a41873f1b54277df25c6d6 to your computer and use it in GitHub Desktop.
Save sh0umik/06148d6314a41873f1b54277df25c6d6 to your computer and use it in GitHub Desktop.
# HTML Part
`
<form>
<input type="post" method="server.asp" >
<input type="submit" value="Submit">
</form>
`
# Server Part
# Get the data from the POST in server.asp
`
string[] keys = Request.Form.AllKeys;
for (int i= 0; i < keys.Length; i++)
{
Response.Write(keys[i] + ": " + Request.Form[keys[i]] + "<br>");
}
`
# Then Process your logic in server.asp and create strings or array then write the response as JSON
`
var json = Json.Encode(new {
name = data["val1"],
something = data["val2"] as bool?,
class = data["val3"] as DateTime?
});
Response.Write(json);
`
# Grab the JSON Response from server using JQuery
use jQuery Json Serializer to output that json to HTML file ....
#austProgrammingSolve
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment