codepaq
Write it down before it's gone.
Friday, October 16, 2015
Genenrate full Url (absolute Url) using C# in ASP.NET MVC
A quick way to generate full Url (absolute Url) in ASP.NET MVC:
Url.Action("Details", "Product", new { id = p.ProductID}, Request.Url.Scheme)
If without id, simply use null in the parameter.
Url.Action("Details", "Product", null, Request.Url.Scheme)
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment