开发者

ASP.NET MVC creating an Ajax.ActionLink that is an image and text

I'm building a project with ASP.NET MVC2 and i have a problem. According to the application GUI design, I have a menu that should be generated to be like that:

<ul id="toc">
                <li><a href="A.html"><img src="img/green_led.png" width="17px" /> Page (A)</a></li>
                <li><a href="B.html"><img src="img/yellow_led.png" width="17px" /> Page (B)</a></li>
                <li><a href="C.html"><img src="img/red_led.png" width="17px" /> Page (C)</a>开发者_开发百科;</li>
                <li><a href="D.html"><img src="img/red_led.png" width="17px" /> Page (D)</a></li>

In oder to generate those links, I use Ajax.ActionLink to generate the links, but it generates the menu like this

<ul id="toc">

                <li><a href="A.html"> Page (A)</a><img src="img/green_led.png" width="17px" /></li>
                <li><a href="B.html"> Page (B)</a><img src="img/yellow_led.png" width="17px"/></li>
                <li><a href="C.html"> Page (C)</a><img src="img/red_led.png" width="17px"/></li>
                <li><a href="D.html"> Page (D)</a><img src="img/red_led.png" width="17px" /></li>   

as u can notice the image is generated after the anchor tag not inside it.

Any suggestions to solve this isue?


this is solution Create an ActionLink with HTML elements in the link text

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜