Reffered To My Answer
These linksbool exist = false; try { HttpWebRequest request = (HttpWebRequest)System.Net.WebRequest.Create("http://www.example.com/image.jpg"); using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) { exist = response.StatusCode == HttpStatusCode.OK; } } catch { }
And if In Internal Server in your Project you can use Login of File.Find (you can check before Redirecting.. that project file exist or not?)Do a File.Exists on the page.if(File.Exists(Server.MapPath("~/SomePage.aspx"))) Response.Redirect("~/SomePage.aspx");
You'll need to use the System.IO namespace.
Good Luck`
0 comments:
Post a Comment