c# - How to redirect to a asp.net core razor page (no routes) -
here have razor cs page:
public iactionresult onpost(){ if (!modelstate.isvalid) { return page(); } return redirecttopage('pages/index.cshtml'); }
and cshtml page:
@page @using razorpages @model indexmodel <form method="post"> <input type="submit" id="submit"> </form>
i want redirect same page on form submit keep getting 400 error. possible redirect without using routes , go cshtml file in url?
try in view;
@using (html.beginform()) { <input type="submit" id="submit"> }
wiki
Comments
Post a Comment