Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate URL inside a Controller in ASP.NET MVC

Is there a way to generate URL inside a controller? I want to do the following inside a controller instead of a view.

<% =Url.Action("Validate", "Home", New With {.ValidID = ID})%>

like image 222
fireBand Avatar asked Feb 28 '23 16:02

fireBand


1 Answers

Just remove the "Bee-stings."

Something like:

url = Url.Action("Validate", "Home", New With {.ValidID = ID})
like image 60
John Gietzen Avatar answered Mar 07 '23 22:03

John Gietzen