Good day. I have this question.
On asp.net there is a HttpHandler button in PostBackUrl
<asp:Button ID="Button1" PostBackUrl ="/handler.axd?qsd=10" runat="server" Text="Button" /> This handler, by clicking on the button, returns a file from the database. The URL of the page remains the same, for example http://localhost:56278/Default . But there are cases when it returns nothing and in this case the URL becomes http://localhost:56278/handler.axd . How, in case there is nothing to return, return something of type alert (); without updating the page and changing its URL?
An example of my handler:
public class Document: IHttpHandler { public void ProcessRequest(HttpContext context) { HttpRequest Request = context.Request; HttpResponse Response = context.Response; Response.AddHeader("Content-Disposition", "attachment; filename=somefile.ext"); Response.ContentType = "application/javascript"; Response.Write("<script type ='text/javascript'>alert('Error!');</script>"); } public bool IsReusable { get { return false; } } }