Developing page that request basic authentication
<p>I'm beginner to asp.net and have been asked to develop a page that request a basic authentication. when the user click on the link, log in screen (dialog) will pop-up. after the user filling the user name and the password, the requested http header will be shown with the encrypted user name and password.</p>

<p>I tried everything but I couldn't get it right</p>

<p>here is my code</p>

<p><code>code</code></p>

<pre><code>public partial class Authenticate : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
            Uri uri = new Uri("http://abdullahtk.somee.com");  
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);  


            request.UseDefaultCredentials = true;
            Response.AddHeader("WWW-Authenticate", "BASIC Realm=My Realm");
            WebResponse v = request.GetResponse();  
            Stream rStream = v.GetResponseStream();  
            StreamReader str = new StreamReader(rStream);  
            if (str.EndOfStream != true)  
            {  
                Response.Write(str.ReadToEnd());  
            }  
            v.Close();  
            rStream.Close();  
            str.Close();  

        }  
}
</code></pre>

<p>please help me!?</p>
