这是调用页的代码:
--
 string requestPath = CommunityGlobals.RemovePathInfo(Context.Request.Path.ToLower());
--
CommunityGlobals.cs中
---
        //*********************************************************************
        //
        // RemovePathInfo Method
        //
        // Removes the extended information after a page path.
        // For example, removes the Web service information after
        // the .asmx file name.
        //
        //*********************************************************************
 
        public static string RemovePathInfo(string requestPath) {
            string _pathInfo = HttpContext.Current.Request.PathInfo;
            if (_pathInfo.Length == 0)
                return requestPath;
               
            return requestPath.Substring(0, requestPath.Length - _pathInfo.Length);   
       
        }

---

大家看到了吧,老外没用用HttpRequest.FilePath来得到不带附加资源的url,呵呵

相关文章:

  • 2021-08-13
  • 2021-09-01
  • 2021-09-20
  • 2021-07-26
  • 2021-11-22
  • 2021-05-05
  • 2021-08-27
  • 2021-04-24
猜你喜欢
  • 2021-05-19
  • 2021-06-22
  • 2021-05-24
  • 2021-06-27
  • 2022-12-23
  • 2021-06-24
  • 2021-04-11
相关资源
相似解决方案