<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Irfanyar's Weblog</title>
	<atom:link href="http://irfanyar.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://irfanyar.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Tue, 15 Nov 2011 17:00:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='irfanyar.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Irfanyar's Weblog</title>
		<link>http://irfanyar.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://irfanyar.wordpress.com/osd.xml" title="Irfanyar&#039;s Weblog" />
	<atom:link rel='hub' href='http://irfanyar.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Disable weekends for AjaxToolKit Calendar extender</title>
		<link>http://irfanyar.wordpress.com/2010/10/19/disable-weekends-for-ajaxtoolkit-calendar-extender/</link>
		<comments>http://irfanyar.wordpress.com/2010/10/19/disable-weekends-for-ajaxtoolkit-calendar-extender/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 23:17:33 +0000</pubDate>
		<dc:creator>irfanyar</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://irfanyar.wordpress.com/2010/10/19/disable-weekends-for-ajaxtoolkit-calendar-extender/</guid>
		<description><![CDATA[AJAXTOOLKIT version 3.0.30512.0 It is possible to disable weekends/public holidays as per your need, using javascript Following is the code to disable weekends javascript to disable weekends function DisableWeekends(sender, args) {      for(var i=0; i&#60;sender._days.all.length; i++)     {               for(var j=0; j&#60;6; j++)              {                     if(sender._days.all[i].id == &#8220;calendarValidToDate_day_&#8221;+j+&#8221;_0&#8243;)                    {                           sender._days.all[i].disabled = true; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=irfanyar.wordpress.com&amp;blog=2594290&amp;post=23&amp;subd=irfanyar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:#ff0000;">AJAXTOOLKIT version 3.0.30512.0</span></p>
<p>It is possible to disable weekends/public holidays as per your need, using javascript</p>
<p>Following is the code to disable weekends</p>
<p><span style="color:#ff0000;">javascript to disable weekends</span></p>
<p>function DisableWeekends(sender, args)<br />
{<br />
     for(var i=0; i&lt;sender._days.all.length; i++)<br />
    {<br />
              for(var j=0; j&lt;6; j++)<br />
             {<br />
                    if(sender._days.all[i].id == &#8220;calendarValidToDate_day_&#8221;+j+&#8221;_0&#8243;)<br />
                   {<br />
                          sender._days.all[i].disabled = true;<br />
                          sender._days.all[i].innerHTML = &#8220;&lt;div&gt;&#8221; +sender._days.all[i].innerText+ &#8220;&lt;/div&gt;&#8221;;<br />
                    }</p>
<p>                    if(sender._days.all[i].id == &#8220;calendarValidToDate_day_&#8221;+j+&#8221;_6&#8243;)<br />
                   {<br />
                            sender._days.all[i].disabled = true;<br />
                            sender._days.all[i].innerHTML = &#8220;&lt;div&gt;&#8221; +sender._days.all[i].innerText+ &#8220;&lt;/div&gt;&#8221;;<br />
                   }<br />
            }<br />
     }<br />
}</p>
<p><span style="color:#ff0000;">Calendar extender html</span></p>
<p><span style="color:#000000;">&lt;asp:TextBox ID=&#8221;txtDate&#8221; Enabled=&#8221;true&#8221; runat=&#8221;server&#8221; Width=&#8221;200px&#8221;&gt;&lt;/asp:TextBox&gt;<br />
</span><span style="color:#000000;">&lt;asp:ImageButton runat=&#8221;server&#8221; ID=&#8221;imageValidToDate&#8221; SkinID =&#8221;calendarButton&#8221; /&gt;</span></p>
<p><span style="color:#000000;"> </span>&lt;AJAXControl:CalendarExtender ID =&#8221;calendarValidToDate&#8221; runat=&#8221;server&#8221; TargetControlID=&#8221;txtDate&#8221;<br />
                           Format=&#8221;dd/MM/yyyy&#8221; PopupButtonID =&#8221;imageValidToDate&#8221; FirstDayOfWeek=&#8221;Default&#8221;<br />
                           OnClientShown=&#8221;DisableWeekends&#8221;&gt;<br />
                        &lt;/AJAXControl:CalendarExtender&gt;</p>
<p>==================================================================================</p>
<p>Cheers</p>
<p>Irfan Yar</p>
<p><span style="color:#ff9900;">irfanyar@gmail.com</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/irfanyar.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/irfanyar.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/irfanyar.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/irfanyar.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/irfanyar.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/irfanyar.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/irfanyar.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/irfanyar.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/irfanyar.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/irfanyar.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/irfanyar.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/irfanyar.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/irfanyar.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/irfanyar.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=irfanyar.wordpress.com&amp;blog=2594290&amp;post=23&amp;subd=irfanyar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://irfanyar.wordpress.com/2010/10/19/disable-weekends-for-ajaxtoolkit-calendar-extender/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ac55a3929c6d61c27d93e0cf7d47d521?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">irfanyar</media:title>
		</media:content>
	</item>
		<item>
		<title>modalpopupextender drag problem</title>
		<link>http://irfanyar.wordpress.com/2009/11/20/modalpopupextender-drag-problem/</link>
		<comments>http://irfanyar.wordpress.com/2009/11/20/modalpopupextender-drag-problem/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 04:53:45 +0000</pubDate>
		<dc:creator>irfanyar</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://irfanyar.wordpress.com/?p=20</guid>
		<description><![CDATA[I have seen quite a few people getting issues with dragging the modal popup extender. If you are having an issue that when you drag the modal popup extender, it doesnt stay at the position you leave but gets back to its orginal position as soon as you leave the mouse button, then here is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=irfanyar.wordpress.com&amp;blog=2594290&amp;post=20&amp;subd=irfanyar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have seen quite a few people getting issues with dragging the modal popup extender. If you are having an issue that when you drag the modal popup extender, it doesnt stay at the position you leave but gets back to its orginal position as soon as you leave the mouse button, then here is the solution, just replace your body tag with this</p>
<blockquote><p><span style="color:#ff0000;">&lt;body style=&#8221;min-height:710px;&#8221;&gt;</span></p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/irfanyar.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/irfanyar.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/irfanyar.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/irfanyar.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/irfanyar.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/irfanyar.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/irfanyar.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/irfanyar.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/irfanyar.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/irfanyar.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/irfanyar.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/irfanyar.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/irfanyar.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/irfanyar.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=irfanyar.wordpress.com&amp;blog=2594290&amp;post=20&amp;subd=irfanyar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://irfanyar.wordpress.com/2009/11/20/modalpopupextender-drag-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ac55a3929c6d61c27d93e0cf7d47d521?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">irfanyar</media:title>
		</media:content>
	</item>
		<item>
		<title>Validation of expression (asp.net regular expression) through custom javascript</title>
		<link>http://irfanyar.wordpress.com/2009/05/13/validation-of-expression-asp-net-regular-expression-through-custom-javascript/</link>
		<comments>http://irfanyar.wordpress.com/2009/05/13/validation-of-expression-asp-net-regular-expression-through-custom-javascript/#comments</comments>
		<pubDate>Wed, 13 May 2009 07:21:02 +0000</pubDate>
		<dc:creator>irfanyar</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://irfanyar.wordpress.com/?p=18</guid>
		<description><![CDATA[You can validate asp.net regular expressions using your custom javascript var stringToValidate = document.getElementById(&#8220;txtPasswordId&#8221;).value;             var expression= /(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{6,})$/;             if (!expression.test(stringToValidate)) {                 alert(&#8220;enter valid password&#8221;);             }     similarly you can validate any other regular expression generated by your asp.net validation controls<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=irfanyar.wordpress.com&amp;blog=2594290&amp;post=18&amp;subd=irfanyar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>You can validate asp.net regular expressions using your custom javascript</p>
<p>var stringToValidate = document.getElementById(&#8220;txtPasswordId&#8221;).value;<br />
            var expression= /(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{6,})$/;<br />
            if (!expression.test(stringToValidate)) {<br />
                alert(&#8220;enter valid password&#8221;);<br />
            }</p>
<p> </p>
<p> </p>
<p>similarly you can validate any other regular expression generated by your asp.net validation controls</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/irfanyar.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/irfanyar.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/irfanyar.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/irfanyar.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/irfanyar.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/irfanyar.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/irfanyar.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/irfanyar.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/irfanyar.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/irfanyar.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/irfanyar.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/irfanyar.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/irfanyar.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/irfanyar.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=irfanyar.wordpress.com&amp;blog=2594290&amp;post=18&amp;subd=irfanyar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://irfanyar.wordpress.com/2009/05/13/validation-of-expression-asp-net-regular-expression-through-custom-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ac55a3929c6d61c27d93e0cf7d47d521?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">irfanyar</media:title>
		</media:content>
	</item>
		<item>
		<title>Setting visibility of asp.net elements through java script</title>
		<link>http://irfanyar.wordpress.com/2009/05/11/setting-visibility-of-asp-net-elements-through-java-script/</link>
		<comments>http://irfanyar.wordpress.com/2009/05/11/setting-visibility-of-asp-net-elements-through-java-script/#comments</comments>
		<pubDate>Mon, 11 May 2009 08:10:19 +0000</pubDate>
		<dc:creator>irfanyar</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://irfanyar.wordpress.com/?p=14</guid>
		<description><![CDATA[setting visibility (show / hide) is not working with javascript<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=irfanyar.wordpress.com&amp;blog=2594290&amp;post=14&amp;subd=irfanyar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you are trying to show/hide a div or any other element via JavaScript (Java Script) and it appears to work on some browsers and not on others then one of the possible causes of failure is that you might be setting its visibility and display to “visible” and “block” etc What you need to do is to set the display of the element like this</p>
<p><span style="font-size:x-small;"><span style="font-size:x-small;"><span style="color:#ff0000;">document.getElementById(</span></span></span><span style="color:#ff0000;"><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">&#8216;id&#8217;</span></span><span style="font-size:x-small;">).style.display = </span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">&#8221;</span></span><span style="font-size:x-small;">; //empty string</span></span></p>
<p>this works for all browsers as far as my experience is concerned</p>
<p>happy hunting</p>
<p>cheers</p>
<p>Irfan Yar</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/irfanyar.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/irfanyar.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/irfanyar.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/irfanyar.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/irfanyar.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/irfanyar.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/irfanyar.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/irfanyar.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/irfanyar.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/irfanyar.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/irfanyar.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/irfanyar.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/irfanyar.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/irfanyar.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=irfanyar.wordpress.com&amp;blog=2594290&amp;post=14&amp;subd=irfanyar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://irfanyar.wordpress.com/2009/05/11/setting-visibility-of-asp-net-elements-through-java-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ac55a3929c6d61c27d93e0cf7d47d521?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">irfanyar</media:title>
		</media:content>
	</item>
		<item>
		<title>Schema based intellisence to custom files (with extension other than .xml)</title>
		<link>http://irfanyar.wordpress.com/2008/06/07/schema-based-intellisence-to-custom-files-with-extension-other-than-xml/</link>
		<comments>http://irfanyar.wordpress.com/2008/06/07/schema-based-intellisence-to-custom-files-with-extension-other-than-xml/#comments</comments>
		<pubDate>Sat, 07 Jun 2008 05:13:26 +0000</pubDate>
		<dc:creator>irfanyar</dc:creator>
				<category><![CDATA[Visual Studio 2008]]></category>

		<guid isPermaLink="false">http://irfanyar.wordpress.com/?p=10</guid>
		<description><![CDATA[Adding intellisence to your files<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=irfanyar.wordpress.com&amp;blog=2594290&amp;post=10&amp;subd=irfanyar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-family:Calibri;"><strong><span style="text-decoration:underline;"><span style="font-size:12pt;color:#000000;">Schema based intellisence to custom files (with extension other than .xml)</span></span></strong></span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-family:Calibri;"><strong><span style="font-size:12pt;color:#000000;"> </span></strong></span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-family:Calibri;"><span style="font-size:12pt;color:#000000;">At times we have some files with custom extensions, like I had to use an extension “.casl”, but I wanted to incorporate the intellisence based on a XSD schema file to that casl file. Just like we do attach a schema to xml files and we get the intellisence available in the xml file. To achieve this we need to do the following.</span></span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-family:Calibri;"><span style="font-size:12pt;color:#000000;"> </span></span></p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:normal;margin:0 0 0 .5in;"><span style="font-size:12pt;color:#000000;"><span style="font-family:Calibri;">1.</span></span><span style="font-size:7pt;color:#000000;">       </span><span style="font-family:Calibri;"><span style="font-size:12pt;color:#000000;">Locate the VS.net installation directory (e.g I have VS.net 2008 installed at C:\program files\Microsoft Visual Studio 9.0)</span></span></p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:normal;margin:0 0 0 .5in;"><span style="font-size:12pt;color:#000000;"><span style="font-family:Calibri;">2.</span></span><span style="font-size:7pt;color:#000000;">       </span><span style="font-family:Calibri;"><span style="font-size:12pt;color:#000000;">You would be able to see a folder named “xml” and inside that folder you will see a folder named “schema” (on my system I can browse to the following path to get inside the schema folder C:\program files\Microsoft Visual Studio 9.0\Xml\Schemas)</span></span></p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:normal;margin:0 0 0 .5in;"><span style="font-size:12pt;color:#000000;"><span style="font-family:Calibri;">3.</span></span><span style="font-size:7pt;color:#000000;">       </span><span style="font-family:Calibri;"><span style="font-size:12pt;color:#000000;">Inside “schema” folder you will find a configuration file named “catalog.xml”</span></span></p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:normal;margin:0 0 0 .5in;"><span style="font-size:12pt;color:#000000;"><span style="font-family:Calibri;">4.</span></span><span style="font-size:7pt;color:#000000;">       </span><span style="font-size:12pt;color:#000000;"><span style="font-family:Calibri;">Open “catalog.xml” in the VS.net and add the following association tag (</span></span><span style="font-size:10pt;color:#0000ff;">&lt;</span><span style="font-size:10pt;color:#a31515;">Association</span><span style="font-size:10pt;color:#0000ff;"> </span><span style="font-size:10pt;color:#ff0000;">extension</span><span style="font-size:10pt;color:#0000ff;">=</span><span style="font-size:10pt;color:#000000;">&#8220;</span><span style="font-size:10pt;color:#0000ff;">casl</span><span style="font-size:10pt;color:#000000;">&#8220;</span><span style="font-size:10pt;color:#0000ff;"> </span><span style="font-size:10pt;color:#ff0000;">schema</span><span style="font-size:10pt;color:#0000ff;">=</span><span style="font-size:10pt;color:#000000;">&#8220;</span><span style="font-size:10pt;color:#0000ff;">c:/CaslSchema.xsd</span><span style="font-size:10pt;color:#000000;">&#8220;</span><span style="font-size:10pt;color:#0000ff;"> </span><span style="font-size:10pt;color:#ff0000;">condition</span><span style="font-size:10pt;color:#0000ff;">=</span><span style="font-size:10pt;color:#000000;">&#8220;</span><span style="font-size:10pt;color:#0000ff;">*</span><span style="font-size:10pt;color:#000000;">&#8220;&gt;) just save this file and open the file with casl extension and you will be able to use the intellisence feature</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0 0 0 .5in;"><span style="font-family:Calibri;"><span style="font-size:12pt;color:#000000;"> </span></span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;"><span style="font-family:Calibri;">Please note that you must place the custom schema at the path you specify inside the schema attribute (</span></span><span style="font-size:12pt;color:#ff0000;">schema</span><span style="font-size:12pt;color:#0000ff;">=</span><span style="font-size:12pt;color:#000000;">&#8220;</span><span style="font-size:12pt;color:#0000ff;">c:/CaslSchema.xsd</span><span style="font-size:12pt;color:#000000;">&#8220;</span><span style="font-family:Calibri;"><span style="font-size:12pt;color:#000000;">) in the above example I have placed it at C:/</span></span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-family:Calibri;"><span style="font-size:12pt;color:#000000;"> </span></span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-family:Calibri;"><span style="font-size:12pt;color:#000000;"> </span></span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-family:Calibri;"><span style="font-size:12pt;color:#000000;">To achieve this programmatically please try the following code</span></span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-family:Calibri;"><span style="font-size:12pt;color:#000000;"> </span></span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">Microsoft.Win32.</span><span style="font-size:12pt;color:#2b91af;">RegistryKey</span><span style="font-size:12pt;color:#000000;"> rk = Microsoft.Win32.</span><span style="font-size:12pt;color:#2b91af;">Registry</span><span style="font-size:12pt;color:#000000;">.LocalMachine.OpenSubKey(</span><span style="font-size:12pt;color:#a31515;">@&#8221;Software\Microsoft\VisualStudio\9.0&#8243;</span><span style="font-size:12pt;color:#000000;">, </span><span style="font-size:12pt;color:#0000ff;">true</span><span style="font-size:12pt;color:#000000;">);</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">            </span><span style="font-size:12pt;color:#0000ff;">string</span><span style="font-size:12pt;color:#000000;"> installationDirectoryPath = rk.GetValue(</span><span style="font-size:12pt;color:#a31515;">&#8220;InstallDir&#8221;</span><span style="font-size:12pt;color:#000000;">).ToString();</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">            installationDirectoryPath = installationDirectoryPath.Replace(</span><span style="font-size:12pt;color:#a31515;">&#8220;\\Common7\\IDE\\&#8221;</span><span style="font-size:12pt;color:#000000;">, </span><span style="font-size:12pt;color:#a31515;">&#8220;&#8221;</span><span style="font-size:12pt;color:#000000;">);</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">            </span><span style="font-size:12pt;color:#0000ff;">string</span><span style="font-size:12pt;color:#000000;"> configurationFilePath = installationDirectoryPath + </span><span style="font-size:12pt;color:#a31515;">&#8220;\\Xml\\Schemas\\catalog.xml&#8221;</span><span style="font-size:12pt;color:#000000;">;</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">            System.IO.</span><span style="font-size:12pt;color:#2b91af;">StreamReader</span><span style="font-size:12pt;color:#000000;"> sr = </span><span style="font-size:12pt;color:#0000ff;">new</span><span style="font-size:12pt;color:#000000;"> </span><span style="font-size:12pt;color:#2b91af;">StreamReader</span><span style="font-size:12pt;color:#000000;">(</span><span style="font-size:12pt;color:#0000ff;">new</span><span style="font-size:12pt;color:#000000;"> </span><span style="font-size:12pt;color:#2b91af;">FileStream</span><span style="font-size:12pt;color:#000000;">(configurationFilePath,System.IO.</span><span style="font-size:12pt;color:#2b91af;">FileMode</span><span style="font-size:12pt;color:#000000;">.Open,System.IO.</span><span style="font-size:12pt;color:#2b91af;">FileAccess</span><span style="font-size:12pt;color:#000000;">.ReadWrite));</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">            </span><span style="font-size:12pt;color:#0000ff;">string</span><span style="font-size:12pt;color:#000000;"> fileContents = sr.ReadToEnd();</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">            sr.Close();</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">            </span><span style="font-size:12pt;color:#2b91af;">XmlDocument</span><span style="font-size:12pt;color:#000000;"> xmlDoc = </span><span style="font-size:12pt;color:#0000ff;">new</span><span style="font-size:12pt;color:#000000;"> </span><span style="font-size:12pt;color:#2b91af;">XmlDocument</span><span style="font-size:12pt;color:#000000;">();</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">            xmlDoc.LoadXml(fileContents);</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">            </span><span style="font-size:12pt;color:#2b91af;">XmlNode</span><span style="font-size:12pt;color:#000000;"> node = xmlDoc.LastChild;</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">            </span><span style="font-size:12pt;color:#0000ff;">bool</span><span style="font-size:12pt;color:#000000;"> associationExisits = </span><span style="font-size:12pt;color:#0000ff;">false</span><span style="font-size:12pt;color:#000000;">;</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">            </span><span style="font-size:12pt;color:#0000ff;">foreach</span><span style="font-size:12pt;color:#000000;"> (</span><span style="font-size:12pt;color:#2b91af;">XmlNode</span><span style="font-size:12pt;color:#000000;"> childNode </span><span style="font-size:12pt;color:#0000ff;">in</span><span style="font-size:12pt;color:#000000;"> node.ChildNodes)</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">            {</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">                </span><span style="font-size:12pt;color:#0000ff;">if</span><span style="font-size:12pt;color:#000000;"> (childNode.Attributes[</span><span style="font-size:12pt;color:#a31515;">"extension"</span><span style="font-size:12pt;color:#000000;">] != </span><span style="font-size:12pt;color:#0000ff;">null</span><span style="font-size:12pt;color:#000000;">)</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">                {</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">                    </span><span style="font-size:12pt;color:#0000ff;">if</span><span style="font-size:12pt;color:#000000;"> (childNode.Attributes[</span><span style="font-size:12pt;color:#a31515;">"extension"</span><span style="font-size:12pt;color:#000000;">].Value.ToLower() == </span><span style="font-size:12pt;color:#a31515;">&#8220;casl&#8221;</span><span style="font-size:12pt;color:#000000;">)</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">                    {</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">                        associationExisits = </span><span style="font-size:12pt;color:#0000ff;">true</span><span style="font-size:12pt;color:#000000;">;</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">                        </span><span style="font-size:12pt;color:#0000ff;">break</span><span style="font-size:12pt;color:#000000;">;</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">                    }</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">                }</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">            }</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">            </span><span style="font-size:12pt;color:#0000ff;">if</span><span style="font-size:12pt;color:#000000;"> (!associationExisits)</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">            {</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">                </span><span style="font-size:12pt;color:#2b91af;">XmlNode</span><span style="font-size:12pt;color:#000000;"> lastAssociationChild = node.LastChild;</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">                </span><span style="font-size:12pt;color:#2b91af;">XmlNode</span><span style="font-size:12pt;color:#000000;"> newNode = lastAssociationChild.Clone();</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">                newNode.Attributes[</span><span style="font-size:12pt;color:#a31515;">"extension"</span><span style="font-size:12pt;color:#000000;">].Value = </span><span style="font-size:12pt;color:#a31515;">&#8220;casl&#8221;</span><span style="font-size:12pt;color:#000000;">;</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">                newNode.Attributes[</span><span style="font-size:12pt;color:#a31515;">"schema"</span><span style="font-size:12pt;color:#000000;">].Value = </span><span style="font-size:12pt;color:#a31515;">@&#8221;C:\CamlSchema.xsd&#8221;</span><span style="font-size:12pt;color:#000000;">;</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">                newNode.Attributes[</span><span style="font-size:12pt;color:#a31515;">"condition"</span><span style="font-size:12pt;color:#000000;">].Value = </span><span style="font-size:12pt;color:#a31515;">&#8220;*&#8221;</span><span style="font-size:12pt;color:#000000;">;</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">                node.AppendChild(newNode);</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">                xmlDoc.LoadXml(</span><span style="font-size:12pt;color:#a31515;">&#8220;&lt;SchemaCatalog  xmlns=\&#8221;http://schemas.microsoft.com/xsd/catalog\&#8221;&gt;&#8221;</span><span style="font-size:12pt;color:#000000;"> + node.InnerXml + </span><span style="font-size:12pt;color:#a31515;">&#8220;&lt;/SchemaCatalog&gt;&#8221;</span><span style="font-size:12pt;color:#000000;">);</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">                </span><span style="font-size:12pt;color:#2b91af;">StreamWriter</span><span style="font-size:12pt;color:#000000;"> writer = </span><span style="font-size:12pt;color:#0000ff;">new</span><span style="font-size:12pt;color:#000000;"> </span><span style="font-size:12pt;color:#2b91af;">StreamWriter</span><span style="font-size:12pt;color:#000000;">(</span><span style="font-size:12pt;color:#0000ff;">new</span><span style="font-size:12pt;color:#000000;"> </span><span style="font-size:12pt;color:#2b91af;">FileStream</span><span style="font-size:12pt;color:#000000;">(configurationFilePath, System.IO.</span><span style="font-size:12pt;color:#2b91af;">FileMode</span><span style="font-size:12pt;color:#000000;">.Open, System.IO.</span><span style="font-size:12pt;color:#2b91af;">FileAccess</span><span style="font-size:12pt;color:#000000;">.ReadWrite));</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">                writer.Flush();</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">                writer.Write(xmlDoc.InnerXml);</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">                writer.Close();</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:12pt;color:#000000;">            }</span></p>
<p class="MsoNormal" style="line-height:14.25pt;margin:0 0 10pt;"><span style="font-size:12pt;color:#000000;"> </span></p>
<p class="MsoNormal" style="line-height:14.25pt;margin:0 0 10pt;"><span style="font-size:12pt;color:#000000;">      </span></p>
<p class="MsoNormal" style="line-height:14.25pt;margin:0 0 10pt;"><span style="font-size:12pt;color:#000000;"><span style="font-family:Calibri;">if there is any issue in this, please feel free to contact me at </span><a href="mailto:irfanyar@gmail.com"><span style="color:#0000ff;"><span style="font-family:Calibri;">irfanyar@gmail.com</span></span></a></span></p>
<p class="MsoNormal" style="line-height:14.25pt;margin:0 0 10pt;"><span style="font-family:Calibri;"><span style="font-size:12pt;color:#000000;">Cheers</span></span></p>
<p class="MsoNormal" style="line-height:14.25pt;margin:0 0 10pt;"><span style="font-family:Calibri;"><span style="font-size:12pt;color:#000000;">Irfan Yar</span></span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:10pt;"> </span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/irfanyar.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/irfanyar.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/irfanyar.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/irfanyar.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/irfanyar.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/irfanyar.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/irfanyar.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/irfanyar.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/irfanyar.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/irfanyar.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/irfanyar.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/irfanyar.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/irfanyar.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/irfanyar.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/irfanyar.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/irfanyar.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=irfanyar.wordpress.com&amp;blog=2594290&amp;post=10&amp;subd=irfanyar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://irfanyar.wordpress.com/2008/06/07/schema-based-intellisence-to-custom-files-with-extension-other-than-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ac55a3929c6d61c27d93e0cf7d47d521?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">irfanyar</media:title>
		</media:content>
	</item>
		<item>
		<title>locate the installation directory of visual studio .net (or any other installed software)</title>
		<link>http://irfanyar.wordpress.com/2008/06/07/locate-the-installation-directory-of-visual-studio-net-or-any-other-installed-software/</link>
		<comments>http://irfanyar.wordpress.com/2008/06/07/locate-the-installation-directory-of-visual-studio-net-or-any-other-installed-software/#comments</comments>
		<pubDate>Sat, 07 Jun 2008 05:09:52 +0000</pubDate>
		<dc:creator>irfanyar</dc:creator>
				<category><![CDATA[Visual Studio 2008]]></category>

		<guid isPermaLink="false">http://irfanyar.wordpress.com/?p=8</guid>
		<description><![CDATA[Get installation directory path I have seen people trying to locate the installation directory of visual studio .net (or any other installed software). Microsoft windows register the installation path of VS.net in the registry. To get the installation path you can request the registry for this information. Following is the code snippet for doing this [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=irfanyar.wordpress.com&amp;blog=2594290&amp;post=8&amp;subd=irfanyar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="line-height:14.25pt;margin:0 0 10pt;"><span style="font-family:Calibri;"><strong><span style="text-decoration:underline;"><span style="font-size:12pt;color:black;">Get installation directory path</span></span></strong><span style="font-size:12pt;color:black;font-family:&quot;"></span></span></p>
<p class="MsoNormal" style="line-height:14.25pt;margin:0 0 10pt;"><span style="font-family:Calibri;"><span style="font-size:12pt;color:black;">I have seen people trying to locate the installation directory of visual studio .net (or any other installed software). Microsoft windows register the installation path of VS.net in the registry. To get the installation path you can request the registry for this information. Following is the code snippet for doing this</span><span style="font-size:12pt;color:black;font-family:&quot;"></span></span></p>
<p class="MsoNormal" style="line-height:14.25pt;margin:0 0 10pt;"><span style="font-size:12pt;color:black;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="line-height:14.25pt;margin:0 0 10pt;"><span style="font-size:12pt;color:black;font-family:&quot;">Microsoft.Win32.</span><span style="font-size:12pt;color:#2b91af;font-family:&quot;">RegistryKey</span><span style="font-size:12pt;color:black;font-family:&quot;"> regKey = Microsoft.Win32.</span><span style="font-size:12pt;color:#2b91af;font-family:&quot;">Registry</span><span style="font-size:12pt;color:black;font-family:&quot;">.LocalMachine.OpenSubKey(</span><span style="font-size:12pt;color:#a31515;font-family:&quot;">@&#8221;Software\Microsoft\VisualStudio\9.0&#8243;</span><span style="font-size:12pt;color:black;font-family:&quot;">, </span><span style="font-size:12pt;color:blue;font-family:&quot;">true</span><span style="font-size:12pt;color:black;font-family:&quot;">);</span></p>
<p class="MsoNormal" style="line-height:14.25pt;margin:0 0 10pt;"><span style="font-size:12pt;color:black;font-family:&quot;">            </span><span style="font-size:12pt;color:blue;font-family:&quot;">string</span><span style="font-size:12pt;color:black;font-family:&quot;"> installationDirectoryPath = regKey.GetValue(</span><span style="font-size:12pt;color:#a31515;font-family:&quot;">&#8220;InstallDir&#8221;</span><span style="font-size:12pt;color:black;font-family:&quot;">).ToString();</span></p>
<p class="MsoNormal" style="line-height:14.25pt;margin:0 0 10pt;"><span style="font-size:12pt;color:black;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="line-height:14.25pt;margin:0 0 10pt;"><span style="font-size:12pt;color:black;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="line-height:14.25pt;margin:0 0 10pt;"><span style="font-size:12pt;color:black;"><span style="font-family:Calibri;">if there is any issue in this, please feel free to contact me at </span><a href="mailto:irfanyar@gmail.com"><span style="color:blue;"><span style="font-family:Calibri;">irfanyar@gmail.com</span></span></a></span><span style="font-size:12pt;color:black;font-family:&quot;"></span></p>
<p class="MsoNormal" style="line-height:14.25pt;margin:0 0 10pt;"><span style="font-size:12pt;color:black;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="line-height:14.25pt;margin:0 0 10pt;"><span style="font-family:Calibri;"><span style="font-size:12pt;color:black;">Cheers</span><span style="font-size:12pt;color:black;font-family:&quot;"></span></span></p>
<p class="MsoNormal" style="line-height:14.25pt;margin:0 0 10pt;"><span style="font-size:12pt;color:black;"><span style="font-family:Calibri;">Irfan Yar</span></span><span style="font-size:12pt;color:black;font-family:&quot;"></span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/irfanyar.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/irfanyar.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/irfanyar.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/irfanyar.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/irfanyar.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/irfanyar.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/irfanyar.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/irfanyar.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/irfanyar.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/irfanyar.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/irfanyar.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/irfanyar.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/irfanyar.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/irfanyar.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/irfanyar.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/irfanyar.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=irfanyar.wordpress.com&amp;blog=2594290&amp;post=8&amp;subd=irfanyar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://irfanyar.wordpress.com/2008/06/07/locate-the-installation-directory-of-visual-studio-net-or-any-other-installed-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ac55a3929c6d61c27d93e0cf7d47d521?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">irfanyar</media:title>
		</media:content>
	</item>
		<item>
		<title>Custom lookup control for MSCRM 3.0</title>
		<link>http://irfanyar.wordpress.com/2008/01/23/custom-lookup-control-for-mscrm-30/</link>
		<comments>http://irfanyar.wordpress.com/2008/01/23/custom-lookup-control-for-mscrm-30/#comments</comments>
		<pubDate>Wed, 23 Jan 2008 10:41:48 +0000</pubDate>
		<dc:creator>irfanyar</dc:creator>
				<category><![CDATA[MSCRM]]></category>

		<guid isPermaLink="false">http://irfanyar.wordpress.com/2008/01/23/custom-lookup-control-for-mscrm-30/</guid>
		<description><![CDATA[I have often seen people messing up with the lookup in their custom add ons to MSCRM 3.0 I made a custom lookup control for the same problem. its really simple and working perfectly fine for all entities it has total 5 parts that you need to look for 1.       ascx (lookup control ) file [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=irfanyar.wordpress.com&amp;blog=2594290&amp;post=3&amp;subd=irfanyar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-family:'Georgia','serif';">I have often seen people messing up with the lookup in their custom add ons to MSCRM 3.0</span></p>
<p><span style="font-family:'Georgia','serif';"></span><span style="font-family:'Georgia','serif';">I made a custom lookup control for the same problem. its really simple and working perfectly fine for all entities</span></p>
<p><span style="font-family:'Georgia','serif';"></span><span style="font-family:'Georgia','serif';">it has total 5 parts that you need to look for</span></p>
<p><span style="font-family:'Georgia','serif';"><span>1.<span style="font:7pt 'Times New Roman';">       </span></span></span><span style="font-family:'Georgia','serif';">ascx (lookup control ) file</span></p>
<p><span style="font-family:'Georgia','serif';"></span><span style="font-family:'Georgia','serif';"><span>2.<span style="font:7pt 'Times New Roman';">      </span></span></span><span style="font-family:'Georgia','serif';"><span> </span>javascript</span><span style="font-family:'Georgia','serif';"><span>3.<span style="font:7pt 'Times New Roman';">      </span></span></span><span style="font-family:'Georgia','serif';">Codebehind (.cs) file</span></p>
<p><span style="font-family:'Georgia','serif';"></span><span style="font-family:'Georgia','serif';"><span>4.<span style="font:7pt 'Times New Roman';">      </span></span></span><span style="font-family:'Georgia','serif';">Style sheet</span></p>
<p><span style="font-family:'Georgia','serif';"></span><span style="font-family:'Georgia','serif';"><span>5.<span style="font:7pt 'Times New Roman';">      </span></span></span><span style="font-family:'Georgia','serif';">Page on which lookup control resides</span></p>
<p><span style="font-family:'Georgia','serif';"></span><span style="font-family:'Georgia','serif';"> </span><span style="font-family:'Georgia','serif';"> </span><span style="font-family:'Georgia','serif';">l</span><span style="font-family:'Georgia','serif';">et me explain all of them in order</span></p>
<p><span style="font-family:'Georgia','serif';"></span><strong><span style="font-family:'Georgia','serif';">1. ASCX (look and feel of lookup)</span></strong></p>
<p><strong><span style="font-family:'Georgia','serif';"></span></strong><span style="font-family:'Georgia','serif';"></span><span style="font-size:7pt;color:#999999;font-family:'Georgia','serif';">&lt;%</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">@</span><span style="font-size:7pt;color:#999999;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:#a31515;font-family:'Georgia','serif';">Control</span><span style="font-size:7pt;color:#999999;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">Language</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">=&#8221;C#&#8221;</span><span style="font-size:7pt;color:#999999;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">AutoEventWireup</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">=&#8221;true&#8221;</span><span style="font-size:7pt;color:#999999;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">CodeFile</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">=&#8221;usrCtlLookUp.ascx.cs&#8221;</span><span style="font-size:7pt;color:#999999;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">Inherits</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">=&#8221;usercontrols_usrCtlLookUp&#8221;</span><span style="font-size:7pt;color:#999999;font-family:'Georgia','serif';"> %&gt;</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">&lt;</span><span style="font-size:7pt;color:#a31515;font-family:'Georgia','serif';">table</span><span style="font-size:7pt;color:black;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">runat</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">=&#8221;server&#8221;</span><span style="font-size:7pt;color:black;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">id</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">=&#8221;tblMain&#8221;</span><span style="font-size:7pt;color:black;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">width</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">=&#8221;84%&#8221;</span><span style="font-size:7pt;color:black;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">cellpadding</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">=&#8221;0&#8243;</span><span style="font-size:7pt;color:black;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">cellspacing</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">=&#8221;0&#8243;</span><span style="font-size:7pt;color:black;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">border</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">=&#8221;0&#8243;&gt;<br />
&lt;</span><span style="font-size:7pt;color:#a31515;font-family:'Georgia','serif';">tr</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">&gt;<br />
&lt;</span><span style="font-size:7pt;color:#a31515;font-family:'Georgia','serif';">td</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">&gt;<br />
&lt;</span><span style="font-size:7pt;color:#a31515;font-family:'Georgia','serif';">div</span><span style="font-size:7pt;color:#999999;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">class</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">=&#8221;lookup&#8221;</span><span style="font-size:7pt;color:#999999;font-family:'Georgia','serif';">  </span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">id</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">=&#8221;LookupText&#8221;</span><span style="font-size:7pt;color:#999999;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">runat</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">=&#8221;server&#8221;&gt;&lt;/</span><span style="font-size:7pt;color:#a31515;font-family:'Georgia','serif';">div</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">&gt;<br />
&lt;/</span><span style="font-size:7pt;color:#a31515;font-family:'Georgia','serif';">td</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">&gt;<br />
&lt;</span><span style="font-size:7pt;color:#a31515;font-family:'Georgia','serif';">td</span><span style="font-size:7pt;color:#999999;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">style</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">=&#8221;</span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">width</span><span style="font-size:7pt;color:#999999;font-family:'Georgia','serif';">:</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">2px&#8221;&gt;&lt;/</span><span style="font-size:7pt;color:#a31515;font-family:'Georgia','serif';">td</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">&gt;<br />
&lt;</span><span style="font-size:7pt;color:#a31515;font-family:'Georgia','serif';">td</span><span style="font-size:7pt;color:#999999;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">style</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">=&#8221;</span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">width</span><span style="font-size:7pt;color:#999999;font-family:'Georgia','serif';">:</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">21&#8243;&gt;<br />
&lt;</span><span style="font-size:7pt;color:#a31515;font-family:'Georgia','serif';">img</span><span style="font-size:7pt;color:#999999;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">alt</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">=&#8221;look up&#8221;</span><span style="font-size:7pt;color:#999999;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">src</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">=&#8221;../images/lookup.gif&#8221;</span><span style="font-size:7pt;color:#999999;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">runat</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">=&#8221;server&#8221;</span><span style="font-size:7pt;color:#999999;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">id</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">=&#8221;imgLookup&#8221;/&gt;<br />
&lt;/</span><span style="font-size:7pt;color:#a31515;font-family:'Georgia','serif';">td</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">&gt;<br />
&lt;/</span><span style="font-size:7pt;color:#a31515;font-family:'Georgia','serif';">tr</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">&gt;<br />
&lt;/</span><span style="font-size:7pt;color:#a31515;font-family:'Georgia','serif';">table</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">&gt;</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">&lt;</span><span style="font-size:7pt;color:#a31515;font-family:'Georgia','serif';">input</span><span style="font-size:7pt;color:black;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">type</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">=&#8221;hidden&#8221;</span><span style="font-size:7pt;color:black;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">runat</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">=&#8221;server&#8221;</span><span style="font-size:7pt;color:black;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">id</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">=&#8221;hdnEntityId&#8221;</span><span style="font-size:7pt;color:black;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">/&gt;<br />
&lt;</span><span style="font-size:7pt;color:#a31515;font-family:'Georgia','serif';">input</span><span style="font-size:7pt;color:black;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">type</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">=&#8221;hidden&#8221;</span><span style="font-size:7pt;color:black;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">runat</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">=&#8221;server&#8221;</span><span style="font-size:7pt;color:black;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:red;font-family:'Georgia','serif';">id</span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">=&#8221;hdnEntityName&#8221;</span><span style="font-size:7pt;color:black;font-family:'Georgia','serif';"> </span><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';">/&gt;</span></p>
<p><span style="font-size:7pt;color:blue;font-family:'Georgia','serif';"></span></p>
<p><b><span style="font-size:12pt;font-family:'Cambria','serif';"></span></b><strong><span style="font-weight:normal;font-size:12pt;font-family:'Cambria','serif';"><strong><span style="font-family:'Georgia','serif';">2. Javascript file</span></strong></span></strong></p>
<p><strong><span style="font-weight:normal;font-size:12pt;font-family:'Cambria','serif';"><span style="font-family:'Georgia','serif';"><font size="2" color="#008000"><strong>// JScript File</strong></font></span></span></strong><strong><span style="font-weight:normal;font-size:12pt;font-family:'Cambria','serif';"><span style="font-family:'Georgia','serif';"><font size="2" color="#008000"><font size="2" color="#0000ff">function</font><font size="2"> LookupArgsClass()</font><font size="2">{</font></font></span></span></strong><strong><span style="font-weight:normal;font-size:12pt;font-family:'Cambria','serif';"><span style="font-family:'Georgia','serif';"><font size="2" color="#008000"><font size="2" color="#0000ff">this</font><font size="2">.items = </font><font size="2" color="#0000ff">null</font><font size="2">;</font><font size="2">}</font><font size="2"><font size="2" color="#0000ff">function</font><font size="2"> SetRegardingValues(entityCode,divId,hdnId)</font><font size="2">{</font></font></p>
<p></font><font size="2" color="#0000ff">var</font><font size="2"> serverURL = document.getElementById(</font><font size="2" color="#a31515">&#8220;hdnServerName&#8221;</font><font size="2">).value;</font><font size="2"></font><font size="2" color="#0000ff">var</font><font size="2"> sPath= serverURL + </font><font size="2" color="#a31515">&#8216;/_controls/lookup/lookupsingle.aspx?class=BasicOwner&amp;objecttypes=&#8217;</font><font size="2">+entityCode+</font><font size="2" color="#a31515">&#8216;&amp;browse=0&amp;DefaultType=0&#8242;</font><font size="2"> </font><font size="2"><font size="2" color="#0000ff">var</font><font size="2"> left = (screen.width/4);</font></font><font size="2"></font><font size="2" color="#0000ff">var</font><font size="2"> top = (screen.height/5);</font><font size="2"> </font><font size="2" color="#0000ff">if</font><font size="2">(entityCode == </font><font size="2" color="#a31515">&#8220;1&#8243;</font><font size="2"> || entityCode == </font><font size="2" color="#a31515">&#8220;2&#8243;</font><font size="2"> || entityCode == </font><font size="2" color="#a31515">&#8220;10012&#8243;</font><font size="2">)</font><font size="2">{</font><font size="2"><font size="2" color="#008000">//sPath= serverURL + &#8216;/_controls/lookup/lookupsingle.aspx?class=null&amp;objecttypes=1&amp;browse=0&amp;DefaultType=0&#8242; </font></font><font size="2"><font size="2">sPath= serverURL + </font><font size="2" color="#a31515">&#8216;/_controls/lookup/lookupsingle.aspx?class=null&amp;objecttypes=&#8217;</font><font size="2">+entityCode+</font><font size="2" color="#a31515">&#8216;&amp;browse=0&amp;DefaultType=0&#8242;</font><font size="2"> </font><font size="2">}</font></p>
<p></font><font size="2" color="#0000ff">else</font><font size="2"> </font><font size="2" color="#0000ff">if</font><font size="2">(entityCode == 8)</font><font size="2">{</font><font size="2">sPath= serverURL + <font size="2" color="#a31515">&#8216;/_controls/lookup/lookupsingle.aspx?class=BasicOwner&amp;objecttypes=8&amp;browse=0&amp;DefaultType=0&#8242;</font><font size="2"> </font><font size="2">}</font></font><font size="2"><font size="2" color="#0000ff">var</font><font size="2"> args = </font><font size="2" color="#0000ff">new</font><font size="2"> LookupArgsClass();</font><font size="2"> args.items = document.getElementsByTagName(</font><font size="2" color="#a31515">&#8220;SPAN&#8221;</font><font size="2">);</font><font size="2"><font size="2" color="#0000ff">var</font><font size="2"> sCustomWinParams = </font><font size="2" color="#a31515">&#8220;dialogWidth:600px0px;dialogHeight:488px;dialogLeft=&#8221;</font><font size="2">+left+</font><font size="2" color="#a31515">&#8220;px;dialogTop=&#8221;</font><font size="2">+top+</font><font size="2" color="#a31515">&#8220;px;help:0;status:1;scroll:0;center:1;resizable:yes;&#8221;</font></font><font size="2"></font><font size="2"></font><font size="2" color="#0000ff">var</font><font size="2"> objlookup = window.showModalDialog(sPath,args,sCustomWinParams);</font><font size="2"> </font><font size="2" color="#0000ff">if</font><font size="2">(objlookup != </font><font size="2" color="#0000ff">null</font><font size="2">)</font><font size="2">{</font><font size="2">document.getElementById(hdnId.id).value = objlookup.items[0].id;document.getElementById(divId.id).innerHTML = </font></p>
<p></font><font size="2" color="#a31515">&#8220;  &lt;a href=&#8217;#'&gt;&#8221;</font><font size="2"> + objlookup.items[0].name + </font><font size="2" color="#a31515">&#8220;&lt;/a&gt;&#8221;</font><font size="2">; </font><font size="2">}</font><font size="2">}</font><font size="2"><font size="2" color="#0000ff">function</font><font size="2"> OpenUserEditDialogue(entityCode,divId,hdnId)</font><font size="2">{</font></p>
<p></font><font size="2" color="#0000ff">if</font><font size="2">(document.getElementById(hdnId.id).value == </font><font size="2" color="#a31515">&#8220;&#8221;</font><font size="2">)</font><font size="2">{</font><font size="2"><font size="2" color="#0000ff">return</font><font size="2"> </font><font size="2" color="#0000ff">false</font><font size="2">;</font><font size="2">}</font></font><font size="2"></font><font size="2" color="#0000ff">var</font><font size="2"> serverURL = document.getElementById(</font><font size="2" color="#a31515">&#8220;hdnServerName&#8221;</font><font size="2">).value;</font><font size="2"> </font><font size="2" color="#0000ff">var</font><font size="2"> left = (screen.width/4);</font><font size="2"></font><font size="2" color="#0000ff">var</font><font size="2"> top = (screen.height/5);</font><font size="2"><font size="2" color="#0000ff">var</font><font size="2"> sPath= serverURL+ </font><font size="2" color="#a31515">&#8220;/sfa/accts/edit.aspx?id=&#8221;</font><font size="2"> + document.getElementById(hdnId.id).value;<font size="2" color="#0000ff">var</font><font size="2"> sCustomWinParams = </font><font size="2" color="#a31515">&#8220;dialogWidth:930px0px;dialogHeight:675px;dialogLeft=&#8221;</font><font size="2">+left+</font><font size="2" color="#a31515">&#8220;px;dialogTop=&#8221;</font><font size="2">+top+</font><font size="2" color="#a31515">&#8220;px;help:0;status:1;scroll:0;center:1;resizable:yes;&#8221;</font></font></font><font size="2"><font size="2"></font></font><font size="2"></font><font size="2" color="#0000ff">if</font><font size="2">(entityCode == </font><font size="2" color="#a31515">&#8220;10001&#8243;</font><font size="2">)</font><font size="2">{</font><font size="2">sPath= serverURL + <font size="2" color="#a31515">&#8216;/_controls/lookup/lookupsingle.aspx?class=BasicOwner&amp;objecttypes=&#8217;</font><font size="2">+entityCode+</font><font size="2" color="#a31515">&#8216;&amp;browse=0&amp;DefaultType=0&#8242;</font></font><font size="2"><font size="2">sCustomWinParams = <font size="2" color="#a31515">&#8220;dialogWidth:600px0px;dialogHeight:488px;dialogLeft=&#8221;</font><font size="2">+left+</font><font size="2" color="#a31515">&#8220;px;dialogTop=&#8221;</font><font size="2">+top+</font><font size="2" color="#a31515">&#8220;px;help:0;status:1;scroll:0;center:1;resizable:yes;&#8221;</font></font></p>
<p></font><font size="2">}</font><font size="2"></font><font size="2" color="#0000ff">if</font><font size="2">(entityCode == </font><font size="2" color="#a31515">&#8220;8&#8243;</font><font size="2">)</font><font size="2">{</font><font size="2">sPath= serverURL + <font size="2" color="#a31515">&#8216;/_controls/lookup/lookupsingle.aspx?class=BasicOwner&amp;objecttypes=8&amp;browse=0&amp;DefaultType=0&#8242;</font></font><font size="2"><font size="2">sCustomWinParams = <font size="2" color="#a31515">&#8220;dialogWidth:831px0px;dialogHeight:641px;dialogLeft=&#8221;</font><font size="2">+left+</font><font size="2" color="#a31515">&#8220;px;dialogTop=&#8221;</font><font size="2">+top+</font><font size="2" color="#a31515">&#8220;px;help:0;status:1;scroll:0;center:1;resizable:yes;&#8221;</font></font></p>
<p></font><font size="2">}</font><font size="2"></font><font size="2" color="#0000ff">else</font><font size="2"> </font><font size="2" color="#0000ff">if</font><font size="2">(entityCode == </font><font size="2" color="#a31515">&#8220;10012&#8243;</font><font size="2">)</font><font size="2">{</font><font size="2">spath = serverURL + <font size="2" color="#a31515">&#8220;_controls/lookup/lookupsingle.aspx?class=null&amp;objecttypes=10012&amp;browse=0&amp;DefaultType=0&#8243;</font></font><font size="2"><font size="2">sCustomWinParams = <font size="2" color="#a31515">&#8220;dialogWidth:1012px;dialogHeight:642px;dialogLeft=&#8221;</font><font size="2">+left+</font><font size="2" color="#a31515">&#8220;px;dialogTop=&#8221;</font><font size="2">+top+</font><font size="2" color="#a31515">&#8220;px;help:0;status:1;scroll:0;center:1;resizable:yes;&#8221;</font></font></p>
<p><font size="2">}</font><font size="2"><font size="2" color="#0000ff">else</font><font size="2"> </font><font size="2" color="#0000ff">if</font><font size="2">(entityCode == </font><font size="2" color="#a31515">&#8220;2&#8243;</font><font size="2">)</font><font size="2">{spath = serverURL + </font></font></p>
<p></font><font size="2" color="#a31515">&#8220;_controls/lookup/lookupsingle.aspx?class=null&amp;objecttypes=2&amp;browse=0&amp;DefaultType=0&#8243;</font><font size="2"> </font><font size="2">}</font><font size="2"></font><font size="2" color="#0000ff">var</font><font size="2"> args = </font><font size="2" color="#0000ff">new</font><font size="2"> LookupArgsClass(); </font><font size="2"></font><font size="2" color="#0000ff">var</font><font size="2"> objlookup = window.showModalDialog(sPath,args,sCustomWinParams);</font><font size="2"></font><font size="2" color="#0000ff">if</font><font size="2">(objlookup != </font><font size="2" color="#0000ff">null</font><font size="2">)</font><font size="2">{</font><font size="2">document.getElementById(hdnId.id).value = objlookup.items[0].id;</font><font size="2">document.getElementById(divId.id).innerHTML = <font size="2" color="#a31515">&#8220;  &lt;a href=&#8217;#'&gt;&#8221;</font><font size="2"> + objlookup.items[0].name + </font><font size="2" color="#a31515">&#8220;&lt;/a&gt;&#8221;</font><font size="2">;</font><font size="2">}</font><font size="2">}</font></p>
<p></font><font size="2" color="#0000ff">function</font><font size="2"> CloseWindow()</font><font size="2">{</font><font size="2">window.close();</font><font size="2"><font size="2" color="#0000ff">return</font><font size="2"> </font><font size="2" color="#0000ff">false</font><font size="2">;</font><font size="2">}</font></p>
<p></font><font size="2" color="#0000ff">function</font><font size="2"> ChangeStyle(divId,mouseOver)</font><font size="2">{</font><font size="2"><font size="2" color="#0000ff">if</font><font size="2">(mouseOver)</font><font size="2">{document.getElementById(divId.id).className = </font></font><font size="2"><font size="2" color="#a31515">&#8220;lookupHover&#8221;</font><font size="2">;</font><font size="2">}</font><font size="2"><font size="2" color="#0000ff">else</font></font></p>
<p></font><font size="2">{</font><font size="2">document.getElementById(divId.id).className = </font><font size="2" color="#a31515">&#8220;lookup&#8221;</font><font size="2">;</font><font size="2">}</font><font size="2">}</font><font size="2"><strong><span style="font-weight:normal;font-size:12pt;font-family:'Cambria','serif';"><strong><span style="font-family:'Georgia','serif';">3. CodeBehind file</span></strong></span></strong></p>
<p></font></span></span></strong><strong><span style="font-weight:normal;font-size:12pt;font-family:'Cambria','serif';"><span style="font-family:'Georgia','serif';"><font size="2" color="#0000ff">using<font size="2"> System;</font></font></span></span></strong><strong><span style="font-weight:normal;font-size:12pt;font-family:'Cambria','serif';"><span style="font-family:'Georgia','serif';"><font size="2" color="#0000ff"><font size="2" color="#0000ff">using<font size="2"> System.Data;</font></font></font></span></span></strong><strong><span style="font-weight:normal;font-size:12pt;font-family:'Cambria','serif';"><span style="font-family:'Georgia','serif';"><font size="2" color="#0000ff"><font size="2" color="#0000ff">using<font size="2"> System.Configuration;</font></font><font size="2" color="#0000ff"><font size="2" color="#0000ff">using<font size="2"> System.Collections;</font></font></font></p>
<p></font><font size="2" color="#0000ff">using<font size="2"> System.Web;</font></font><font size="2" color="#0000ff"><font size="2" color="#0000ff">using<font size="2"> System.Web.Security;</font></font></font><font size="2" color="#0000ff"><font size="2" color="#0000ff">using<font size="2"> System.Web.UI;</font></font><font size="2" color="#0000ff"><font size="2" color="#0000ff">using<font size="2"> System.Web.UI.WebControls;</font></font></font></p>
<p></font><font size="2" color="#0000ff">using<font size="2"> System.Web.UI.WebControls.WebParts;</font></font><font size="2" color="#0000ff"><font size="2" color="#0000ff">using<font size="2"> System.Web.UI.HtmlControls;</font></font></font><font size="2" color="#0000ff"><font size="2" color="#0000ff">using<font size="2"> System.Reflection;</font></font><font size="2" color="#0000ff"><font size="2" color="#0000ff">using<font size="2"> CRMUtils.CrmSdk;</font></font></font></p>
<p></font><font size="2" color="#0000ff">using<font size="2"> CRMBusinessEntities;</font></font><font size="2" color="#0000ff"><font size="2" color="#0000ff">using<font size="2"> CRMBusinessEntities.Operations;</font></font></font><font size="2" color="#0000ff"><font size="2" color="#0000ff">public</font><font size="2"> </font><font size="2" color="#0000ff">partial</font><font size="2"> </font><font size="2" color="#0000ff">class</font><font size="2"> </font><font size="2" color="#2b91af">usercontrols_usrCtlLookUp</font><font size="2"> : System.Web.UI.UserControl,IWebUserControl</font><font size="2">{</font><font size="2"><font size="2" color="#0000ff">public</font><font size="2"> </font><font size="2" color="#0000ff">void</font><font size="2"> LoadUserControl(</font><font size="2" color="#2b91af">Guid</font><font size="2"> id)</font><font size="2">{</font></font></p>
<p></font><font size="2" color="#0000ff">if</font><font size="2"> (id == </font><font size="2" color="#2b91af">Guid</font><font size="2">.Empty)</font><font size="2">{</font><font size="2">id = <font size="2" color="#0000ff">new</font><font size="2"> </font><font size="2" color="#2b91af">Guid</font><font size="2">(LookupEntityID);</font><font size="2">}</font></font><font size="2"></font><font size="2" color="#0000ff">else</font><font size="2"> </font><font size="2">{</font><font size="2">LookupEntityID = id.ToString();</font><font size="2">}</p>
<p><font size="2" color="#0000ff">string</font><font size="2"> name = </font><font size="2" color="#0000ff">string</font><font size="2">.Empty;</font><font size="2"></font><font size="2" color="#0000ff">if</font><font size="2">(LookupEntityName.Equals(EntityName.account.ToString()))</font><font size="2">{</font><font size="2">CRMAccount objAccount = <font size="2" color="#0000ff">new</font><font size="2"> CRMAccount();account accountBe = (account)objAccount.GetAccountById(id, </font></font></p>
<p></font><font size="2" color="#0000ff">new</font><font size="2"> </font><font size="2" color="#0000ff">string</font><font size="2">[] { </font><font size="2" color="#a31515">&#8220;accountid&#8221;</font><font size="2">, </font><font size="2" color="#a31515">&#8220;name&#8221;</font><font size="2"> });</font><font size="2">name = accountBe.name;</font><font size="2">}</font><font size="2"></font><font size="2" color="#0000ff">else</font><font size="2"> </font><font size="2" color="#0000ff">if</font><font size="2"> (LookupEntityName.Equals(EntityName.systemuser.ToString()))</font><font size="2">{</font><font size="2">CRMUser objSystemUser = </font><font size="2" color="#0000ff">new</font><font size="2"> CRMUser();</font><font size="2">systemuser systemuserBe = (systemuser)objSystemUser.GetSystemUserById(id, </font><font size="2" color="#0000ff">new</font><font size="2"> </font><font size="2" color="#0000ff">string</font><font size="2">[] { </font><font size="2" color="#a31515">&#8220;systemuserid&#8221;</font><font size="2">, </font><font size="2" color="#a31515">&#8220;fullname&#8221;</font><font size="2"> });</font><font size="2">name = systemuserBe.fullname;</font><font size="2">}</font><font size="2"><font size="2" color="#0000ff">else</font><font size="2"> </font><font size="2" color="#0000ff">if</font><font size="2"> (LookupEntityName.Equals(EntityName.new_hotel.ToString()))</font><font size="2">{CRMHotel objHotel = </font></p>
<p><font size="2" color="#0000ff">new</font><font size="2"> CRMHotel();</font><font size="2">new_hotel hotelBe = (new_hotel)objHotel.GetHotelByHotelID(id, </font><font size="2" color="#0000ff">new</font><font size="2"> </font><font size="2" color="#0000ff">string</font><font size="2">[] { </font><font size="2" color="#a31515">&#8220;new_hotelid&#8221;</font><font size="2">, </font><font size="2" color="#a31515">&#8220;new_hotelname&#8221;</font><font size="2"> });</font><font size="2">name = hotelBe.new_hotelname;</font><font size="2">}</font></p>
<p></font><font size="2" color="#0000ff">else</font><font size="2"> </font><font size="2" color="#0000ff">if</font><font size="2"> (LookupEntityName.Equals(EntityName.contact.ToString()))</font><font size="2">{</font><font size="2">CRMContact objContact = </font><font size="2" color="#0000ff">new</font><font size="2"> CRMContact();</font><font size="2">contact contactBe = (contact)objContact.GetContactById(id, </font><font size="2" color="#0000ff">new</font><font size="2"> </font><font size="2" color="#0000ff">string</font><font size="2">[] { </font><font size="2" color="#a31515">&#8220;contactid&#8221;</font><font size="2">, </font><font size="2" color="#a31515">&#8220;fullname&#8221;</font><font size="2"> });</font><font size="2">name = contactBe.fullname;</font><font size="2">}</font><font size="2"><font size="2" color="#0000ff">this</font><font size="2">.LookupText.InnerHtml = </font><font size="2" color="#a31515">&#8220;  &lt;a href=&#8217;#'&gt;&#8221;</font><font size="2"> + name + </font><font size="2" color="#a31515">&#8220;&lt;/a&gt;&#8221;</font><font size="2">;</font><font size="2">}</font></p>
<p></font><font size="2" color="#0000ff">public</font><font size="2"> </font><font size="2" color="#0000ff">void</font><font size="2"> UpdateUserControl()</font><font size="2">{</font><font size="2">}</font><font size="2"><font size="2" color="#0000ff">protected</font><font size="2"> </font><font size="2" color="#0000ff">void</font><font size="2"> Page_Load(</font><font size="2" color="#0000ff">object</font><font size="2"> sender, </font><font size="2" color="#2b91af">EventArgs</font><font size="2"> e)</font><font size="2">{</font><font size="2">CRMMetaData metaData = <font size="2" color="#0000ff">new</font><font size="2"> CRMMetaData();</font><font size="2"><font size="2" color="#0000ff">this</font><font size="2">.imgLookup.Attributes.Add(</font><font size="2" color="#a31515">&#8220;onclick&#8221;</font><font size="2">, </font><font size="2" color="#a31515">&#8220;return SetRegardingValues(&#8220;</font><font size="2"> + metaData.GetEnityTypeCode(LookupEntityName) + </font><font size="2" color="#a31515">&#8220;,&#8221;</font><font size="2"> + </font><font size="2" color="#0000ff">this</font><font size="2">.LookupText.ClientID.ToString() + </font><font size="2" color="#a31515">&#8220;,&#8221;</font><font size="2"> + </font><font size="2" color="#0000ff">this</font><font size="2">.hdnEntityId.ClientID.ToString() + </font><font size="2" color="#a31515">&#8220;);&#8221;</font><font size="2">);</font></font></font></p>
<p></font><font size="2" color="#0000ff">this</font><font size="2">.LookupText.Attributes.Add(</font><font size="2" color="#a31515">&#8220;onclick&#8221;</font><font size="2">, </font><font size="2" color="#a31515">&#8220;return OpenUserEditDialogue(&#8220;</font><font size="2"> + metaData.GetEnityTypeCode(LookupEntityName) + </font><font size="2" color="#a31515">&#8220;,&#8221;</font><font size="2"> + </font><font size="2" color="#0000ff">this</font><font size="2">.LookupText.ClientID.ToString() + </font><font size="2" color="#a31515">&#8220;,&#8221;</font><font size="2"> + </font><font size="2" color="#0000ff">this</font><font size="2">.hdnEntityId.ClientID.ToString() + </font><font size="2" color="#a31515">&#8220;);&#8221;</font><font size="2">);</font><font size="2"><font size="2" color="#0000ff">this</font><font size="2">.LookupText.Attributes.Add(</font><font size="2" color="#a31515">&#8220;onmouseover&#8221;</font><font size="2">, </font><font size="2" color="#a31515">&#8220;return ChangeStyle(&#8220;</font><font size="2">+ </font><font size="2" color="#0000ff">this</font><font size="2">.LookupText.ClientID.ToString() + </font><font size="2" color="#a31515">&#8220;,true);&#8221;</font><font size="2">);</font></font><font size="2"><font size="2" color="#0000ff">this</font><font size="2">.LookupText.Attributes.Add(</font><font size="2" color="#a31515">&#8220;onmouseover&#8221;</font><font size="2">, </font><font size="2" color="#a31515">&#8220;return ChangeStyle(&#8220;</font><font size="2"> + </font><font size="2" color="#0000ff">this</font><font size="2">.LookupText.ClientID.ToString() + </font><font size="2" color="#a31515">&#8220;,false);&#8221;</font><font size="2">); </font><font size="2">}</font></font><font size="2"><font size="2" color="#0000ff">public</font><font size="2"> </font><font size="2" color="#0000ff">string</font><font size="2"> LookupEntityID</font><font size="2">{</font><font size="2"><font size="2" color="#0000ff">get</font><font size="2"> </font><font size="2">{<font size="2" color="#0000ff">return</font><font size="2"> hdnEntityId.Value;}<font size="2" color="#0000ff">set</font></font></font></font></p>
<p></font><font size="2">{</font><font size="2">hdnEntityId.Value = <font size="2" color="#0000ff">value</font><font size="2">;</font><font size="2"></font><font size="2" color="#0000ff">if</font><font size="2"> (</font><font size="2" color="#0000ff">value</font><font size="2"> == </font><font size="2" color="#0000ff">string</font><font size="2">.Empty)</font><font size="2">{LookupText.InnerHtml = </font></font><font size="2"></font><font size="2" color="#a31515">&#8220;&#8221;</font><font size="2">;</font><font size="2">}</font><font size="2">}</font><font size="2">}</p>
<p><font size="2" color="#0000ff">public</font><font size="2"> </font><font size="2" color="#0000ff">string</font><font size="2"> LookupEntityName</font><font size="2">{</font><font size="2"><font size="2" color="#0000ff">get</font></font></p>
<p></font><font size="2">{</font><font size="2" color="#0000ff">return</font><font size="2"> hdnEntityName.Value;}</font><font size="2"><font size="2" color="#0000ff">set</font></font><font size="2"></font><font size="2">{hdnEntityName.Value = </font><font size="2" color="#0000ff">value</font><font size="2">;}</font><font size="2">}</font><font size="2">}</font><font size="2"><strong><span style="font-weight:normal;font-size:12pt;font-family:'Cambria','serif';"><strong><span style="font-family:'Georgia','serif';"></span></strong></span></strong></p>
<p><strong><span style="font-weight:normal;font-size:12pt;font-family:'Cambria','serif';"><strong><span style="font-family:'Georgia','serif';"></span></strong></span></strong><strong><span style="font-weight:normal;font-size:12pt;font-family:'Cambria','serif';"><span style="font-size:10pt;font-family:'Courier New';"> </span><span style="font-size:10pt;font-family:'Courier New';"><strong><span style="font-family:'Georgia','serif';"><font size="3">4. CSS File (style sheet)</font></span></strong></span></span></strong></p>
<p></font></span></span></strong><strong><span style="font-weight:normal;font-size:12pt;font-family:'Cambria','serif';"><span style="font-size:10pt;font-family:'Courier New';"><strong><span style="font-family:'Georgia','serif';"></span></strong><span style="font-size:10pt;color:#a31515;font-family:'Courier New';">.lookup</span><span style="font-size:10pt;font-family:'Courier New';">{</span><span style="font-size:10pt;font-family:'Courier New';"><span>    </span></span></span></span></strong></p>
<p><strong><span style="font-weight:normal;font-size:12pt;font-family:'Cambria','serif';"><span style="font-size:10pt;font-family:'Courier New';"><span style="font-size:10pt;font-family:'Courier New';"><span>  </span><span style="color:red;">border-right</span>: <span style="color:blue;">#7b9ebd</span> <span style="color:blue;">1px</span> <span style="color:blue;">solid</span>; </span><span style="font-size:10pt;font-family:'Courier New';"><span>      </span><span style="color:red;">border-top</span>: <span style="color:blue;">#7b9ebd</span> <span style="color:blue;">1px</span> <span style="color:blue;">solid</span>; </span><span style="font-size:10pt;font-family:'Courier New';"><span>      </span><span style="color:red;">border-left</span>: <span style="color:blue;">#7b9ebd</span> <span style="color:blue;">1px</span> <span style="color:blue;">solid</span>; </span><span style="font-size:10pt;font-family:'Courier New';"><span>      </span><span style="color:red;">width</span>: <span style="color:blue;">97%</span>; </span><span style="font-size:10pt;font-family:'Courier New';"><span>      </span><span style="color:red;">border-bottom</span>: <span style="color:blue;">#7b9ebd</span> <span style="color:blue;">1px</span> <span style="color:blue;">solid</span>; </span><span style="font-size:10pt;font-family:'Courier New';"><span>      </span><span style="color:red;">height</span>: <span style="color:blue;">18px</span>;</span><span style="font-size:10pt;font-family:'Courier New';"><span>      </span><span style="color:red;">background-color</span>:<span style="color:blue;">White</span>;</span><span style="font-size:10pt;font-family:'Courier New';"><span>      </span></span><span style="font-size:10pt;font-family:'Courier New';"><span>      </span></span></span></span></strong></p>
<p><strong><span style="font-weight:normal;font-size:12pt;font-family:'Cambria','serif';"><span style="font-size:10pt;font-family:'Courier New';"><span style="font-size:10pt;font-family:'Courier New';"><span></span></span><span style="font-size:10pt;font-family:'Courier New';">}</span><span style="font-size:10pt;font-family:'Courier New';"> </span></span></span></strong></p>
<p><strong><span style="font-weight:normal;font-size:12pt;font-family:'Cambria','serif';"><span style="font-size:10pt;font-family:'Courier New';"><span style="font-size:10pt;font-family:'Courier New';"></span></span></span></strong></p>
<p><strong><span style="font-weight:normal;font-size:12pt;font-family:'Cambria','serif';"><span style="font-size:10pt;font-family:'Courier New';"><span style="font-size:10pt;font-family:'Courier New';"></span><span style="font-size:10pt;color:#a31515;font-family:'Courier New';">.lookupHover</span><span style="font-size:10pt;font-family:'Courier New';">{</span><span style="font-size:10pt;font-family:'Courier New';"><span> </span></span></span></span></strong></p>
<p><strong><span style="font-weight:normal;font-size:12pt;font-family:'Cambria','serif';"><span style="font-size:10pt;font-family:'Courier New';"><span style="font-size:10pt;font-family:'Courier New';"><span>     </span><span style="color:red;">border-right</span>: <span style="color:blue;">#7b9ebd</span> <span style="color:blue;">1px</span> <span style="color:blue;">solid</span>; </span><span style="font-size:10pt;font-family:'Courier New';"><span>      </span><span style="color:red;">border-top</span>: <span style="color:blue;">#7b9ebd</span> <span style="color:blue;">1px</span> <span style="color:blue;">solid</span>; </span><span style="font-size:10pt;font-family:'Courier New';"><span>      </span><span style="color:red;">border-left</span>: <span style="color:blue;">#7b9ebd</span> <span style="color:blue;">1px</span> <span style="color:blue;">solid</span>; </span><span style="font-size:10pt;font-family:'Courier New';"><span>      </span><span style="color:red;">width</span>: <span style="color:blue;">97%</span>; </span><span style="font-size:10pt;font-family:'Courier New';"><span>      </span><span style="color:red;">border-bottom</span>: <span style="color:blue;">#7b9ebd</span> <span style="color:blue;">1px</span> <span style="color:blue;">solid</span>; </span><span style="font-size:10pt;font-family:'Courier New';"><span>      </span><span style="color:red;">height</span>: <span style="color:blue;">18px</span>;</span><span style="font-size:10pt;font-family:'Courier New';"><span>      </span><span style="color:red;">background-color</span>:<span style="color:blue;">#ADC3E7</span>;<br />
}</span></span><span style="font-size:10pt;font-family:'Courier New';"> </span></span></strong><strong><span style="font-weight:normal;font-size:12pt;font-family:'Cambria','serif';"><span style="font-size:10pt;font-family:'Courier New';"></span></span></strong><strong><span style="font-weight:normal;font-size:12pt;font-family:'Cambria','serif';"><span style="font-size:10pt;font-family:'Courier New';"></span></span></strong><strong><span style="font-weight:normal;font-size:12pt;font-family:'Cambria','serif';"><span style="font-size:10pt;font-family:'Courier New';"></p>
<p style="margin-bottom:0;line-height:15.6pt;">&nbsp;</p>
<p><strong><span style="font-size:12pt;font-family:'Georgia','serif';">5. Page or control (on which lookup control resides)</span></strong><strong><span style="font-weight:normal;font-size:10pt;font-family:'Courier New';"></span></strong><span style="font-size:10pt;color:blue;font-family:'Courier New';"> </span></p>
<p><span style="font-size:10pt;color:blue;font-family:'Courier New';"></span><span style="font-size:10pt;color:blue;font-family:'Courier New';">protected</span><span style="font-size:10pt;font-family:'Courier New';"> <span style="color:blue;">void</span> Page_Load(<span style="color:blue;">object</span> sender, <span style="color:#2b91af;">EventArgs</span> e)</span><span style="font-size:10pt;font-family:'Courier New';"><span> </span></span></p>
<p><span style="font-size:10pt;font-family:'Courier New';"><span>   </span>{</span></p>
<p><span style="font-size:10pt;font-family:'Courier New';"></span><span style="font-size:10pt;font-family:'Courier New';">//just set the entity name for the lookup control</span><span style="font-size:10pt;font-family:'Courier New';"><span>       </span></span></p>
<p><span style="font-size:10pt;font-family:'Courier New';"><span> </span>uclookUpControl.LookupEntityName = EntityName.account.ToString();</span><span style="font-size:10pt;font-family:'Courier New';"><span> </span></span></p>
<p><span style="font-size:10pt;font-family:'Courier New';"><span>   </span>}</span><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p><span style="font-size:10pt;font-family:'Courier New';"></span><span style="font-size:10pt;font-family:'Courier New';">/*call the following function from anywhere in the container control (e.g on which you have draged and dropd the lookup control) to get the entity name populated, do not pass guid.Empty, but pass the entity ID here so that it could load the entity name, if you pass it empty, then you have to set the “LookupEntityID” property of the lookup control to the entity ID you want it to populate with */</span><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p><span style="font-size:10pt;font-family:'Courier New';"></span><span style="font-size:10pt;font-family:'Courier New';">uclookUpControl.LoadUserControl(<span style="color:#2b91af;">Guid</span>.Empty);</span><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p><span style="font-size:10pt;font-family:'Courier New';"></span><span style="font-size:10pt;font-family:'Courier New';"> </span><span style="font-size:10pt;font-family:'Courier New';">======================================================================</span></p>
<p><span style="font-size:10pt;font-family:'Courier New';"></span><span style="font-size:12pt;font-family:'Cambria','serif';"> </span><span style="font-size:12pt;font-family:'Cambria','serif';">if you feel anything unclear, you can always send me an email at <b><span style="color:red;"><a href="mailto:irfanyar@gmail.com">irfanyar@gmail.com</a></span></b></span><b><span style="font-size:12pt;color:red;font-family:'Cambria','serif';"> </span></b></p>
<p><b><span style="font-size:12pt;color:red;font-family:'Cambria','serif';"></span></b><b><span style="font-size:12pt;font-family:'Cambria','serif';">===========================================================</span></b><strong><span style="font-weight:normal;font-size:12pt;font-family:'Cambria','serif';"></span></strong></p>
<p style="margin-bottom:0;line-height:15.6pt;">&nbsp;</p>
<p><span style="font-size:15pt;font-family:'Courier New';"> </span><strong><span style="font-size:17pt;font-family:'Georgia','serif';"> </span></strong></p>
<p></span></span></strong></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/irfanyar.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/irfanyar.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/irfanyar.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/irfanyar.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/irfanyar.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/irfanyar.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/irfanyar.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/irfanyar.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/irfanyar.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/irfanyar.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/irfanyar.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/irfanyar.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/irfanyar.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/irfanyar.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/irfanyar.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/irfanyar.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=irfanyar.wordpress.com&amp;blog=2594290&amp;post=3&amp;subd=irfanyar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://irfanyar.wordpress.com/2008/01/23/custom-lookup-control-for-mscrm-30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ac55a3929c6d61c27d93e0cf7d47d521?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">irfanyar</media:title>
		</media:content>
	</item>
	</channel>
</rss>
