返回动态@ActionLink的文本

时间:2017-08-19 17:10:19

标签: html html-helper actionlink razor-2

我想在View中显示实际标签,以便用户可以复制,保存或书签。 ActionLink工作得很好,但是用户可能不够聪明,不能将鼠标悬停在它上面,或者目前还不敢点击它。我有一种感觉,这很简单,但它现在逃脱了我虚弱的大脑。

 <b>Now you can return and download your picture any time in the next 3 months. Using the link below or clicking on Download Later in navigation bar.</b>
    @Html.ActionLink("Download Link", "DownloadLater", "Home", new { photoId = Model.PhotoId, photoName = Model.PhotoName, pword = Model.PhotoPassword }, null)

1 个答案:

答案 0 :(得分:0)

好吧,也许我的问题不够明确。但我明白了。我使用网页的“Inspect”来获取html“a”标签,然后从那里对其进行增强,以确定用户是处于测试版还是生产版。因此它在每个中都是动态正确的。然后我意识到我根本不需要ActionLink,因为用户可能需要视觉保证链接:

    @Html.ActionLink("Download Link Webpage", "DownloadLater", "Home", new { photoId = Model.PhotoId, photoName = Model.PhotoName, pword = Model.PhotoPassword }, null)*@
    <br />
    <br />
  <a href="http://@ViewBag.ProdOrTest/Home/DownloadLater?photoId=@Model.PhotoId&photoName=@Model.PhotoName&pword=@Model.PhotoPassword" alt="link for picture downloads"><b>http://@ViewBag.ProdOrTest/Home/DownloadLater?photoId=@Model.PhotoId&photoName=@Model.PhotoName&pword=@Model.PhotoPassword</b></a>