I've got a strange problem. I'll try to explain:
There is a webpage (url1) where there is a linkbutton to another url(url2). If in internet explorer i navigate first to url1 and then to url2 there is no problem but if I open new explorer and want to go staight to url2 then i get some message from the site that data missing.
I guess there is some session variables that the site holds and when i try to come to url2 without visiting url1 first it doesn't work.
Now to the question, how can i read the data from url2 from C# code?
I tried making the two requests one after another but it didn't help:
req = (HttpWebRequest)WebRequest.Create(url1);
res = (HttpWebResponse)req.GetResponse();
req = (HttpWebRequest)WebRequest.Create(url2);
res = (HttpWebResponse)req.GetResponse();
sr = new StreamReader(res.GetResponseStream());
line = sr.ReadToEnd();
It is very important to me to make that work. I'll appriciate any help. If after my description something not clear feel free to ask.
Thanx in advance.
Max.
There is a webpage (url1) where there is a linkbutton to another url(url2). If in internet explorer i navigate first to url1 and then to url2 there is no problem but if I open new explorer and want to go staight to url2 then i get some message from the site that data missing.
I guess there is some session variables that the site holds and when i try to come to url2 without visiting url1 first it doesn't work.
Now to the question, how can i read the data from url2 from C# code?
I tried making the two requests one after another but it didn't help:
req = (HttpWebRequest)WebRequest.Create(url1);
res = (HttpWebResponse)req.GetResponse();
req = (HttpWebRequest)WebRequest.Create(url2);
res = (HttpWebResponse)req.GetResponse();
sr = new StreamReader(res.GetResponseStream());
line = sr.ReadToEnd();
It is very important to me to make that work. I'll appriciate any help. If after my description something not clear feel free to ask.
Thanx in advance.
Max.