hi
How Create Dynamic pages in asp.net mvc?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Francis SusaimichaelRank #466 · 5.4K reputationPosted Oct 11, 2015, 5:48 PM EDT
Mukesh KumarRank #119 · 18.2K reputationPosted Oct 11, 2015, 10:08 PM EDT
Your view
@{ var url = Url.RouteUrl("IndividualArticlesPost", new { categoryslug = Model.postCategory.CategorySlug, url = Model.PostUrl }); } //or direct create link @Html.RouteLink(Model.PostTitle, "IndividualArticlesPost", new { categoryslug = Model.postCategory.CategorySlug, url = Model.PostUrl }, new { @class = "title", @style = "color:#069; font-weight:bold;" })Your Routing in Global.asax
routes.MapRoute("IndividualArticlesPost", "articles/{categoryslug}/{url}", new { controller = "Articles", action = "View" }, new { categoryslug = @"\S+", url = @"\S+" });and it will create url like this..
http://www.dotnet-tutorial.com/articles/mvc/getting-started-with-custom-routing-in-asp-net-mvc
Hope this will help you.Francis SusaimichaelRank #466 · 5.4K reputationPosted Oct 10, 2015, 7:41 PM EDT
ali baharlo57 reputationPosted Oct 10, 2015, 9:19 PM EDT