c# - Using HTML.ActionLink with a <li> -


i doing front-end dev work , being exposed c# first time. trying change menu navigation each list item clickable, rather inside each list item. example (if static html):

<li><a href="#">link</a></li> 

change to

<a href="#"><li>link</li></a> 

this menu using html.actionlink however, looks this:

<li>@html.actionlink("blah", "index", "blahblah", new { area = "shared" }, null)</li> 

how change link applied whole list item?

thanks!

you may use url.action method along typical html markup.

<a href="@url.action("index","home")" title="go home"><li>link</li></a> 

this generate markup this

<a href="home/index" title="go home"><li>link</li></a> 

change parameters(action method/controller names) values of url.action method needed.

url.action helper method generates qualified url action method.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -