asp.net mvc - path to controller action -
it no problem use html.actionlink in view obtain right path controller action. wondering whether possible in other layers (e.g. controller). asking because generating <ul>
recursively data access render 'link tree structure'. thanks!
christian
in controller can use urlhelper create url.
string html = string.empty; urlhelper url = new urlhelper(httpcontext.request.requestcontext); string edit = url.action(constants.action_edit, constants.ctrl_mycontroller, new { someid }); html += "<a href=\"" + edit + "\">edit</a> ";
this create string html link inside. in example use constants give correct action , controller, of course "normal" string.
let me know if need more scenarios
Comments
Post a Comment