Developers Heaven Forum

Desktop Programming => .NET Programming => ASP.NET => Topic started by: admin on August 20, 2011, 12:47:21 PM

Title: Read Post Data submitted to ASP.Net Form
Post by: admin on August 20, 2011, 12:47:21 PM
Read the Request.Form NameValueCollection and process your logic accordingly:
NameValueCollection nvc = Request.Form;string userName, password;
if (!string.IsNullOrEmpty(nvc["txtUserName"]))
{
userName = nvc["txtUserName"];
}
if (!string.IsNullOrEmpty(nvc["txtPassword"]))
{
  password = nvc["txtPassword"];
}
//Process login
CheckLogin(userName, password);


... where "txtUserName" and "txtPassword" are the Names of the controls on the posting page.