I have the following Razor code:
@{
if (IsPost)
{
string pn=Request.Form["pn"];
if (!string.IsNullOrEmpty(pn)){
/* my code to call the stored procedure with pn as a parameter*/
}
}
}
And in the page, using JavaScript / HTML I need to tell the user about pn. Be it that it’s empty, or report back that the value was inserted in the database.
How do I do that?
You need to insert the result into the rendering. There are a couple of ways of doing that. You could store it in a variable:
Or you could call a function, sort of like JSONP: