I want to add '-' or '+' in between words in url. For example url like:
http://localhost/bollywood/details/23-abhishek-back-from-dubai-holiday.htm
My Route Pattern is
routes.MapRoute(
name: "AddExtension",
url: "{controller}/{action}/{id}-{title}.htm",
defaults: new { controller = "Bollywood", action = "Details" }
);
I am creating a link like this on my View:
@Html.ActionLink(item.n_headline, "Details", new { id = item.News_ID, title = item.n_headline.ToSeoUrl() }, htmlAttributes: null)
My Bollywood controller is here
public ActionResult Details(int? id, string controller, string action, string title)
{
if (id == null)
{
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
}
tblBollywood tblbolly = db.tblBollywood.Find(id);
if (tblbollywood == null)
{
return HttpNotFound();
}
return View(tblbollywood);
}
item.headingand how is it generated?