How to POST a FORM from HTML to ASPX page

前端 未结 8 1635
你的背包
你的背包 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:54

    This is very possible. I mocked up 3 pages which should give you a proof of concept:

    .aspx page:

    code behind:

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        For Each s As String In Request.Form.AllKeys
            Response.Write(s & ": " & Request.Form(s) & "
    ") Next End Sub

    Separate HTML page:

    ...and it regurgitates the form values as expected. If this isn't working, as others suggested, use a traffic analysis tool (fiddler, ethereal), because something probably isn't going where you're expecting.

提交回复
热议问题