Posts

Showing posts from January, 2010

Convert XML to C# List

/* --- The Xml File ----- */ /* XML/EmailProviders.xml */ /* --- The Xml File ----- */ < xml   version = " 1.0 "   encoding = " utf-8 "  ?> < providers >   < provider >     < text > Gmail text >     < value > Gmail value >     < enabled > 1 enabled >     < default > 0 default >   < provider >   < provider >     < text > LinkedIn text >     < value > LinkedIn value >     < enabled > 1 enabled >     < default > 1 default >   < provider > < providers > using System; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Data.SqlClient; using System.Threading; using System.Xml; using Syste

Microsoft AJAX $addHandler not working in Firefox

Problem: Microsoft AJAX encapsulates DOM and it’s events and provides a browser independent way (apparently not quite there yet) to deal with the DOM and get creative with the DHTML. The $addHandler method was not working for me in Firefox and after doing some research I found out that the line highlighted below in “Yellow” in the script section fixes the problem for FF. < 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 runat ="server">     < title > Microsoft AJAX $addHandler not working in Firefox title > head > < body >     < center >         < form id ="form1" runat ="server">         < asp : ScriptManager ID ="ScriptManager1" runat ="server">          < asp : ScriptManager >         < div &g

Add rel = nofollow to all outgoing (external) hyperlinks using JQuery

On web applications like wiki & social networking websites where the users are allowed to add content, the developers cannot rely on the users to add rel=nofollow to each of these external links. Not adding rel=noffolow affects your application’s SEO rankings. Here’s a simple approach using JQuery to add rel=nofollow to all external links on any given page. DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> < html > < head >     < title > Add rel=nofollow to all external links using JQuery title >        < script type ="text/javascript" src ="jquery-1.2.1.js">     script >     < script type ="text/javascript">     // the following function (document.ready) will be called each time the page      //is loaded     $( function ()     {         $( "a[href^=http://]" ).attr( "rel" , "nofollow" );         $( &q