<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.dotnetmafia.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Kyle Kelin on .Net</title><subtitle type="html" /><id>http://www.dotnetmafia.com/blogs/kylekelin/atom.aspx</id><link rel="alternate" type="text/html" href="http://www.dotnetmafia.com/blogs/kylekelin/default.aspx" /><link rel="self" type="application/atom+xml" href="http://www.dotnetmafia.com/blogs/kylekelin/atom.aspx" /><generator uri="http://communityserver.org" version="3.1.20917.1142">Community Server</generator><updated>2008-06-06T10:17:42Z</updated><entry><title>Code: The Hidden Language of Computer Hardware and Software</title><link rel="alternate" type="text/html" href="http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/12/16/code-the-hidden-language-of-computer-hardware-and-software.aspx" /><id>http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/12/16/code-the-hidden-language-of-computer-hardware-and-software.aspx</id><published>2008-12-16T05:00:51Z</published><updated>2008-12-16T05:00:51Z</updated><content type="html">&lt;p&gt;What a great title for a book uh? &lt;a href="http://www.amazon.com/Code-Language-Computer-Hardware-Software/dp/0735611319"&gt;Code&lt;/a&gt; is a book that I recently finished that tells you how computers really work. Charles Petzold explains in great detail, technologies that have been buried underneath layers of abstraction for decades. The book starts you off with early logical systems like Braille and Morse code and the builds from there to simple switches and logical gates. Petzold then does a superb job of relating these technologies to microprocessors, memory, and machine code. In addition to the knowledge, Petzold does an excellent job of entertaining you with the history and evolution of the computer. The examples he uses are simple but effective. I can honestly say this was a fun book to read (except for some of the math). Many times while I was reading it I would think why had I not heard of this book years ago.
&lt;/p&gt;&lt;p&gt;So I recommend this book to anyone who wants to better understand how computers work. For developers I know with today&amp;#39;s modern language you aren&amp;#39;t going to be writing machine code. But I strongly feel having a good understanding of computer architecture will allow you to take better advantage of the higher level languages you use on a daily basis. Don&amp;#39;t you think?
&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=806" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://www.dotnetmafia.com/members/KyleKelin.aspx</uri></author><category term="Computer architecture" scheme="http://www.dotnetmafia.com/blogs/kylekelin/archive/tags/Computer+architecture/default.aspx" /></entry><entry><title>Speaking on jQuery Tomorrow at Tulsa TechFest</title><link rel="alternate" type="text/html" href="http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/10/08/speaking-on-jquery-tomorrow-at-tulsa-techfest.aspx" /><id>http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/10/08/speaking-on-jquery-tomorrow-at-tulsa-techfest.aspx</id><published>2008-10-08T23:34:44Z</published><updated>2008-10-08T23:34:44Z</updated><content type="html">&lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:10pt;"&gt;I will be speaking about jQuery tomorrow at &lt;a href="http://techfests.com/Tulsa/2008/default.aspx"&gt;&lt;span style="color:blue;text-decoration:underline;"&gt;Tulsa TechFest&lt;/span&gt;&lt;/a&gt;. The session starts at 1:00pm. I wrote up some examples that will allow me to write some jQuery code on the fly. Though I&amp;#39;m nervous about writing code in front of people.
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:10pt;"&gt;Also don&amp;#39;t forget the &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/06/announcing-beer-and-code-meetup-after-tulsa-techfest.aspx"&gt;&lt;span style="color:blue;text-decoration:underline;"&gt;Beer and Code Meetup&lt;/span&gt;&lt;/a&gt; at Dirty&amp;#39;s Tavern after the event!
&lt;/span&gt;&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=737" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://www.dotnetmafia.com/members/KyleKelin.aspx</uri></author><category term="Tulsa TechFest" scheme="http://www.dotnetmafia.com/blogs/kylekelin/archive/tags/Tulsa+TechFest/default.aspx" /></entry><entry><title>Manipulating the DOM with jQuery</title><link rel="alternate" type="text/html" href="http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/10/05/manipulating-the-dom-with-jquery.aspx" /><id>http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/10/05/manipulating-the-dom-with-jquery.aspx</id><published>2008-10-06T02:02:04Z</published><updated>2008-10-06T02:02:04Z</updated><content type="html">&lt;p&gt;In previous posts I talked about selecting DOM elements with jQuery. In this post I am going to discuss 5 ways you can manipulate the DOM with jQuery.
&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;div&gt;Setting the contents of an element
&lt;/div&gt;&lt;p&gt;There are many situations where you want to add content dynamically to your page (eg. Error messages, ajax results). There are two ways to do this with jQuery, the first being the text(content) function. The syntax for this is pretty straightforward. The code below sets the text of the div with an id of someDiv.
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;$(&amp;#39;#someDiv&amp;#39;).text(&amp;quot;the content we want to add&amp;quot;);
&lt;/p&gt;&lt;p&gt;The second way is the html(text) function . The difference between the html and text functions is the text is just the text of the elements and the html is the tags and the text.
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;div&gt;Adding a new html element
&lt;/div&gt;&lt;p&gt;I also use the appendTo() function to display content dynamically on pages. For example:
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;    $(&amp;#39;#validationSummary&amp;#39;).appendTo(&amp;#39;&amp;lt;div&amp;gt;invalid data&amp;lt;/div&amp;gt;&amp;#39;);
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;div&gt;Removing content
&lt;/div&gt;&lt;p&gt;One thing I like about jQuery is that the API is very obvious so to remove elements we call the remove() function. Take the following example:
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;    $(&amp;#39;#validationSummary&amp;#39;).remove();
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;The above statement removes all elements inside the div with the id of validationSummary.
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;div&gt;Setting css properties
&lt;/div&gt;&lt;p&gt;Another common scenario in web development is dynamically change the look and feel of html using css properties. jQuery makes this super easy with the css() function.  The following code will set the text of the div to red. This can be placed in some type of event handler.
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;    $(&amp;#39;#validationSummary&amp;#39;).css(&amp;quot;color&amp;quot;,&amp;quot;red&amp;quot;);
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;div&gt;Iterating over the matched set
&lt;/div&gt;&lt;p&gt;Most jQuery functions work against the first element in the matched set. If you want to manipulate all elements in a matched text you must iterate over the matched set using the each() method.
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;    $(&amp;#39;img&amp;#39;.each(function(){
&lt;/p&gt;&lt;p&gt;        This.addClass(&amp;quot;clickableImage&amp;#39;);
&lt;/p&gt;&lt;p&gt;    });
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;The example adds a class called clickableImage to every image on our page. In that css class we could set the border to 0.
&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;
 &lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=719" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://www.dotnetmafia.com/members/KyleKelin.aspx</uri></author><category term="jQuery" scheme="http://www.dotnetmafia.com/blogs/kylekelin/archive/tags/jQuery/default.aspx" /></entry><entry><title>Selecting DOM Elements with jQuery (Part 1)</title><link rel="alternate" type="text/html" href="http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/09/28/selecting-dom-elements-with-jquery-part-1.aspx" /><id>http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/09/28/selecting-dom-elements-with-jquery-part-1.aspx</id><published>2008-09-29T02:40:00Z</published><updated>2008-09-29T02:40:00Z</updated><content type="html">&lt;p&gt;I promised a few people that I would write a few blog posts on &lt;a href="http://dotnetmafia.com/controlpanel/blogs/jquery.com"&gt;jQuery&lt;/a&gt;. Plus I am also going to be speaking at &lt;a href="http://techfests.com/Tulsa/2008/default.aspx"&gt;Tulsa Techfest&lt;/a&gt; on jQuery so these blog posts will help me prepare for that talk. In this post I am going to focus on selectors in jQuery. Selectors are extremely powerful and really the first thing you need to know when starting with jQuery. Selectors allow you to select any element in the &lt;a href="http://www.w3schools.com/dhtml/dhtml_dom.asp"&gt;DOM&lt;/a&gt;. The problem in the past of trying to select values within the DOM is each browser has its own implementation. You then would have to liter your code with ugly switch statements but now jQuery abstracts out the browser differences without you having to worrying about it. jQuery selectors are similar to css selectors so let&amp;#39;s start by reviewing css selectors. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Selectors in CSS &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In css what does the following type selector do : &lt;br /&gt;&amp;nbsp;&amp;nbsp; div {color: blue;} &lt;/p&gt;
&lt;p&gt;If you said it makes the text in any div blue you would be right. And I&amp;#39;m sure everyone knows about class selectors so what does this do: &lt;br /&gt;&amp;nbsp;&amp;nbsp; makered {color:red} &lt;/p&gt;
&lt;p&gt;In this rule the anything that has its class attribute set to make red will have red font. And the last one is ID selectors: &lt;br /&gt;&amp;nbsp;&amp;nbsp; #reddiv {color:red} &lt;/p&gt;
&lt;p&gt;This rule will set the text to red inside the div that&amp;#39;s id attribute is set to reddiv. There are several other types of selectors but for sake of brevity I am going to skip those. For more on these css selectors visit &lt;a href="http://css.maxdesign.com.au/selectutorial/"&gt;http://css.maxdesign.com.au/selectutorial/&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Selectors in jQuery &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There are three types of basic selectors: element, id , and class. The following jQuery statement is an element selector that selects all div elements. The elements are called a matched set. &lt;br /&gt;$(&amp;quot;div&amp;quot;) &lt;/p&gt;
&lt;p&gt;The dollar sign is just a shortcut for writing JQuery which is the main class for all of this stuff. Now to add css to the matched set we say: &lt;br /&gt;&amp;nbsp;&amp;nbsp; $(&amp;quot;div&amp;quot;).&lt;a title="CSS/css" href="http://docs.jquery.com/CSS/css"&gt;css&lt;/a&gt;(&amp;quot;border&amp;quot;,&amp;quot;3px solid red&amp;quot;); &lt;/p&gt;
&lt;p&gt;This will give all divs in our html document a red border. &lt;/p&gt;
&lt;p&gt;Now let&amp;#39;s say we need to do a selection based on the element id: &lt;br /&gt;&amp;nbsp;&amp;nbsp; $(&amp;quot;#somediv&amp;quot;).&lt;a title="CSS/css" href="http://docs.jquery.com/CSS/css"&gt;css&lt;/a&gt;(&amp;quot;border&amp;quot;,&amp;quot;3px solid red&amp;quot;); &lt;/p&gt;
&lt;p&gt;This will give a red border to the div with the id of &amp;quot;somediv&amp;quot;. Note: the # is important and must be there. &lt;/p&gt;
&lt;p&gt;The final selector I am going to talk about in this post is the class selector. If we wanted to apply a red border to the following html element: &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;div class=&amp;quot;redBorderClass&amp;quot;/&amp;gt; &lt;/p&gt;
&lt;p&gt;We would write the following jQuery selector: &lt;br /&gt;&amp;nbsp;&amp;nbsp; $(&amp;quot;.redBorderClass&amp;quot;).&lt;a title="CSS/css" href="http://docs.jquery.com/CSS/css"&gt;css&lt;/a&gt;(&amp;quot;border&amp;quot;,&amp;quot;3px solid red&amp;quot;); &lt;/p&gt;
&lt;p&gt;Easy stuff uh? It is but we are just scratching the surface on how you can use jQuery to select DOM elements. I&amp;#39;m going to do a part 2 of this post where I dive into some more advanced selectors. The documentation on jQuery is really great so for more info on selectors go here: &lt;a href="http://docs.jquery.com/Selectors"&gt;http://docs.jquery.com/Selectors&lt;/a&gt; &lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=712" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://www.dotnetmafia.com/members/KyleKelin.aspx</uri></author><category term="jQuery" scheme="http://www.dotnetmafia.com/blogs/kylekelin/archive/tags/jQuery/default.aspx" /></entry><entry><title>First Tulsa SharePint Meeting</title><link rel="alternate" type="text/html" href="http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/09/23/first-tulsa-sharepint-meeting.aspx" /><id>http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/09/23/first-tulsa-sharepint-meeting.aspx</id><published>2008-09-23T22:10:00Z</published><updated>2008-09-23T22:10:00Z</updated><content type="html">&lt;p&gt;Way back when I lived in New York I would attend technology meetups that were held at bars. There were meetups for everything you could think of including .NET, Java, Agile, XP, and SharePoint. Each varied a little in format but the basic idea is to&amp;nbsp;gather people who share a common technology interest at a bar and then add beer. Sometimes the whole group debated while other times the conversations would splinter off into 2 or 3 person conversations. &lt;/p&gt;
&lt;p&gt;So on Thursday October 16&lt;sup&gt;th&lt;/sup&gt; at 6:00pm Corey Roth and I will host the first SharePint (I&amp;#39;m spelling this wrong on purpose. It is sort of a pun) in Tulsa at Crawpappy&amp;#39;s. Basically show up to have a beer or two and discuss SharePoint and whatever else is on your mind. We won&amp;#39;t have speakers or agendas or topics planned though I do encourage everyone to come with a few conversation ideas. And if you don&amp;#39;t know anything about SharePoint come anyway because you might find someone there to discuss Iron Python or Perl with. &lt;/p&gt;
&lt;p&gt;Unfortunately at the moment you will have to furnish the pint in SharePint. I am hoping by the second meeting to get a recruiting company to buy the first two rounds for everyone in exchange for me handing out their business card. So if you are a recruiter or know one that wants to do that let me know. &lt;/p&gt;
&lt;p&gt;So I hope to see all two of my readers there. &lt;/p&gt;
&lt;p&gt;&lt;em&gt;Disclaimer: Neither Corey or I will be driving anyone home. Since public transportation in Tulsa is virtually nonexistent either limit your alcohol consumption or make arrangements to get home without driving. &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Directions to Crawpappy&amp;#39;s &lt;/p&gt;&lt;br /&gt;&lt;a style="COLOR:#0000ff;TEXT-ALIGN:left;" href="http://maps.google.com/maps?f=q&amp;amp;hl=en&amp;amp;geocode=&amp;amp;q=crawpappys+Tulsa&amp;amp;ie=UTF8&amp;amp;cid=36089737,-95938474,16949247816186226995&amp;amp;ll=36.110143,-95.930042&amp;amp;spn=0.048539,0.072956&amp;amp;z=13&amp;amp;iwloc=A&amp;amp;source=embed"&gt;View Larger Map&lt;/a&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=707" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://www.dotnetmafia.com/members/KyleKelin.aspx</uri></author><category term="SharePoint 2007 MOSS SharePint Meetup drinking" scheme="http://www.dotnetmafia.com/blogs/kylekelin/archive/tags/SharePoint+2007+MOSS+SharePint+Meetup+drinking/default.aspx" /></entry><entry><title>Adding Your Own Search Box to Your Master Page</title><link rel="alternate" type="text/html" href="http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/09/23/adding-your-own-search-box-to-your-master-page.aspx" /><id>http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/09/23/adding-your-own-search-box-to-your-master-page.aspx</id><published>2008-09-23T19:04:00Z</published><updated>2008-09-23T19:04:00Z</updated><content type="html">&lt;p&gt;Sometimes clients want to tweak the search box that usually appears at the top of a SharePoint page so much I just throw the whole thing out. The delegate control is used for search and just loads a user control so you can just replace that with your own user control. But today I had to do it using SPD. So here is how I did it with &amp;quot;no code&amp;quot;. &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;div&gt;Create a new web part page called CustomSearch (though the name doesn&amp;#39;t matter). The drop the Search Core Results web part on it. &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Now on your custom master page, delete the delegate control and move the PlaceHolderSearchArea control to the bottom of the page inside your hidden div. Don&amp;#39;t delete it because many page layouts need that control present. &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Next on your custom master page where the PlaceHolderSearchArea control was add a dropdown, textbox, and hyperlink. The dropdown box will be for scopes, the textbox is where the user will enter their search term, and the hyperlink will submit the search. Notice the values on the dropdown are just the part of our search string. Obviously you will need to customize this to match the scopes that your users want. &lt;/div&gt;
&lt;p style="MARGIN-LEFT:36pt;"&gt;&lt;span style="FONT-SIZE:9pt;COLOR:#1f497d;"&gt;&amp;lt;SELECT name=&amp;quot;scopes&amp;quot; id=&amp;quot;scopes&amp;quot; class=&amp;quot;ms-sbscopes&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;option value=&amp;quot;cs=This%20Site&amp;amp;u=http%3A%2F%2Ffpportal.companyxyz.com%2FTestSite&amp;quot;&amp;gt;This Site&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;option value=&amp;quot;cs=This%20List&amp;amp;u=http%3A%2F%2Ffpportal.companyxyz.com%2FTestSite%2FLists%2FFaqs&amp;quot; &amp;gt;Faqs&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;option value=&amp;quot;cs=This%20List&amp;amp;u=http%3A%2F%2Ffpportal.companyxyz.com%2FTestSite%2FReference%20Documents&amp;quot; &amp;gt;Reference Docs&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;option value=&amp;quot;cs=This%20List&amp;amp;u=http%3A%2F%2Ffpportal.companyxyz.com%2FTestSite%2FPolicies%20And%20Project%20Information&amp;quot; &amp;gt;Policy Docs&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;option value=&amp;quot;cs=This%20List&amp;amp;u=http%3A%2F%2Ffpportal.companyxyz.com%2FTestSite%2FChange%20Request%20Templates&amp;quot; &amp;gt;Forms&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;option value=&amp;quot;s=All%20Sites&amp;quot;&amp;gt;All Sites&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;/SELECT&amp;gt; &lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN-LEFT:36pt;"&gt;&lt;span style="COLOR:#1f497d;"&gt;&lt;span style="FONT-SIZE:9pt;"&gt;&amp;lt;div class=&amp;quot;ms-sbcell&amp;quot; style=&amp;quot;display:block;float:left;border:1px gray solid; margin:0 2px 0 2px;&amp;quot;&amp;gt;&amp;lt;input type=&amp;quot;text&amp;quot; id=&amp;quot;searchtext&amp;quot; class=&amp;quot;ms-sbplain&amp;quot;/&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;a href=&amp;quot;#&amp;quot; mce_href=&amp;quot;#&amp;quot; onclick=&amp;quot;SearchRedirect()&amp;quot; style=&amp;quot;padding:0 2px 0 0&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/_layouts/images/gosearch.gif&amp;quot; mce_src=&amp;quot;/_layouts/images/gosearch.gif&amp;quot; alt=&amp;quot;search&amp;quot;/&amp;gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE:9pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Finally we need to add a javascript function to our master page that will build our url that contains our custom search page and then redirect the page to that url. &lt;/div&gt;
&lt;p style="MARGIN-LEFT:36pt;"&gt;&lt;span style="FONT-SIZE:9pt;COLOR:#1f497d;"&gt;function SearchRedirect(){&lt;br /&gt;var searchtext =&amp;nbsp; document.getElementById(&amp;#39;searchtext&amp;#39;).value;&lt;br /&gt;var control = document.getElementById(&amp;#39;scopes&amp;#39;);&lt;br /&gt;var scope = control.options[control.selectedIndex].value; &lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN-LEFT:36pt;"&gt;&lt;span style="FONT-SIZE:9pt;COLOR:#1f497d;"&gt;window.location= &amp;#39;/TestSite/pages/CustomSearch.aspx/Results.aspx?k=&amp;#39;+searchtext+&amp;#39;&amp;amp;&amp;#39;+scope; &lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN-LEFT:36pt;"&gt;&lt;span style="FONT-SIZE:9pt;COLOR:#1f497d;"&gt;} &lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=706" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://www.dotnetmafia.com/members/KyleKelin.aspx</uri></author><category term="SharePoint" scheme="http://www.dotnetmafia.com/blogs/kylekelin/archive/tags/SharePoint/default.aspx" /></entry><entry><title>Changing the Default Text of an Empty Document Library</title><link rel="alternate" type="text/html" href="http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/09/10/changing-the-default-text-of-an-empty-document-library.aspx" /><id>http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/09/10/changing-the-default-text-of-an-empty-document-library.aspx</id><published>2008-09-11T01:37:06Z</published><updated>2008-09-11T01:37:06Z</updated><content type="html">&lt;p&gt;&lt;span style="color:black;"&gt;&amp;quot;To create a new item, click &amp;quot;New&amp;quot; or &amp;quot;Upload&amp;quot; above. There are no items to show in this view of the document library.&amp;quot;
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;"&gt;The above text is displayed when a Document Library is empty. Today I needed to change it. I had done this once before and forget so I&amp;#39;m blogging about it so I can find it next time. The text comes from the core.resx resource file, located in 12\RESOURCES. It&amp;#39;s divided up into four resources; just open the resource file in any text editor and search for &amp;quot;noitemsinview_doclibrary&amp;quot;, and you&amp;#39;ll find the strings. Just replace the strings with your text or delete them all together.
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;"&gt;Here a link explaining with more details.
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://social.technet.microsoft.com/forums/en-US/sharepointgeneral/thread/3511d93b-6e91-4f58-b6fb-3cf402425310/"&gt;&lt;span style="color:blue;text-decoration:underline;"&gt;http://social.technet.microsoft.com/forums/en-US/sharepointgeneral/thread/3511d93b-6e91-4f58-b6fb-3cf402425310/&lt;/span&gt;&lt;/a&gt;&lt;span style="color:#1f497d;"&gt;
		&lt;/span&gt;&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=681" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://www.dotnetmafia.com/members/KyleKelin.aspx</uri></author><category term="SharePoint 2007" scheme="http://www.dotnetmafia.com/blogs/kylekelin/archive/tags/SharePoint+2007/default.aspx" /></entry><entry><title>Can You Do TDD on a SharePoint Project?</title><link rel="alternate" type="text/html" href="http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/08/28/can-you-do-tdd-on-a-sharepoint-project.aspx" /><id>http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/08/28/can-you-do-tdd-on-a-sharepoint-project.aspx</id><published>2008-08-28T21:07:12Z</published><updated>2008-08-28T21:07:12Z</updated><content type="html">&lt;p style="background:white;"&gt;&lt;span style="color:black;"&gt;Well SharePoint MVP &lt;a href="http://www.21apps.com/" target="_blank" /&gt;&lt;/span&gt;&lt;span style="color:#1010c8;text-decoration:underline;"&gt;Andrew Woodward&lt;/span&gt;&lt;span style="color:black;"&gt; thinks so. Check out his paper on doing test driven development with SharePoint. His paper walks you through building a Web Part the TDD way. I haven&amp;#39;t had a chance to read It but I&amp;#39;m really interested in this.
&lt;/span&gt;&lt;/p&gt;&lt;p style="background:white;"&gt;&lt;a href="http://www.21apps.com/agile/beginners-guide-to-test-driven-web-part-development/" target="_blank"&gt;&lt;span style="color:#1010c8;text-decoration:underline;"&gt;Beginners Guide to Test Driven Web Part Development&lt;/span&gt;&lt;/a&gt;&lt;span style="color:black;"&gt;
		&lt;/span&gt;&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=670" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://www.dotnetmafia.com/members/KyleKelin.aspx</uri></author><category term="SharePoint" scheme="http://www.dotnetmafia.com/blogs/kylekelin/archive/tags/SharePoint/default.aspx" /></entry><entry><title>How Come My Silverlight Application Won’t Load?</title><link rel="alternate" type="text/html" href="http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/08/28/how-come-my-silverlight-application-won-t-load.aspx" /><id>http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/08/28/how-come-my-silverlight-application-won-t-load.aspx</id><published>2008-08-28T21:03:54Z</published><updated>2008-08-28T21:03:54Z</updated><content type="html">&lt;p&gt;So you have written your first Silverlight application and deployed it to IIS but when you hit the page nothing happens. No error, nothing. You are just sitting there staring at a blank web page. Chances are you haven&amp;#39;t registered the Silverlight MIME type yet. Go into IIS and register the following MIME type: &lt;strong&gt;.&lt;/strong&gt;xap to application/x-silverlight-app. I will leave it up to you to Google the details of how to do that.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=669" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://www.dotnetmafia.com/members/KyleKelin.aspx</uri></author><category term="Silverlight" scheme="http://www.dotnetmafia.com/blogs/kylekelin/archive/tags/Silverlight/default.aspx" /></entry><entry><title>DateTime serialization issue with .NET and JSON</title><link rel="alternate" type="text/html" href="http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/08/22/datetime-serialization-issue-with-net-and-json.aspx" /><id>http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/08/22/datetime-serialization-issue-with-net-and-json.aspx</id><published>2008-08-23T03:31:45Z</published><updated>2008-08-23T03:31:45Z</updated><content type="html">&lt;p&gt;I was writing some client code that calls some .NET Web Services and getting a strange error. I wanted to post this just to warn people to watch out for the DateTime object and null values. I have two web services, one gets an array of Entity objects and the other takes an array of Entity objects. The array is being serialized into JSON. The get web method worked fine but when I tried to pass the array to the save web method I got the following error:
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;System.InvalidOperationException: SaveUserFavorites Web Service method name is not valid.
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;   at System.Web.Services.Protocols.HttpServerProtocol.Initialize()
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;   at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt; request, HttpResponse response, Boolean&amp;amp; abortProcessing)
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;Now what sucks about this error is it is pretty generic. It pretty much means that the Ajax class cannot find a web service method that matches. So first I double checked my method names and parameters and no problem there. I&amp;#39;m going to fast forward through my debugging problems because this error took me awhile. The issue is one of my properties on my Entity object was a DateTime. It seems that when I was getting the JOSN array .NET serializes it wrong and then cannot read it. I really didn&amp;#39;t need the property so I commented it out. But I did some additional research for this post and found that null is not a valid JSON value so the parser failed.
&lt;/p&gt;&lt;p&gt;More info - http://west-wind.net/weblog/posts/398970.aspx
&lt;/p&gt;&lt;p&gt;Tip: Firebug is critical in debugging ajax calls.
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=665" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://www.dotnetmafia.com/members/KyleKelin.aspx</uri></author><category term="JSON" scheme="http://www.dotnetmafia.com/blogs/kylekelin/archive/tags/JSON/default.aspx" /><category term="jQuery" scheme="http://www.dotnetmafia.com/blogs/kylekelin/archive/tags/jQuery/default.aspx" /></entry><entry><title>Searching and Comma-Delimited Strings in SQL </title><link rel="alternate" type="text/html" href="http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/08/22/searching-and-comma-delimited-strings-in-sql.aspx" /><id>http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/08/22/searching-and-comma-delimited-strings-in-sql.aspx</id><published>2008-08-23T02:52:49Z</published><updated>2008-08-23T02:52:49Z</updated><content type="html">&lt;p&gt;I recently needed to write a stored procedure that would take a search string from a web form and search three columns: name, description, and keywords. The keywords column and the input string can both be comma delimited. The key to the sproc is going to be the SQL IN operator. The IN operator can be used in a where clause to filter based on a list like so:
&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Courier New;font-size:10pt;"&gt;Where 
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Courier New;font-size:10pt;"&gt;    id IN (1,4,6,10,13)
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Courier New;font-size:10pt;"&gt;So what I needed was: 
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Courier New;font-size:10pt;"&gt;Where 
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Courier New;font-size:10pt;"&gt;    id IN (@searchString)
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;But you can&amp;#39;t do that so I needed to write a split function to split out @searchString. Note: I think there maybe be a split function in SQL Server 2005/2008 but I was using SQL Express.
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;Here is the final result:
&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;ALTER FUNCTION &lt;/span&gt;dbo.Split
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;(
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;    @List &lt;span style="color:blue;"&gt;nvarchar&lt;/span&gt;(2000),
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;    @SplitOn &lt;span style="color:blue;"&gt;nvarchar&lt;/span&gt;(5)
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;)  
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;RETURNS &lt;/span&gt;@RtnValue &lt;span style="color:blue;"&gt;table 
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;(
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;        
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;    Id &lt;span style="color:blue;"&gt;int identity&lt;/span&gt;(1,1),
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;    Value &lt;span style="color:blue;"&gt;nvarchar&lt;/span&gt;(100)
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;) 
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;AS &lt;/span&gt;
		&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:blue;font-family:Courier New;font-size:10pt;"&gt;BEGIN
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;While &lt;/span&gt;(&lt;span style="color:blue;"&gt;Charindex&lt;/span&gt;(@SplitOn,@List)&amp;gt;0)
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:blue;font-family:Courier New;font-size:10pt;"&gt;Begin 
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;Insert Into &lt;/span&gt;@RtnValue (value)
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:blue;font-family:Courier New;font-size:10pt;"&gt;Select 
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;    Value = &lt;span style="color:blue;"&gt;ltrim&lt;/span&gt;(&lt;span style="color:blue;"&gt;rtrim&lt;/span&gt;(&lt;span style="color:blue;"&gt;Substring&lt;/span&gt;(@List,1,&lt;span style="color:blue;"&gt;Charindex&lt;/span&gt;(@SplitOn,@List)-1))) 
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;    
 &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;
			&lt;span style="color:blue;"&gt;Set &lt;/span&gt;@List = &lt;span style="color:blue;"&gt;Substring&lt;/span&gt;(@List,&lt;span style="color:blue;"&gt;Charindex&lt;/span&gt;(@SplitOn,@List)+&lt;span style="color:blue;"&gt;len&lt;/span&gt;(@SplitOn),&lt;span style="color:blue;"&gt;len&lt;/span&gt;(@List))
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:blue;font-family:Courier New;font-size:10pt;"&gt;End
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;
			&lt;span style="color:blue;"&gt;Insert Into &lt;/span&gt;@RtnValue (Value)
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;
			&lt;span style="color:blue;"&gt;Select &lt;/span&gt;Value = &lt;span style="color:blue;"&gt;ltrim&lt;/span&gt;(&lt;span style="color:blue;"&gt;rtrim&lt;/span&gt;(@List))
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;
			&lt;span style="color:blue;"&gt;Return
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:blue;font-family:Courier New;font-size:10pt;"&gt;END
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:blue;font-family:Courier New;font-size:10pt;"&gt;-------------------------------------------------------------------------------------
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;ALTER PROCEDURE &lt;/span&gt;SearchApplications
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;    (
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;    @searchWord &lt;span style="color:blue;"&gt;varchar&lt;/span&gt;(100)
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;    )
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:blue;font-family:Courier New;font-size:10pt;"&gt;AS
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;
			&lt;span style="color:blue;"&gt;SELECT &lt;/span&gt;ID, [Name], Description &lt;span style="color:blue;"&gt;FROM &lt;/span&gt;Applications
&lt;/span&gt;&lt;/p&gt;&lt;p&gt; 
 &lt;/p&gt;&lt;p&gt;&lt;span style="color:blue;font-family:Courier New;font-size:10pt;"&gt;WHERE 
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;[Keywords] &lt;span style="color:blue;"&gt;IN &lt;/span&gt;(&lt;span style="color:blue;"&gt;Select &lt;/span&gt;Value &lt;span style="color:blue;"&gt;from &lt;/span&gt;dbo.Split(@searchWord,&lt;span style="color:#a31515;"&gt;&amp;#39;,&amp;#39;&lt;/span&gt;)) &lt;span style="color:blue;"&gt;or
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;[Name] &lt;span style="color:blue;"&gt;IN &lt;/span&gt;(&lt;span style="color:blue;"&gt;Select &lt;/span&gt;Value &lt;span style="color:blue;"&gt;from &lt;/span&gt;dbo.Split(@searchWord,&lt;span style="color:#a31515;"&gt;&amp;#39;,&amp;#39;&lt;/span&gt;))  &lt;span style="color:blue;"&gt;or 
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;[Name] = @searchWord &lt;span style="color:blue;"&gt;or
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;[Description] &lt;span style="color:blue;"&gt;IN &lt;/span&gt;(&lt;span style="color:blue;"&gt;Select &lt;/span&gt;Value &lt;span style="color:blue;"&gt;from &lt;/span&gt;dbo.Split(@searchWord,&lt;span style="color:#a31515;"&gt;&amp;#39;,&amp;#39;&lt;/span&gt;))  &lt;span style="color:blue;"&gt;or 
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;[Description] = @searchWord
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;
		&lt;/span&gt; &lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=664" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://www.dotnetmafia.com/members/KyleKelin.aspx</uri></author></entry><entry><title>Why Is My Master Page Not Getting Applied to My Custom Page</title><link rel="alternate" type="text/html" href="http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/07/31/why-is-my-master-page-not-getting-applied-to-my-custom-page.aspx" /><id>http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/07/31/why-is-my-master-page-not-getting-applied-to-my-custom-page.aspx</id><published>2008-07-31T21:23:51Z</published><updated>2008-07-31T21:23:51Z</updated><content type="html">&lt;p&gt;This post is going to assume that you already know how to create a custom master page for SharePoint. There are dozens of articles and posts explaining how to do this. This post is a quick tip about when you have already applied your master page to your site and it works but doesn&amp;#39;t get applied to your custom pages. By custom pages I mean pages that you add via a site definition or feature. Open up the aspx page with VS or SPD and at the top of your aspx page you will need to change your masterpagefile property
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;From
&lt;/p&gt;&lt;p&gt;&amp;lt;%@ Page MasterPageFile=&amp;quot;~masterurl/default.master&amp;quot; Debug=&amp;quot;true&amp;quot; …
&lt;/p&gt;&lt;p&gt;To
&lt;/p&gt;&lt;p&gt;&amp;lt;%@ Page MasterPageFile=&amp;quot;~masterurl/custom.master&amp;quot; Debug=&amp;quot;true&amp;quot; …
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;That is it. Now whatever master page you have applied to the site will be applied to this page as well.
&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=646" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://www.dotnetmafia.com/members/KyleKelin.aspx</uri></author></entry><entry><title>Unobtrusive JavaScript</title><link rel="alternate" type="text/html" href="http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/07/29/unobtrusive-javascript.aspx" /><id>http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/07/29/unobtrusive-javascript.aspx</id><published>2008-07-30T03:49:00Z</published><updated>2008-07-30T03:49:00Z</updated><content type="html">&lt;p&gt;&lt;span style="COLOR:black;"&gt;My current project is a web part with a ton of that Web 2.0 goodness. The client wants a very rich user experience with lots of draggie droppie stuff. So my first thought was to do a quick prototype with ASP.NET AJAX and the AJAX Toolkit but I knew from past experiences the toolkit was very inflexible if it didn&amp;#39;t do exactly what you wanted. And from talking to this client I knew they weren&amp;#39;t going to scale down the requirements. So I downloaded and started using &lt;/span&gt;jQuery&lt;span style="COLOR:black;"&gt; instead. I have been very pleased with what I have learned so far. First jQuery is just a JavaScript library and to include it in your project you just have to download the JavaScript file and include it on your page. So I liked that right away. The other cool thing is there are dozens of plugins (which are just more .js files) that you can add and leverage the functions in the plugin. You have the source so if you need to make modifications you can (flexibility). So I liked that as well. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="COLOR:black;"&gt;Ok so now that the intro is out of the way one of the key principles in jQuery and Prototype is the concept of unobtrusive JavaScript. What this means is you don&amp;#39;t mix JavaScript function calls within your html elements. The reasoning is similar to the reasons you don&amp;#39;t or aren&amp;#39;t supposed to mix inline styles in with your html. It is difficult to read and modify. So if we aren&amp;#39;t suppose to do this then how do we create a click event on say a button. Take the following button: &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:Courier New;"&gt;&lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;input&lt;/span&gt; &lt;span style="COLOR:red;"&gt;type&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;button&amp;quot;&lt;/span&gt; &lt;span style="COLOR:red;"&gt;id&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;MyButton&amp;quot;&lt;/span&gt; &lt;span style="COLOR:red;"&gt;value&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Publish&amp;quot;&lt;/span&gt; &lt;span style="COLOR:red;"&gt;onclick&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;DoSomething()&amp;quot;&lt;/span&gt; &lt;span style="COLOR:blue;"&gt;/&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="COLOR:black;"&gt;Then of course in our script block or a .js file we would implement the DoSomething function. But what if we could wire the click event up when the page loads so we wouldn&amp;#39;t even have to set the onclick property in our html. In jQuery (Note: you can also do this in Prototype and even plain old JavaScript) you can do this. Look at the following function that we would put in our script block: &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:Courier New;"&gt;$(document).ready(&lt;span style="COLOR:blue;"&gt;function&lt;/span&gt;(){ &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:Courier New;"&gt;$(&lt;span style="COLOR:#a31515;"&gt;&amp;quot;#MyButton&amp;quot;&lt;/span&gt;).click(DoSomething); &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:Courier New;"&gt;)}; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="COLOR:black;"&gt;First what the hell does the dollar sign mean. The dollar sign, in JavaScript, usually represents a class. For jQuery,&amp;nbsp;the $ represents the jQuery class which is a .js file that you will include in your page. You will see the $ used to start a selector a lot. The document.ready function gets called when a page loads. Then our button&amp;#39;s id was MyButton so the #MyButton will select that element and wire the click event to call the function DoSomething. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="COLOR:black;"&gt;I have several posts in the works over some jQuery concepts that include (I will post them here to motivate me to finish them) : &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="COLOR:black;"&gt;jQuery Basics – selectors and events&lt;br /&gt;jQuery Links and Plugins Rollup&lt;br /&gt;Mixing ASP.NET Controls with jQuery (or should you even try)&lt;br /&gt;Ajax, WCF, and jQuery&lt;br /&gt;Creating a Drag and Drop Sortable List inside a Modal Popup &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="COLOR:black;"&gt;Stay Tuned…&lt;/span&gt;&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=644" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://www.dotnetmafia.com/members/KyleKelin.aspx</uri></author><category term="jQuery" scheme="http://www.dotnetmafia.com/blogs/kylekelin/archive/tags/jQuery/default.aspx" /></entry><entry><title>PortalSiteMapProvider was unable to fetch children for node</title><link rel="alternate" type="text/html" href="http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/06/06/portalsitemapprovider-was-unable-to-fetch-children-for-node.aspx" /><id>http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/06/06/portalsitemapprovider-was-unable-to-fetch-children-for-node.aspx</id><published>2008-06-06T16:04:45Z</published><updated>2008-06-06T16:04:45Z</updated><content type="html">&lt;p&gt;I ran into a strange error today and thought it needed documenting. I have two WFE in a small farm. One server the navigation was fine but on the other server the navigation had an error. The Nodes where missing except for one code that said ERROR. When you mouse over it you got the followed exception and stack trace:
&lt;/p&gt;&lt;p&gt;PortalSiteMapProvider was unable to fetch children for node at URL: /, message: Object reference not set to an instance of an object., stack trace: at Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapNode.GetNavigationChildren(NodeTypes includedTypes, NodeTypes includedHiddenTypes, OrderingMethod ordering, AutomaticSortingMethod method, Boolean ascending, Int32 lcid) at Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapNode.GetNavigationChildren(NodeTypes includedHiddenTypes) at Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider.GetChildNodes(PortalSiteMapNode node, NodeTypes includedHiddenTypes)
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;I fixed this by adding the second server to the Alternative Access Mappings (the first one was already in there). I apologize but I don&amp;#39;t know the details of why this fixed the error. If I get time I will give into the details of the why.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=602" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://www.dotnetmafia.com/members/KyleKelin.aspx</uri></author></entry><entry><title>Printing a List</title><link rel="alternate" type="text/html" href="http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/06/06/printing-a-list.aspx" /><id>http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/06/06/printing-a-list.aspx</id><published>2008-06-06T14:17:42Z</published><updated>2008-06-06T14:17:42Z</updated><content type="html">&lt;p&gt;Have you ever tried to print a List in SharePoint. Well first you have to export it to Excel then print it. Yuck! Well there is a better way. Check out the link below.
&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.sharepoint-tips.com/2007/01/how-to-add-print-list-option-to-list.html"&gt;http://www.sharepoint-tips.com/2007/01/how-to-add-print-list-option-to-list.html&lt;/a&gt;
	&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;This is basically a feature that installs a Print List link in the Action menu. The List then opens in a print preview mode. I do wish the author would have packaged it up as a wsp but the steps are pretty clear. In fact I&amp;#39;ve been doing some developer training on deployment lately and I might use this article to show what a wsp actually does when installing a feature.
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;Kyle&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=601" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://www.dotnetmafia.com/members/KyleKelin.aspx</uri></author></entry></feed>