user161433
user161433

Reputation: 4519

How do you Make a URL string in asp.net MVC

I am trying to make a url string to one of my mapped routes in the CS file. I can do it in the aspx file via the html helpers. How do you make a url in the CS file?

Upvotes: 2

Views: 190

Answers (2)

Atanas Korchev
Atanas Korchev

Reputation: 30661

You can use the UrlHelper class.

Upvotes: 2

Robert Harvey
Robert Harvey

Reputation: 180787

Create an instance of System.Web.Mvc.HtmlHelper in your C# method, and use that to call your Html Helper methods.

Upvotes: 1

Related Questions