Hello All,
I want to redirect my page to some URL,which needs ID and password for login.
So i want to pass ID and Password while redirecting.So that i dont get login window and directly i can see the content.
Here is the code,
public partial class Login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create("url");
request.Method = "POST";
request.UseDefaultCredentials = false;
request.PreAuthenticate = true;
request.Credentials = new NetworkCredential("id", "pwd", "domain");
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
this.Response.Write(response.StatusCode);
}
}
Please correct as i am getting error as no response from the server.