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

ios - Is 'init' forbidden as *part* of a variable name? -

angular - Angular2 Router: Cannot find primary outlet to load 'HomeComponent' -

qt - Microsoft FTP Service 451 The parameter is incorrect -