I want to do JavaScript alert in static method server side code in asp.net with C#. I tried many ways, but it's not working.
For example, I tried
[WebMethod]
public static void EntrySave(string schoolName)
{
Response.Write("<script>alert('Hello');</script>");
}
and
[WebMethod]
public static void EntrySave(string schoolName)
{
ScriptManager.RegisterStartupScript(this, GetType(), "showalert",
"alert('Only alert Message');", true);
}
and many more. But it's not showing alert in webstatic method.