怎样让网站只显示首页地址? 用asp。net2005怎样让url不论点击哪个页面都只显示首页地址?最好能提供完整例程代码,谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不是要连接到首页,是想在url地址栏一直只显示首页地址 可以在global.asax中处理 Application_BeginRequest(object sender, EventArgs e) 强制转到你的首页,但是与静态页和JS跳转到静态面可能不好处理使用URLRewrite URLRewrite 或者是用 iframe location.href=""Context.RewritePath 执行返回结果,不跳转Server.Execute(url); <html><body><iframe id="main" frameborder="0" scrolling="auto" src="首页地址" width="" height="" style="z-index:2;"></iframe></body></html> Server.Transfer()这个方法,浏览器会跳转但是Url内容不会变,不过这样浏览器压力会变大!~ iframe顶,不过,我觉得你没必要都显示成首页地址,你可以把其它页面弄成别加密过后的URL地址, <iframe src="#" name="main"></iframe>点的连接<a href="要的显示的页面" target="main"> url重写好像不行吧. 觉得最简单就是用iframe, 或者像google一样, 用ajax. 有的一些做法,只有一个首页呢。其他页面全部通过参数动态生成。----Server.Transfer <%@ Page Language="C#" AutoEventWireup="true" CodeFile="MainFrm.aspx.cs" Inherits="Mainframe_MainFrm" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head id="Head1" runat="server"> <title>Love</title> <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR" /> <meta content="C#" name="CODE_LANGUAGE" /> <meta content="JavaScript" name="vs_defaultClientScript" /> <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema" /> <link type="text/css" href="/CSS/common.css" rel="Stylesheet" /></head><frameset rows="56,*,0" framespacing="0" marginwidth="0" marginHeight="0" LEFTMARGIN="0" TOPMARGIN="0"> <frame name="frmTop" src="TopFrm.aspx" scrolling="no" noresize="noresize" frameborder="0"/> <frame name="frmBody" src="BodyFrm.aspx" scrolling="no" noresize="noresize" frameborder="0"/> <frame name="frmFoot" src="FootFrm.aspx" scrolling="no" noresize="noresize" frameborder="0"/> </frameset></html>用JS动态替换frame的src,页面永远只显示“Love” ... 我主要是想用来防止人家直接打url地址访问功能页面而已,因为我只有首页设了用户检验,(ps:vb语言的!新手 不是很懂该怎么实现!大家如果有好建议就传授一下 ,分数不够我可以加!谢谢大家啦) sessin["username"]== null 就跳到首页 <frameset cols="190,*" framespacing="0" border="0" frameborder="0"> <frame name="menu" target="main" marginwidth="0" marginheight="0" scrolling="auto" noresize src="left.aspx"> <frame name="main" marginwidth="0" marginheight="0" scrolling="auto" noresize src="main.aspx"> <noframes> <body topmargin="0" leftmargin="0"> <p>此网页使用了框架,但您的浏览器不支持框架。</p> </body> </noframes></frameset><td class="style1" onmouseout="javascript:this.className='lt0';" onclick="javascript:top.main.location.href='link.aspx'" onmouseover="javascript:this.className='lt1';" align="center"><span class="x">友情连接</span></td><iframe runat="server" id="fileMain" name="fileMain" scrolling="yes" marginwidth="0" marginheight="0" frameborder="0" style="height: 535px; padding-left:0px; width:800px;" src=""></iframe><a href="ManagerBuinessForm.aspx" target="fileMain">管理公司形象</a>我感觉还是用框架好,只是我用的两个框架 56视频链接放到我主页上播放,怎样设置不要在播完后自动播放下一个节目? 如果开发一个既支持web有支持wap的网站,是不是通常他们分开开发? ASP.NET(C#)怎么做一个注册后发送确认邮件的程序 工厂模式 ASP.NET 存取图片问题 SQL2005 and Vs2005 问题 主体声明 C#正常运行要.Net Framework的支持? ASP.NET的datagrid的超链列怎样传递两个参数 我的TreeView控件为什么突然不能用了? 火车票订购项目问题 DropDownList问题
Context.RewritePath
Server.Execute(url);
<body>
<iframe id="main" frameborder="0" scrolling="auto" src="首页地址" width="" height="" style="z-index:2;"></iframe>
</body>
</html>
顶,
不过,我觉得你没必要都显示成首页地址,你可以把其它页面弄成别加密过后的URL地址,
<a href="要的显示的页面" target="main">
或者像google一样, 用ajax.
Server.Transfer
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MainFrm.aspx.cs" Inherits="Mainframe_MainFrm" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Love</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR" />
<meta content="C#" name="CODE_LANGUAGE" />
<meta content="JavaScript" name="vs_defaultClientScript" />
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema" />
<link type="text/css" href="/CSS/common.css" rel="Stylesheet" />
</head>
<frameset rows="56,*,0" framespacing="0" marginwidth="0" marginHeight="0" LEFTMARGIN="0" TOPMARGIN="0">
<frame name="frmTop" src="TopFrm.aspx" scrolling="no" noresize="noresize" frameborder="0"/>
<frame name="frmBody" src="BodyFrm.aspx" scrolling="no" noresize="noresize" frameborder="0"/>
<frame name="frmFoot" src="FootFrm.aspx" scrolling="no" noresize="noresize" frameborder="0"/>
</frameset>
</html>
用JS动态替换frame的src,页面永远只显示“Love” ...
sessin["username"]== null 就跳到首页
<frame name="menu" target="main" marginwidth="0" marginheight="0" scrolling="auto" noresize src="left.aspx">
<frame name="main" marginwidth="0" marginheight="0" scrolling="auto" noresize src="main.aspx">
<noframes>
<body topmargin="0" leftmargin="0"> <p>此网页使用了框架,但您的浏览器不支持框架。</p> </body>
</noframes>
</frameset>
<td class="style1" onmouseout="javascript:this.className='lt0';"
onclick="javascript:top.main.location.href='link.aspx'"
onmouseover="javascript:this.className='lt1';" align="center"><span class="x">友情连接</span></td>
<iframe runat="server" id="fileMain" name="fileMain"
scrolling="yes" marginwidth="0" marginheight="0" frameborder="0"
style="height: 535px; padding-left:0px; width:800px;" src=""></iframe>
<a href="ManagerBuinessForm.aspx" target="fileMain">管理公司形象</a>我感觉还是用框架好,只是我用的两个框架