Introduction:
Description:
In previous articles I explained Change the style of tooltip in jQuery, jQuery Countdown timer script example, jQuery Increase or Decrease font size of website, Redirect to another page after some time delay, jQuery slideUp slideDown toggle effects and many articles relating to JQuery and asp.net. Now I will explain how to check internet connectivity of system in asp.net using C# and VB.NET.
In previous articles I explained Change the style of tooltip in jQuery, jQuery Countdown timer script example, jQuery Increase or Decrease font size of website, Redirect to another page after some time delay, jQuery slideUp slideDown toggle effects and many articles relating to JQuery and asp.net. Now I will explain how to check internet connectivity of system in asp.net using C# and VB.NET.
We can check internet connectivity of
system by downloading data of one website from server for that write code like
as shown below
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Check Internet Connection Availability using Asp.net</title>
</head>
<body>
<form id="form1"
runat="server">
<div>
<asp:Button runat="server" ID="btnCheck" Text="Check Internet Connectivity" OnClick="btnCheck_Click"
/>
<asp:Label runat="server" ID="lbltxt" />
</div>
</form>
</body>
</html>
|
Now
in code behind add the following namespaces
C# Code
|
After
that write the following code in code behind
|
VB.NET
Code
|
Demo
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
|
|||
5 comments :
nice article
Very clear explanation of issues is given and it is open to everyone.It contains true and fair information. Your website is very useful.
what is the use if there is no internet connection to navigate in a website? just curious..please guide me..
Note: Only a member of this blog may post a comment.