How to POST a FORM from HTML to ASPX page

前端 未结 8 1617
你的背包
你的背包 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 03:47

    Hope this will help - Put this tag in html and

    remove your login.aspx design content..just write only page directive

    and you will get the values in aspx page after submit button click like this- protected void Page_Load(object sender, EventArgs e) {

            if (!IsPostBack)
            {
                CompleteRegistration();
            }
        }
    

    public void CompleteRegistration() {

            NameValueCollection nv = Request.Form;
            if (nv.Count != 0)
            {
                string strname = nv["txtbox1"];
                string strPwd = nv["txtbox2"];
            }
        }
    

提交回复
热议问题