<asp:Label runat="server" ID="Label1" />
Step-2: Now on the click event of the button write down the code in .aspx.cs page. Add a namespace
using System.Net;
protected void Button1_Click(object
sender, EventArgs e)
{
try
{
WebClient wc = new WebClient();
byte[] dataSize
= null;
dataSize = wc.DownloadData("http://www.google.com");
if (dataSize!=
null && dataSize.Length > 0)
Label1.Text
= " Connection is Available.";
else
Label1.Text = "
Connection is not Available.";
}
catch (Exception ex)
{
}
}

Rishikesh Kumar SinghPosted Feb 2, 2013, 10:19 PM
Thank you Raj sir...
Raj KumarPosted Feb 2, 2013, 7:10 AM
Good one