Accessing route URLs in the controller in ASP.Net MVC -
asp.net mvc has nice features making sure have correct url route want. can use htmlhelper
class correct url views:-
@html.routelink("link text", new {controller = "articles", action = "tag"})
now great. however, find myself in situation want know url not writing view. question best way information in controller? have read various posts show how sneakily create instance of htmlhelper
there must more straightforward way of doing this.
thanks.
you can try urlhelper.routeurl. urlhelper
accessible via url property on controller.
Comments
Post a Comment