How to POST a FORM from HTML to ASPX page

前端 未结 8 1589
你的背包
你的背包 2020-11-30 03:36

How do I post a form from an HTML page to and ASPX page (2.0) and be able to read the values?

I currently have an ASP.NET site using the Membership provider and ever

相关标签:
8条回答
  • 2020-11-30 04:08

    You sure can. Create an HTML page with the form in it that will contain the necessary components from the login.aspx page (i.e. username, etc), and make sure they have the same IDs. For you action, make sure it's a post.

    You might have to do some code on the login.aspx page in the Page_Load function to read the form (in the Request.Form object) and call the appropriate functions to log the user in, but other than that, you should have access to the form, and can do what you want with it.

    0 讨论(0)
  • 2020-11-30 04:11

    The Request.Form.Keys collection will be empty if none of your html inputs have NAMEs. It's easy to forget to put them there after you've been doing .NET for a while. Just name them and you'll be good to go.

    0 讨论(0)
提交回复
热议问题