I have ashx file and I want to redirect from ashx to aspx page. Some solution?
The Response. Redirect method redirects a request to a new URL and specifies the new URL while the Server. Transfer method for the current request, terminates execution of the current page and starts execution of a new page using the specified URL path of the page.
When you use Response. Redirect("Default. aspx",true ) which is by default true then the execution of current page is terminated and code written after the Response. Redirect is not executed instead of executing code written after the Response.
An ASHX file is a webpage that is part of an ASP.NET web server application. It contains references to other pages hosted on the web server that are sent to the user's web browser. ASHX files are processed by the server's ASP.NET HTTP Handler when a client web browser requests the page.
void ProcessRequest(HttpContext context)
{
context.Response.Redirect(newUrl);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With