c# .net Adsense ADO.NET Linq Viruses/security asp.net MVC JQuery Angular-js Node-js SEO Java C++ SQL API Networking vb.net .Net Css JavaScript Generics c#.Net entity framework HTML Website host Website Construction Guide HTTP tutorial W3C tutorial Web Services JSON Psychology Ionic framework Angular ReactJS Python Computer Android
asp.net MVC

Asp.net MVC Razor @Url.Content vs @Url.Action

| | ASP-NET , CSharp , MVC

Here, you can understand the difference between @Url.Content and @Url.Action in MVC Razor asp.net. If you want to pass the url for a file path for the website then you can pass it. It will resolve a virtual path into an absolute path.

It may jpeg/png/html etc...

@Url.Content("~/path/yourfile.jpg")

Url.Action is used to resolve an action from the controller. It invokes the action you can defined like this,

 

@Url.Action("ActionName", "ControllerName", new { variable = value })