Take the 2-minute tour ×
var k ='c991130d';
var d = new Date();
d.setTime(d.getTime() + (3600*24*365*5*1000));
document.cookie = "p7c=" + k +";  
expires=" + d.toGMTString();
window.location.reload(); },2000);
please wait....

when I use my code to get a web page I keep getting these, but I can use XMLhttp with VB to get the whole page, it's my code below:

public static string GetPage(string Url)
HttpWebRequest WebRequest = (HttpWebRequest)HttpWebRequest.Create(Url);
WebRequest.Timeout = 5000;
WebRequest.AllowAutoRedirect = true;
WebRequest.Headers.Set("Pragma", "no-cache");

   using (HttpWebResponse response = (HttpWebResponse)WebRequest.GetResponse())
      using (Stream stream = response.GetResponseStream())
        using (StreamReader sr = new StreamReader(stream, Encoding.GetEncoding("UTF-8")))
           { return sr.ReadToEnd(); }
catch (Exception ex){ return "%ERROR%" + ex.Message; }
share|improve this question
And what is the question? –  svick Dec 12 '11 at 19:42
I'm not entirely clear on the specific question, but it might be related to post back, try checking if(isPostBack) in your code behind. Another thought, if you are trying to get that page and the javaScript is executing wouldn't that loop over and over again every 2 seconds? –  ToddBFisher Dec 12 '11 at 19:52
add comment


Your Answer



Browse other questions tagged or ask your own question.