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
In the html form, you need to supply additional viewstate variable and disable ViewState in a server page. This requires some control on both sides , though.
Form HTML:
Note empty __VIEWSTATE.
WebForm.aspx:
<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="WebForm.aspx.cs" Inherits="WebForm"
EnableEventValidation="False" EnableViewState="false" %>
Note EnableEventValidation="False", EnableViewState="false" to prevent validation error for empty view state.
Code Behind/Inherits values are not precise.
WebForm.cs:
public partial class WebForm : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string value = Encoding.Unicode.GetString(Convert.FromBase64String(this.postData.Text));
}
}