Attach image to ActionLink in MVC 4

前端 未结 4 1928
旧巷少年郎
旧巷少年郎 2021-01-14 01:33

I am using ActionLink with id in MVC 4 app and assinging actionLink id an image in css but on on earth I am doing wrong. is not working! here is my code

 <         


        
4条回答
  •  臣服心动
    2021-01-14 02:07

    The best way you can do for both Html.ActionLink and Ajax.ActionLink is as below

    @Html.Raw(@Html.ActionLink("[replacetext]", "Index", "Home").ToHtmlString().Replace("[replacetext]", ""))
    
    
    @Html.Raw(@Ajax.ActionLink("[replacetext]", "Index", "Home", new AjaxOptions { UpdateTargetId="dvTest"}).ToHtmlString().Replace("[replacetext]", ""))
    

    additionaly you want to provide class and style so you can do as following

    @Html.Raw(@Ajax.ActionLink("[replacetext]", "Index", "Home", new AjaxOptions { UpdateTargetId="dvTest"}).ToHtmlString().Replace("[replacetext]", ""))
    

提交回复
热议问题