How can I resolve the virtual file path to a browser-friendly path from a common .ashx handler?
eg. I want to convert:
~/asp/ClockState.aspx
at
/NextAllowed/asp/ClockState.aspx
If I was WebForm Page, I could call ResolveUrl:
Page.ResolveUrl("~/asp/ClockState.aspx")
which permits:
/NextAllowed/asp/ClockState.aspx
But I am not a WebForm page, I am a general handler. You know that an object IHttpHandlerwith all types of injections:
public class ResetClock : IHttpHandler
{
public void ProcessRequest (HttpContext context)
{
context.Response.Redirect("~/asp/ClockState.aspx", true);
}
public bool IsReusable { get { return false; } }
}
source
share