I am programmatically creating a web-request like this
string url = "http://aksphases:201/min-konto/printpdf.aspx?id=149656222&name=Ink%20And%20Toner";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.CookieContainer = new CookieContainer(); // required for HttpWebResponse.Cookies
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
byte[] data = Encoding.UTF8.GetBytes("email=mymail&password=1234");
request.ContentLength = data.Length;
using (Stream stream = request.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}
HttpWebResponse myWebResponse = (HttpWebResponse)request.GetResponse();
Stream ReceiveStream = myWebResponse.GetResponseStream();
And in the printpdf.aspx page(you can see it in url) I want to get the query string parameters, when this URL is executed programatically . When I tried usual way
HttpContext.Current.Request.QueryString["id"]
It does not works. Is there anything that I am doing in a wrong way.Or is there any better way to do this?