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

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -