Broken links or a 404 error is a webmaster’s nightmare. The task of detecting linkrots becomes even more challenging when the website is huge. Here are 4 tools that can make this task easier for you, by detecting Broken Links in your Site.
W3C Link Checker – Checks and detects issues in links, anchors and referenced objects in Web pages or full Web sites. Enter the url or webpage address you want to check and click on the ‘Check’ Button. The tool takes sometime to analyze and detect the broken links. There are various other options given in the screenshot below that can be selected while checking links.
c
Xenu’s Link Slueth – Is a very popular desktop program that checks your websites for broken hyperlinks, images, frames, plug-ins, backgrounds, local image maps, style sheets, scripts and java applets.
Link Checker FireFox AddOn - Check the validity of links on any webpage. Once you have installed this Addon in FireFox, choose ‘Check Page Links’ in the ‘Tools’ menu or right-click on any webpage using FireFox, to invoke this tool.
Dead-Link-Checker – A simple web tool that requires JavaScript enabled to detect broken links
To detect Copy, Paste and Cut operations two years ago, I remember using the addEventListener and capturing the keyDown event. Then capture the KeyCode and ctrlKey to detect a copy or paste in JavaScript. Cumbersome!
Here’s how detecting copy, paste and cut operations is a cakewalk in jQuery
Detect Copy, Paste and Cut Operation in a HTML TextBox
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Copying and Pasting in a TextBox</title>
Cool..ain’t it! Just a few lines of code and you can now capture the copy, paste and cut actions on a TextBox, TextArea or any other controls that can respond to these events.
2
comments
Tuesday, July 07, 2009
Posted by
Suprotim Agarwal
Labels:
CSS
Recently, I observed an interesting issue at one of my client’s webpage. They wanted to add multiple background images to an element. Although as per this document, doing this in CSS is possible
div { background-image: url(images/emo.jpg) url(images/icon068.gif); }
however not all browsers support this feature.
To get around this issue, here’s what I proposed which also works cross-browser. The trick is to place a similar element inside the parent element, in our case placing a DIV inside a DIV.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
0
comments
Monday, July 06, 2009
Posted by
Suprotim Agarwal
Labels:
ASP.NET
In my previous article, we saw how to import Excel Data into an ASP.NET GridView using OLEDB. In this next article, we will see how to import Excel Data Into an ASP.NET GridView using Microsoft.Office.Interop.Excel. This untested code was written by Vince Xu -MSFT and I thought of sharing it with you.
C#
using Microsoft.Office.Interop.Excel; using System.Text; using System.Reflection;
Partial Public Class ImportDD Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Dim ds As DataSet = GetExcel("c:\aa.xls") GridView1.DataSource = ds GridView1.DataBind() End Sub
Public Function GetExcel(ByVal fileName As String) As DataSet Dim oXL As Application Dim oWB As Workbook Dim oSheet As Worksheet Dim oRng As Range Try ' creat a Application object oXL = New ApplicationClass() ' get WorkBook object oWB = oXL.Workbooks.Open(fileName, Missing.Value, Missing.Value,_ Missing.Value, Missing.Value,Missing.Value, Missing.Value, Missing.Value, _ Missing.Value, Missing.Value,Missing.Value, Missing.Value, Missing.Value, _ Missing.Value, Missing.Value)
' get WorkSheet object oSheet = CType(oWB.Sheets(1), _ Microsoft.Office.Interop.Excel.Worksheet) Dim dt As New System.Data.DataTable("dtExcel") Dim ds As New DataSet() ds.Tables.Add(dt) Dim dr As DataRow
Dim sb As New StringBuilder() Dim jValue As Integer = oSheet.UsedRange.Cells.Columns.Count Dim iValue As Integer = oSheet.UsedRange.Cells.Rows.Count ' get data columns For j As Integer = 1 To jValue dt.Columns.Add("column" & j, _ System.Type.GetType("System.String")) Next j
' get data in cell For i As Integer = 1 To iValue dr = ds.Tables("dtExcel").NewRow() For j As Integer = 1 To jValue oRng = CType(oSheet.Cells(i, j), _ Microsoft.Office.Interop.Excel.Range) Dim strValue As String = oRng.Text.ToString() dr("column" & j) = strValue Next j ds.Tables("dtExcel").Rows.Add(dr) Next i Return ds Catch ex As Exception Return Nothing Finally Dispose() End Try End Function
0
comments
Sunday, July 05, 2009
Posted by
Suprotim Agarwal
Labels:
ASP.NET
I have seen a lot of users asking how to import data from an excel sheet into an ASP.NET GridView.
I will show two ways to do so - Using OLEDB and Using Microsoft.Office.Interop.Excel
In this post, we will see how to import data using OLEDB
C#
using System.Data.OleDb; using System.Data;
public partial class UploadD : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { string cnstr = "Provider=Microsoft.Jet.Oledb.4.0;Data Source=C:\a.xls;" + "Extended Properties=Excel 8.0"; OleDbConnection oledbConn = new OleDbConnection(cnstr); string strSQL = "SELECT * FROM [Sheet$]";
OleDbCommand cmd = new OleDbCommand(strSQL, oledbConn); DataSet ds = new DataSet(); OleDbDataAdapter da = new OleDbDataAdapter(cmd); da.Fill(ds); GridView1.DataSource = ds; GridView1.DataBind(); } }
VB.NET
Imports System.Data.OleDb Imports System.Data
Partial Public Class UploadD Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Dim cnstr As String = "Provider=Microsoft.Jet.Oledb.4.0;" &_ "Data Source=C:\a.xls; Extended Properties=Excel 8.0" Dim oledbConn As New OleDbConnection(cnstr) Dim strSQL As String = "SELECT * FROM [Sheet$]"
Dim cmd As New OleDbCommand(strSQL, oledbConn) Dim ds As New DataSet() Dim da As New OleDbDataAdapter(cmd) da.Fill(ds) GridView1.DataSource = ds GridView1.DataBind() End Sub End Class
In the next article, we will see how to import Excel Data Into an ASP.NET GridView using Microsoft.Office.Interop.Excel
One of my team members had a requirement of opening up a page in Full Screen mode. He wanted that when a link on the page is clicked, the same page should be opened in Full Screen Mode. If you too have a similar requirement, then here’s how to do so:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
If you want the parent window to close when the new window opens in full screen mode, just add window.close(); as the last line in the JavaScript code.