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

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -