(Aaron)
1/7/2003 7:36:00 PM
Hello,
I am creating a web control that in the end result should show a webpage
based on user input.
I have a textbox(txtURL) and a button(btnSubmit). Upon btnSubmit_Click the
requested URL should load up in a literal(ltlMain).
I was wondering if there was a very detailed tutorial out there?
If not...
I have some of the code but I need to know how to connect it all together
WebRequest/WebResponse part of the code:
private String UrlReader(string sURL)
{
String sResult;
WebResponse objResponse;
WebRequest objRequest = System.Net.HttpRequest(sURL);
objResponse = objRequest.GetResponse();
using (StreamReader sr = new StreamReader(objResponse.GetResponseStream());
{
sResult = sr.ReadToEnd();
sr.Close();
}
return sResult;
}
Would I do this for getting the URL --
{
sURL = txtURL.Text
}
and to bind the request to the literal
{
ltlMain.Text = URLReader() -- want would go there???
}
TIA
Aaron