Last post Dec 26, 2019 05:56 AM by Yongqing Yu
Dec 20, 2019 07:06 PM|Prathamesh Shende|LINK
On httpget action my url is
but after HttpPost action my url going back to
so how do i retain same url after postback.
I doing this project in asp.net core mvc
Dec 20, 2019 08:26 PM|mgebhard|LINK
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.
Dec 26, 2019 05:56 AM|Yongqing Yu|LINK
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"
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?