Hello, On httpget action my url is https://localhost:44345/dc/Invoice/17776?CustomerID=4 but after HttpPost action my url going back to https://localhost:44345/dc/Invoice/17776 so how do i retain same url after postback.
I doing this project in asp.net core mvc
Add the query string to post action.
<form method="post" action="/dc/Invoice/17776?CustomerID=4">
You can also use a helper like @Url.Action() to build the URL.
Hi Prathamesh,
As @mgebhard said, you can do it the way he recommends you, and you can also refer to this method:
<form action="@Url.Action("Invoice", "dc")?CustomerID=4" enctype="multipart/form-data" method="POST">
You can aslo refer to this link for more details :
How can I preserve the url (with the querystring) after an Http Post but also add an error to the Model State?
Best Regards,
YongQing.