Click here to Skip to main content
15,877,966 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hello i wanted to retrieve the parameter in response page how can retrieve this.

What I have tried:

here from my class i am sending some parameter to the page.
string email = "YOUR EMAIL";
           string password = "YOUR PASSWORD";

           string URLAuth = "http://localhost:2013/Default.aspx";
           string postString = string.Format("name={0}&inputPassword={1}", email, password);

           const string contentType = "application/x-www-form-urlencoded";
           System.Net.ServicePointManager.Expect100Continue = false;

           CookieContainer cookies = new CookieContainer();
           HttpWebRequest webRequest = WebRequest.Create(URLAuth) as HttpWebRequest;
           webRequest.Method = "POST";
           webRequest.ContentType = contentType;
           webRequest.CookieContainer = cookies;
           webRequest.ContentLength = postString.Length;
           webRequest.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/2008070208 Firefox/3.0.1";
           webRequest.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";

           StreamWriter requestWriter = new StreamWriter(webRequest.GetRequestStream());

           StreamReader responseReader = new StreamReader(webRequest.GetResponse().GetResponseStream());
           string responseData = responseReader.ReadToEnd();


and i want to retrieve this parameter in default.aspx
Updated 14-Jun-17 23:38pm

1 solution

string user = Request.Form["name"];
string password = Request.Form["inputPassword"];
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900