<a> tag href to website page in htm template</a>

时间:2013-02-22 09:34:06

标签: asp.net

我有一些htm模板用于在我的网站中发送电子邮件。其中一个在开发环境中具有硬编码的Web地址。 (ip地址是我们临时托管它以进行测试的地方)现在它将被托管,如何设置此href以便它始终解析为该页面的路径。我可以在每次单击链接时检索路径并重写htm文件,但这似乎效率低下,必须有一种方法可以在htm模板中解析。

<p>
        <b>Your temporary Password is:&#32;</b><i><%Password%></i><br/>
        Follow this link to change your password<br/>
        <!--the href below will have to be changed once its hosted-->
        <a href="**http://25.39.286.15/Account/ChangePassword.aspx**"> Change your password here </a>
    </p>

我已经尝试过这种方式,但它在Page.ResolveUrl的左尖括号VS2012中生成编码错误

<a href='<%#Page.ResolveUrl(Eval("Account/ChangePassword.aspx"))%>'> Change your password here </a>

1 个答案:

答案 0 :(得分:0)

这不会起作用,不管位置如何?

<a href="<%=Page.ResolveUrl("~/Account/ChangePassword.aspx") %>">Change Password</a>