I have implemented a custom HttpHandler for my website which will redirect the page to a specific page if the page is in a list. So far the redirection is working fine but the issue is the content of the final page goes blank.
Code From My PageHandler:
public class CustomPageHandler : IHttpHandler
{
public bool IsReusable
{
get { return false; }
}
public void ProcessRequest(HttpContext context)
{
List<string> fileList = new List<string>();
fileList.Add("Page1.aspx");
fileList.Add("Page2.aspx");
foreach (string fileName in fileList)
{
if (context.Request.RawUrl.ToLower().Contains(fileName.ToLower()))
{
context.Response.Redirect("BlockedPage.aspx");
}
}
}
}
Code from my Web.Config file [Related to HttpHandler]
<httpHandlers>
.
.
.
<add verb="*" path="*.aspx" type="CustomPageHandler, App_Code"/>
</httpHandlers>
Anyone can help me to get out of this sticky situation? Thanks in advance...