Get URL of ASP.Net Page in code-behind
and
Hit external url from code-behind
string path = Request.Url.GetLeftPart(UriPartial.Authority) + VirtualPathUtility.ToAbsolute("~/");
string strURL = path + @"Control/ShowItem.aspx";
System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(strURL);
request.Timeout = 99999;
System.IO.StreamReader sr = new System.IO.StreamReader(request.GetResponse().GetResponseStream());
string response = sr.ReadToEnd();
sr.Close();
Response.Write(response);
Comments
Post a Comment