asp.net mvc - Assigning an icon instead of text for ActionLink -


i trying replace link text in here class contains icon:

 @html.actionlink("edit",                    "editsatellitemeeting",                    "bylaws",                     new { id = meeting.blclubsatellitemeetingid,                           bylawsid = model.bylawsid },                     new { @class = "js-opendialog",                           data_dialog_id = "addsatellitemeetingdialog",                          data_dialog_title = "edit  satellite meeting" }) 

i understand common solution use @url.action.

but when try parser error.

this breaks

<a href="@url.action("editsatellitemeeting", "bylaws",                       new { id = meeting.blclubsatellitemeetingid,                             bylawsid = model.bylawsid },                       new { @class = "js-opendialog icon edit",                            data_dialog_id = "addsatellitemeetingdialog",                           data_dialog_title = "edit  satellite meeting" })"></a> 

so this

 <a href="@url.action("editsatellitemeeting", "bylaws",                         new { id = meeting.blclubsatellitemeetingid,                               bylawsid = model.bylawsid,                               @class = "js-opendialog icon edit",                               data_dialog_id = "addsatellitemeetingdialog",                              data_dialog_title = "edit  satellite meeting" })"></a> 

if you're using a + url.action instead of html.actionlink, can put html attributes directly a-tag.

<a class = "js-opendialog icon edit"    data_dialog_id = "addsatellitemeetingdialog"    data_dialog_title = "edit  satellite meeting"    href='@url.action("editsatellitemeeting", "bylaws",               new { id = meeting.blclubsatellitemeetingid,                     bylawsid = model.bylawsid })'>     <!-- icon here --> </a> 

there's no url.action overload contains html attributes, makes sense, because can't put html attributes url string.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -