follow this steps .
- Add new Panel
- Add Namespan
- now on Page_load() paste this code
<asp:panel id="ViewPanel runat="server" Width="100%" >
</asp:panel>
using System.Text;using System.Net;using System.IO;
add this namespace on your page declaration part.
protected void Page_Load(object sender, EventArgs e)
{
Uri weburi = new Uri(http://www.gmail.com/);
StringBuilder str = new StringBuilder();
string temp = "";
HttpWebRequest webrequest = (HttpWebRequest)WebRequest.Create(weburi);
HttpWebResponse webresponse = (HttpWebResponse)webrequest.GetResponse();
StreamReader webstream = new StreamReader(webresponse.GetResponseStream(), Encoding.ASCII);
while ((temp = webstream.ReadLine()) != null)
str.Append(temp + "\r\n");
webstream.Close();
mainpanel.Controls.Add(new System.Web.UI.LiteralControl(str.ToString()));
}
Plz write full path on you'r URI.
that's it
No comments:
Post a Comment