Is it possible to use an ActionLink containing an element?

前端 未结 5 1446
[愿得一人]
[愿得一人] 2021-01-11 14:43

As the question says, Is it possible to use an ActionLink containing an element, and if not, what is the best way to achieve it?

For example, lets say I have a

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-11 15:16

    You can not specify a html tag inside actionlink, but I can suggest you two solutions: 1 extend the actionlink with your function. So you can also implement actionlink that generate href with other htmal tag inside (img or span like in your case)

    2 using the url.content in the href. It's like your actual workaround but better because you use the rules you have defined in the global.asax instead of using "magic string"

提交回复
热议问题