灯火互联
管理员
管理员
  • 注册日期2011-07-27
  • 发帖数41778
  • QQ
  • 火币41290枚
  • 粉丝1086
  • 关注100
  • 终身成就奖
  • 最爱沙发
  • 忠实会员
  • 灌水天才奖
  • 贴图大师奖
  • 原创先锋奖
  • 特殊贡献奖
  • 宣传大使奖
  • 优秀斑竹奖
  • 社区明星
阅读:2528回复:0

SEO静态网站的页面中实现链接全路径

楼主#
更多 发布于:2012-08-31 20:21


后台页面
public partial class Page : System.web.UI.Page
{
    public String path;
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Label1.Text = Request.QueryString["ID"]+Request["ImgUrl"];
        path = "http://" + Request.Url.Host + HttpContext.Current.Request.ApplicationPath+"/";
    }
}
前台页面
[html]
<html xmlns="www.atcpu.com" >
<head runat="server">
    <title></title>
    <script type="text/javascript" src="<%=path%>JS/json2.js"></script>
</head>
<body>
    <div>
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
        <img src="<%=path%>Images/0001.png" />
    </div>
</body>
</html>
作者:jason819


喜欢0 评分0
游客

返回顶部