ASP.NET与Javascript中获取URL地址的各种方法
2010-12-08 17:20
597 查看
Javascript
Location Property Result
location.hash #test
location.host localhost:1351
location.hostname localhost
location.href http://localhost:1351/WebSite1/dir/Default.aspx/adsf?id=12#test
location.pathname /WebSite1/dir/Default.aspx/adsf
location.port 1351
location.protocol http:
location.search ?id=12
ASP.NET
Request Property Result Remark
Request.ApplicationPath /WebSite1 相对于应用程序(而非虚拟目录)根目录的路径
Request.PhysicalApplicationPath C:/Documents and Settings/wstone.SPANSION/Desktop/WebSite1/
应用程序根目录的物理路径
Request.PhysicalPath C:/Documents and Settings/wstone.SPANSION/Desktop/WebSite1/dir/Default.aspx
当前请求的物理路径
Request.PathInfo /adsf 附加的路径信息
Request.RawUrl /WebSite1/dir/Default.aspx/adsfid=12 前请求相对于应用程序根目录的路径
Request.Url http://localhost:1351/WebSite1/dir/Default.aspx/adsf?id=12 当前请求的完整路径(不包括#之后的)
Request.CurrentExecutionFilePath /WebSite1/dir/Default.aspx
Request.FilePath /WebSite1/dir/Default.aspx
Request.Path /WebSite1/dir/Default.aspx/adsf
Request.ServerVariables["SERVER_NAME"] localhost
Request.ServerVariables["SERVER_PORT"] 1351
Request.ServerVariables["SERVER_PORT_SECURE"] 0
Server.MapPath("~")
C:/Documents and Settings/wstone.SPANSION/Desktop/WebSite1
Server.MapPath("~/")
C:/Documents and Settings/wstone.SPANSION/Desktop/WebSite1/
Server.MapPath("~/1.jpg")
C:/Documents and Settings/wstone.SPANSION/Desktop/WebSite1/1.jpg
Location Property Result
location.hash #test
location.host localhost:1351
location.hostname localhost
location.href http://localhost:1351/WebSite1/dir/Default.aspx/adsf?id=12#test
location.pathname /WebSite1/dir/Default.aspx/adsf
location.port 1351
location.protocol http:
location.search ?id=12
ASP.NET
Request Property Result Remark
Request.ApplicationPath /WebSite1 相对于应用程序(而非虚拟目录)根目录的路径
Request.PhysicalApplicationPath C:/Documents and Settings/wstone.SPANSION/Desktop/WebSite1/
应用程序根目录的物理路径
Request.PhysicalPath C:/Documents and Settings/wstone.SPANSION/Desktop/WebSite1/dir/Default.aspx
当前请求的物理路径
Request.PathInfo /adsf 附加的路径信息
Request.RawUrl /WebSite1/dir/Default.aspx/adsfid=12 前请求相对于应用程序根目录的路径
Request.Url http://localhost:1351/WebSite1/dir/Default.aspx/adsf?id=12 当前请求的完整路径(不包括#之后的)
Request.CurrentExecutionFilePath /WebSite1/dir/Default.aspx
Request.FilePath /WebSite1/dir/Default.aspx
Request.Path /WebSite1/dir/Default.aspx/adsf
Request.ServerVariables["SERVER_NAME"] localhost
Request.ServerVariables["SERVER_PORT"] 1351
Request.ServerVariables["SERVER_PORT_SECURE"] 0
Server.MapPath("~")
C:/Documents and Settings/wstone.SPANSION/Desktop/WebSite1
Server.MapPath("~/")
C:/Documents and Settings/wstone.SPANSION/Desktop/WebSite1/
Server.MapPath("~/1.jpg")
C:/Documents and Settings/wstone.SPANSION/Desktop/WebSite1/1.jpg
相关文章推荐
- 在asp.net中获取mac地址的方法(C#后台获取的方法和前台Javascript(调用ActiveX)获取的方法)
- ASP.net获取当前url各种属性(文件名、参数、域名等)的方法[转载]
- ASP.NET 获取url信息的各种方法-Request-asp.net关注
- ASP.net获取当前url各种属性(文件名、参数、域名等)的方法
- 通过ASP.NET获取URL地址方法
- [ASP.NET]Request获取url信息的各种方法比较
- ASP.net获取当前url各种属性(文件名、参数、域名等)的方法
- asp.net Request获取url信息的各种方法比较
- ASP.NET 取得 Request URL 的各个部分和通过ASP.NET获取URL地址的方法
- [ASP.NET]Request获取url信息的各种方法比较
- ASP.net获取当前url各种属性(文件名、参数、域名等)的方法
- ASP.net获取当前url各种属性(文件名、参数、域名 等)的方法
- ASP.net获取当前url各种属性(文件名、参数、域名等)的方法
- ASP.NET 取得 Request URL 的各个部分和通过ASP.NET获取URL地址的方法
- ASP.net获取当前url各种属性(文件名、参数、域名等)的方法
- ASP.net获取当前url各种属性(文件名、参数、域名 等)的方法
- [ASP.NET]Request获取url信息的各种方法比较
- C#/Asp.Net 获取各种Url的方法
- ASP.net获取当前url各种属性(文件名、参数、域名 等)的方法