Gets the path of the current request 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>
publicstaticclass Util
{
/// <summary>
/// Gets the path of the current request relative to the application base path.
/// </summary>
publicstatic string RelativePath(HttpContext context)
{
if (context.Request.ApplicationPath == "/")
{
return context.Request.Path;
}
else
{
return context.Request.Path.Substring(context.Request.ApplicationPath.Length);
}
}
}