如何获取页面所在的路径 通过http://bbs.myweb.com/test1/test2/mypage.aspx可以访问mypage.aspx,那么我在mypage.aspx.cs中怎么获取到test1/test2/ 路经? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 1.获取当前完整网址<script type="text/javascript"> thisURL = document.URL;thisHREF = document.location.href;thisSLoc = self.location.href;thisDLoc = document.location;strwrite = " thisURL: [" + thisURL + "]<br />"strwrite += " thisHREF: [" + thisHREF + "]<br />"strwrite += " thisSLoc: [" + thisSLoc + "]<br />"strwrite += " thisDLoc: [" + thisDLoc + "]<br />"document.write( strwrite ); </script>2.获取当前域名信息 <script type="text/javascript">thisTLoc = top.location.href;thisPLoc = parent.document.location;thisTHost = top.location.hostname;thisHost = location.hostname;strwrite = " thisTLoc: [" + thisTLoc + "]<br />"strwrite += " thisPLoc: [" + thisPLoc + "]<br />"strwrite += " thisTHost: [" + thisTHost + "]<br />"strwrite += " thisHost: [" + thisHost + "]<br />"document.write( strwrite ); </script>3.获取当前页面<script type="text/javascript"> tmpHPage = thisHREF.split( "/" );thisHPage = tmpHPage[ tmpHPage.length-1 ];tmpUPage = thisURL.split( "/" );thisUPage = tmpUPage[ tmpUPage.length-1 ];strwrite = " thisHPage: [" + thisHPage + "]<br />"strwrite += " thisUPage: [" + thisUPage + "]<br />"document.write( strwrite ); </script> string path = Request.ApplicationPath; http://heisetoufa.iteye.com/blog/311277 模板列内删除按钮怎么去ID值? 数据库上传问题 谁有好用的基于vs2005的工作流控件,我愿RMB asp.net验证控件,这个DDL的怎么做?速结~ 不懂韩语,却接了个韩语的活,那位大哥给出个主意,能做不? 关于web系统发布的问题 请问如何激发另一个页面中的事件? 关于Asp.net中编辑框的输入长度限制的问题,高手进,请赐教,急急急,在线等 可以简单快速开发B/S架构软件的快速开发平台(基于.net) Win7下调用DSOFramer控件打开Word报错 问下Spring.net的依赖注入问题以及程序集设计 大家都说说 得取网站运行时是32位还是64位
<script type="text/javascript">
thisURL = document.URL;
thisHREF = document.location.href;
thisSLoc = self.location.href;
thisDLoc = document.location;
strwrite = " thisURL: [" + thisURL + "]<br />"
strwrite += " thisHREF: [" + thisHREF + "]<br />"
strwrite += " thisSLoc: [" + thisSLoc + "]<br />"
strwrite += " thisDLoc: [" + thisDLoc + "]<br />"
document.write( strwrite );
</script>2.获取当前域名信息
<script type="text/javascript">thisTLoc = top.location.href;
thisPLoc = parent.document.location;
thisTHost = top.location.hostname;
thisHost = location.hostname;
strwrite = " thisTLoc: [" + thisTLoc + "]<br />"
strwrite += " thisPLoc: [" + thisPLoc + "]<br />"
strwrite += " thisTHost: [" + thisTHost + "]<br />"
strwrite += " thisHost: [" + thisHost + "]<br />"
document.write( strwrite );
</script>3.获取当前页面
<script type="text/javascript">
tmpHPage = thisHREF.split( "/" );
thisHPage = tmpHPage[ tmpHPage.length-1 ];
tmpUPage = thisURL.split( "/" );
thisUPage = tmpUPage[ tmpUPage.length-1 ];
strwrite = " thisHPage: [" + thisHPage + "]<br />"
strwrite += " thisUPage: [" + thisUPage + "]<br />"
document.write( strwrite );
</script>