How to pass route attribute but not pass the htmlattribute in ActionLink in ASP.Net MVC 5 -


i want know why don't have overload action link below.

@html.actionlink(displayname, actionname,controllername,routevalue)  @html.actionlink(@item.resume.resumename, "details","resume", new { id=item.id}) 

when below works fine

@html.actionlink(displayname, actionname,controllername,routevalue,"")  @html.actionlink(@item.resume.resumename, "details","resume", new { id=item.id},"") 

i checked overload , 4 parameter overload available

@html.actionlink(displayname, actionname,controllername, htmlattribute) 

so, beginner , wondering there particular reason not having overload routevalue 4th argument(last argument). current framework, if need send routevalue mandatory me set 5th parameter (empty string).

the actionlink() methods allow add route values and/or html attributes, both of accept object arguments.

if signature just

@html.actionlink(string displayname, string actionname, string controllername, object routevalues) 

then if pass new { id = 1 } argument 4th parameter, there no way distinguish if wanted added route value or html attribute.

note there no overload @html.actionlink(string displayname, string actionname, string controllername, object htmlattributes) claim. overload actually

@html.actionlink(string displayname, string actionname, string controllername, object routevalues, object htmlattributes) 

or

@html.actionlink(string displayname, string actionname, object routevalues, object htmlattributes) 

and add route values, typically pass null last parameter.


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -