asp.net MVC

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

Asp.net MVC Razor @Url.Content vs @Url.Action, someone asked me to explain?

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 })

Post your comments / questions