asp.net mvc - MVC Controller return RedirectToAction Id + #id -
hello im trying redirect user blog section , works fine want user land on bottom of site section ( #section-variants ) cant figure out im doing wrong there other way of passing along
public actionresult blogcomment_delete(int? id, int? postid) { if (id.hasvalue) { notification model = db.notifications.find(id.value); if (model != null) { db.notifications.remove(model); db.savechanges(); } } return redirecttoaction("blogpost", "blog", new { id = postid + "#section-variants" }); }
you should use method - redirectresult
:
return new redirectresult(url.action("blogpost", "blog", new { id = postid }) + "#section-variants");
Comments
Post a Comment