When I run a page, I get the error ‘The page cannot be displayed’ and an HTTP 502 Proxy Error. Why?
This error can occur if you are running ASP.NET Web pages using the Visual Web Developer Web server, because the URL includes a randomly selected port number. Proxy servers do not recognize the URL and return this error. To get around the problem, change your settings in Internet Explorer to bypass the proxy server for local addresses, so that the request is not sent to the proxy. In Internet Explorer, you can make this change in Tools > Internet Options. In the Connections tab, click LAN Settings and then select Bypass proxy server for local addresses.
How can a Multi-dimensional array be stored in session state and the values stored can be reterieved?
The below codings allow a multi-dimensional array to be stored in the session state private void StoreToSession() { string[,]initialArray={‘A’,’B’}; Session[‘sessionvalue’]=initialArray; } private void ReteriveFromSession() { string[,]resultantArray=(string[,])Session[‘sessionvalue’]; TextBox1.Text=resultantArray[0,0].ToString(); TextBox2.Text=resultantArray[0,1].ToString(); }
How can I define a Hashtable to store session variable?
We can define a hashtable to store a session variable as Session[‘sessionVaribale’]=new Hashtable(); Then the values can be stored as ((Hashtable)Session[‘sessionVariable’])[‘hashKey’]=’value1′;
How can session expire time can be set?
The session will normally expire in 20 minutes. To set the session expire time add the following code to Gloabl.asax void Session_Start(object sender, EventArgs e) { Session.Timeout = 60; }
What is ‘Caching’?
Caching refers to the strategy of keeping a copy of a page or image you have already seen.Web browsers typically cache files that they display for you, and simply ask the server if the page has actually changed rather than always downloading the entire thing. This speed up the visit to the page. Web browsers typically delete the least recently used file in the cache , since caching could consume too much of space.