In ASP.net C#, I can get the value that a user typed into a form named txtName with Request.Form["txtName"].
How do I get the value with javascript / jquery?
I’ve tried $('#txtName').val(), but this gives me the value specified in the HTML markup, not the value that the user entered and submitted.
You can’t. The data isn’t exposed to any API JavaScript can access.
You would have to use something server side to include it somewhere in the DOM, or generate a
<script>element that stores it in a variable.