I have this html:
<form action="/Home/Insert" method="POST" name="form1">
Name:
<input type="text" name="Name"/>
<br/>
Price:
<input type="text" name="Price"/>
<br/>
<button id="btnPost">Post Data</button>
</form>
When the form posts, my url changes to .../Home/Insert. I don't want my url to be changed when posting, how can i do this?
Either redirect the client (HTTP 3xx, server side) or use an AJAX request (user side) to keep the user on the same page.
That's how HTTP works.
When you POST to a URL, the browser navigates to that URL.
You may want to modify the server to redirect back to the original URL after the POST.