Redirects to a path relative to the application base path.
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Reflection;
using System.Xml;
using System.Web;
/// <summary>
/// Common utility functions.
/// </summary>
public static class Util
{
/// <summary>
/// Redirects to a path relative to the application base path.
/// </summary>
public static void RelativeRedirect(HttpContext context, string relativePath)
{
string redir = context.Request.ApplicationPath + relativePath;
if (context.Request.ApplicationPath == "/")
{
redir = relativePath;
}
context.Response.Redirect(redir);
}
}
Related examples in the same category