2012/03/23

Get Root Path of the Application


#region Get Root Path

    /// <summary>
    /// // To get Root path of the Application.
    /// </summary>
    /// <CreatedBy>Harish Kumar Chandna</CreatedBy>
    /// <CreatedDate>02/AUGUST/2011</CreatedDate>
    /// <returns></returns>
    public static string GetRootPath()
    {

        string strRootPath = string.Empty;
        if (HttpContext.Current.Request.ApplicationPath != "/")
            strRootPath = HttpContext.Current.Request.ApplicationPath + "/";
        else
            strRootPath = HttpContext.Current.Request.ApplicationPath;
        return strRootPath;
    }
    #endregion

0 comments:

Post a Comment