Attach image to ActionLink in MVC 4

前端 未结 4 1925
旧巷少年郎
旧巷少年郎 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:19

    You only needed to change:

    new { id = "_logo"}
    

    to:

    new { @id = "_logo"} 
    

    Without the @ in front of id it treats it as a parameter instead of a attribute of the html element.

    Without the @, it would produce:

    www.site.com/home/index/_logo

    With the @, it would produce:

    www.site.com/home

    and the element would be:

    
    

提交回复
热议问题