<body> <form name="Form1" method="POST" action="process.aspx"> <input name="firstname" type="text" value="" /> <input name="lastname" type="text" value="" /> <input type="submit" value="Send" name="submit" /> </form> </body>
string firstname = Request.Form["firstname"]; string lastname = Request.Form["lastname"];
Quote:Read the Request.Form NameValueCollection and process your logic accordingly: C# 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.
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);
string firstname = HttpContext.Current.Request["firstname"]; or string firstname = Request.Form["firstname"];
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)