<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-954885857108135149</id><updated>2011-12-18T12:36:18.511-08:00</updated><category term='Utility'/><category term='IPhone'/><category term='PowerShell'/><category term='Closure'/><category term='Wcf'/><category term='Agile'/><category term='Javascript'/><category term='Validation'/><category term='UnitTesting'/><category term='Scrum'/><category term='Design Pattern'/><category term='Debugging'/><category term='Tools'/><category term='Authentication'/><category term='Ajax'/><category term='windbg'/><title type='text'>Technology =&gt; Technical babbling</title><subtitle type='html'>Dont judge those who try and fail, judge those who fail to try!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>51</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-419465247917280766</id><published>2011-11-24T19:25:00.000-08:00</published><updated>2011-11-24T19:30:52.472-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Debugging'/><title type='text'>Debugging Tips and Tricks</title><content type='html'>1) Its been a while, since I last wrote. Today, I want to write about Debugging. I enjoy debugging and love to spend time in code, figuring out how stuff works. This is not a new trick, lot of people might be already using it, but I recently used this, so I thought of writing about it.&lt;br /&gt;&lt;br /&gt;When you have a web application which is communicating with other services using WCF or&amp;nbsp; REST or using WebRequest. Sometimes its hard to debug some scenarios where, you are not getting much help from the EventLogging.&lt;br /&gt;&lt;br /&gt;In such scenarios, you might want to see what is happening on the server when these calls are made or what was the request/response you received from other services.&amp;nbsp; You can use FIDDLER in such scenarios, and route all the calls through Fiddler, since Fiddler acts as a proxy. Once you set the proxy to fiddler, you can open fiddler on the server and see all the calls that are being made from your webapplication. Fiddler by default listens at port 8888 or you can change that in fiddler options.&lt;br /&gt;&lt;br /&gt;For this to work, you need to add following entry in Web.Config file&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-Hsf-qM2NRcs/Ts8LxVvMSMI/AAAAAAAAAOg/J7ARSCIZY7Q/s1600/Capture.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="92" src="http://1.bp.blogspot.com/-Hsf-qM2NRcs/Ts8LxVvMSMI/AAAAAAAAAOg/J7ARSCIZY7Q/s640/Capture.PNG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;2) This is not a debugging tip but I was recently debugging some issue at work and wanted to open one of the dll's in reflector, on the Test sever which was installed in GAC.&lt;br /&gt;&lt;br /&gt;When you open the assembly folder, it doesnt give you an option to download or look at the dll. One way to get the DLL from GAC&amp;nbsp; is to open the folder in command prompt, then you can see that inside the assembly folder, there are couple of folders&lt;br /&gt;&lt;br /&gt;\assembly &lt;br /&gt;&amp;nbsp;&amp;nbsp; \GAC_32&lt;br /&gt;&amp;nbsp;&amp;nbsp; \GAC_MSIL&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; etc&lt;br /&gt;&lt;br /&gt;Inside these folder you can find the dll you are looking for by appropriate name/version.&lt;br /&gt;&lt;br /&gt;-Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-419465247917280766?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/419465247917280766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=419465247917280766' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/419465247917280766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/419465247917280766'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2011/11/debugging-tips-and-tricks.html' title='Debugging Tips and Tricks'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-Hsf-qM2NRcs/Ts8LxVvMSMI/AAAAAAAAAOg/J7ARSCIZY7Q/s72-c/Capture.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-6586377080606419545</id><published>2011-04-10T11:52:00.000-07:00</published><updated>2011-05-13T12:53:15.834-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IPhone'/><title type='text'>First blog entry from my IPhone!!</title><content type='html'>This is my first blogging entry from my iPhone. I am super excited about my IPhone. I love it&amp;nbsp;, its a programmers playfield!&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-6586377080606419545?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/6586377080606419545/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=6586377080606419545' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/6586377080606419545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/6586377080606419545'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2011/04/first-blog-entry-from-my-iphone.html' title='First blog entry from my IPhone!!'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-8248266765816129109</id><published>2010-11-25T15:34:00.000-08:00</published><updated>2010-11-26T14:06:16.567-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scrum'/><category scheme='http://www.blogger.com/atom/ns#' term='Agile'/><title type='text'>Agile Development</title><content type='html'>Last couple of years I have been working on a project where we use Agile Methodology for software development. It was a great learning experience for me to move from the WaterFall Model to Scrum Model.&lt;br /&gt;&lt;br /&gt;Team Foundation Server(TFS)&amp;nbsp;provides out of the box support for project management and for practicing Agile Methodology for software development. TFS is a great tool not just for source control but also has so many features geared towards agile software development.&amp;nbsp;The basic idea behind following agile development is that, you divide a big chuck of work into small pieces and then decide which pieces are high priority and take that work and deliver it end to end at the end of each sprint. With this kind of approach you have&amp;nbsp;something ready by the end of few sprints and&amp;nbsp;if you feel&amp;nbsp;like&amp;nbsp;there are design flaws you can catch those early in the development cycle.&lt;br /&gt;&lt;br /&gt;The way we used to practice Agile Development was, we broke the whole team into 2-3 smaller teams with one team consisting of 2-3 devs, 2-3 testers and 1 Project Manager. Generally project managers meet before the sprint starts and decides the priority of the&amp;nbsp; Product Backlog Items(PBI). Project Manager tries to make sure as much as possible that the PBI's are clear and have a done criteria. i.e what is expected by the end of the sprint from that PBI. It is the responsibility of the team members (Dev's and Test)&amp;nbsp;to make sure that they have clear understanding of the PBI. Project Manager then hands over the list of PBI's to be completed in&amp;nbsp;that sprint to the Scrummaster. First day of the sprint, is the planning day where, &amp;nbsp;in the first session, Project Manager explains, the list of PBI's to the team and what is expected out of those PBI's.&lt;br /&gt;&lt;br /&gt;There is a storypoint assigned to each PBI and&amp;nbsp; the team members give there estimates for each PBI. Story Points are useful because after couple of sprints, you can calculate the velocity of the team. Story points are generally given as one of numbers in the Fibonacci series.&lt;br /&gt;&lt;br /&gt;Second part of the planning meeting is where, PBI is broken down into Sprint BackLog Items(SBI). These are the workitems that can be assigned or owned by the team members. Basically PBI is further broken down into small chuck of work. Team members give there estimates for each SBI. Generally work is broken down in such a way that no of hours required are less that 6-8 hours.&lt;br /&gt;&lt;br /&gt;Team has to commit that the work they take will be completed at the end of the sprint. After the planning meeting no new work is taken for that sprint. If&amp;nbsp; a team member gets blocked it the responsibility of the scrum master to unblock them. Daily standup meetings are done where team members&amp;nbsp;give there status to the whole team regarding what work was done and if they are blocked on anything.&lt;br /&gt;&lt;br /&gt;At the end of each&amp;nbsp;sprint there is a stakeholder demo meeting where the team presents&amp;nbsp; the work that was completed in the current sprint. Other advantage of this is, the other teams can get an idea of what work is happening. There is also a retrospection meeting which is conducted by the scrummaster to see how the process can be improved. Team members generally will give there opinions about what went well in that sprint, and what things can be done to improve the process.&lt;br /&gt;&lt;br /&gt;Like anything else in life, initially there is always some struggle/tough period, but once you get the hang of it, its very effective process. I love working in Agile teams! :) &lt;br /&gt;&lt;br /&gt;I hope this helps someone :).&lt;br /&gt;&lt;br /&gt;-Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-8248266765816129109?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/8248266765816129109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=8248266765816129109' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/8248266765816129109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/8248266765816129109'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2010/11/agile-development.html' title='Agile Development'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-4414436239438839185</id><published>2010-11-09T13:19:00.000-08:00</published><updated>2010-11-09T13:24:22.387-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UnitTesting'/><title type='text'>UnitTesting using Moq</title><content type='html'>I am a firm believer of writing unit test before you check in any code. Writing unit test and making sure that your code works as expected gives a lot more confidence in your code.&lt;br /&gt;&lt;br /&gt;One of the libraries that I use which makes my unit testing code easier to write is Mocking Framework like Moq. Moq is a cool library I love to use. The api that MOQ has are so easy to find out and understand what they actually do. I would recommend this framework to anyone who is starting doing Unit Tests.&lt;br /&gt;&lt;br /&gt;Some of the important things while writing code that you have to always keep in mind are:&lt;br /&gt;&lt;br /&gt;1) Open-Closed principle.. i.e open for extension closed for modification.&lt;br /&gt;2) Single Point of responsibility.&lt;br /&gt;3) Program to an interface and not to concrete classes.&lt;br /&gt;4) Prefer composition over inheritance. etc&lt;br /&gt;&lt;br /&gt;In this sample example I want to test the LibraryService Class which takes in 1 dependency - IDataService. The dependency is passed in through constructor injection. This is one was to inject the dependency, and the code is not tightly couple to a particular instance of the DataService. You can implement IDataService which gets the books from the DataBase or XmlFile or any other datasource.&lt;br /&gt;&lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;a href="http://2.bp.blogspot.com/_iUI-C9OjkTY/TNm2GY3KATI/AAAAAAAAANg/kvIwNN2NDKU/s1600/TestClass.JPG" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="393" px="true" src="http://2.bp.blogspot.com/_iUI-C9OjkTY/TNm2GY3KATI/AAAAAAAAANg/kvIwNN2NDKU/s640/TestClass.JPG" width="640" /&gt;&lt;/a&gt;Highlighted text shows the dependency. The simple task here to unit test the GetBook function. Using MOQ its so easy to test this function.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;a href="http://2.bp.blogspot.com/_iUI-C9OjkTY/TNm34P9Ru8I/AAAAAAAAANk/YMDwmlA3jzw/s1600/TestCase.JPG" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="379" px="true" src="http://2.bp.blogspot.com/_iUI-C9OjkTY/TNm34P9Ru8I/AAAAAAAAANk/YMDwmlA3jzw/s640/TestCase.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Here I am mocking an Instance of IDataService which I is the passed to the Library Service. Then I am setting the expectation by using the SetUp methof of MOQ. See the cool use of Lambda expression to find out the Method which we are setting expectation on.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;What this does is when the&amp;nbsp;GetBook function is called it will make a call to the GetBooks function and will return the books object (i.e the one that we set in the expectation). The actual call wont happen. This is really cool because then you can test each piece independently.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;One more important thing is the call to the Verify function on the moq. This will verify all the expectations that were set on the Mock object, in this case if the GetBooks function was call with the right parameters and was called once or not.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Moq is very powerful is very easy to use. It doesn't have a huge learning curve!&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;I Hope this helps someone :)&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Code: &lt;a href="http://cid-928a438e82450145.office.live.com/self.aspx/.Public/UnitTestingMVCBlogApplication.zip"&gt;Download!&lt;/a&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;-Yash&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-4414436239438839185?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/4414436239438839185/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=4414436239438839185' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/4414436239438839185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/4414436239438839185'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2010/11/unittesting-using-moq.html' title='UnitTesting using Moq'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_iUI-C9OjkTY/TNm2GY3KATI/AAAAAAAAANg/kvIwNN2NDKU/s72-c/TestClass.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-6272183674555113794</id><published>2010-08-12T18:24:00.000-07:00</published><updated>2010-08-12T18:26:20.219-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Authentication'/><category scheme='http://www.blogger.com/atom/ns#' term='Wcf'/><title type='text'>Setting up Client Certificate Authentication in WCF</title><content type='html'>Recently I had an opportunity to setup Client Cert Authentication for a WCF service I created. I think it would be good to share this info with others and also for my future reference.In WCF Message Level and Transport Level security can be used.&lt;br /&gt;&lt;br /&gt;In Client Certificate Authentication:&lt;br /&gt;&lt;br /&gt;1) Client has a .pfx cert file. They install the cert on their side using the .pfx file and password. &lt;br /&gt;2) Client provides the .cer file&amp;nbsp; to the Server team through some offline process (Read Email)&lt;br /&gt;3) Server team maps the certificate that client provided on their IIS server as a client certificate. This requires a windows account for mapping the certificate on the Server side in IIS. This change gets reflected in the ApplicationHost.config file.&lt;br /&gt;4) When Client makes the request, they need to find the certificate in their LocalStore and add that cert to the Http Request.&lt;br /&gt;5) When the request comes to the Server, it checks the certificate from the request and validates it with the one installed on the IIS by the server team, if both match then the request goes through.&lt;br /&gt;&lt;br /&gt;Steps for Configuring Client Cert Authentication--&lt;br /&gt;&lt;br /&gt;1) Enable Client Certificate Mapping Authentication using Role Services Wizard ( by adding role services).&lt;br /&gt;2) Open the .cer file in a notepad and copy the encoded text only.&lt;br /&gt;3) In IIS (inetmgr) map this cert to a windows account , this can be done using the Configuration Editor. Configuration Editor is a separate power pack install . Configuration Editor is basically a GUI which sits on top of ApplicationHost.config file. It allows you to modify the settings specified in this file.&lt;br /&gt;&lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;a href="http://4.bp.blogspot.com/_iUI-C9OjkTY/TGScueKgIfI/AAAAAAAAAMg/hSWXcy0OnM0/s1600/Capture.JPG" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="529" ox="true" src="http://4.bp.blogspot.com/_iUI-C9OjkTY/TGScueKgIfI/AAAAAAAAAMg/hSWXcy0OnM0/s640/Capture.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Once the cert is mapped in IIS, WCF service should use the Transport Level security mode.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Configuration looks similar to this:&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_iUI-C9OjkTY/TGSexyDcQQI/AAAAAAAAAMo/gsH8gpiS-NQ/s1600/Capture.JPG" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="120" ox="true" src="http://2.bp.blogspot.com/_iUI-C9OjkTY/TGSexyDcQQI/AAAAAAAAAMo/gsH8gpiS-NQ/s640/Capture.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;This is all you have to do expose a WCF service which uses Client Certificate Authentication.&lt;br /&gt;&lt;br /&gt;-Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-6272183674555113794?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/6272183674555113794/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=6272183674555113794' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/6272183674555113794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/6272183674555113794'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2010/08/setting-up-client-certificate.html' title='Setting up Client Certificate Authentication in WCF'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_iUI-C9OjkTY/TGScueKgIfI/AAAAAAAAAMg/hSWXcy0OnM0/s72-c/Capture.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-9121959672487040736</id><published>2010-08-01T15:09:00.000-07:00</published><updated>2010-08-01T15:18:24.042-07:00</updated><title type='text'>Fluent Api's</title><content type='html'>Today post is a very simple post about Fluent Apis/Fluent Interfaces. These days while developing apps, I am coming across lot of api's that are following Fluent Api style. For example lot of Entity framework api's.&lt;br /&gt;&lt;br /&gt;Fluent Api's is a way of expressing you api's in a chained fashion.&amp;nbsp; More like functional programming. Advantage are code becomes more readable and easier to understand.&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;Here in the Person class, I am setting the member varaibles like FirstName, LastName, Age in Fluent Apis. The idea here is to return the object after setting up the appropriate properties.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_iUI-C9OjkTY/TFXuEVPW9AI/AAAAAAAAAMM/PS9l_7ClPgo/s1600/FluentApi.PNG" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="173" src="http://3.bp.blogspot.com/_iUI-C9OjkTY/TFXuEVPW9AI/AAAAAAAAAMM/PS9l_7ClPgo/s400/FluentApi.PNG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;a href="http://2.bp.blogspot.com/_iUI-C9OjkTY/TFXuu-_nYQI/AAAAAAAAAMU/5JGS_DeNVUI/s1600/FluentApi2.PNG" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="33" src="http://2.bp.blogspot.com/_iUI-C9OjkTY/TFXuu-_nYQI/AAAAAAAAAMU/5JGS_DeNVUI/s640/FluentApi2.PNG" width="640" /&gt;&lt;/a&gt;This is a very basic example but this can be exdended to complex object in which processing is done in methods and they return the same object back, so that other methods/properties can be chained.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;a href="http://cid-928a438e82450145.office.live.com/embedicon.aspx/.Public/BExampleFluentApi%5E4s.zip"&gt;Download!&lt;/a&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;-Yashwant&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-9121959672487040736?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/9121959672487040736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=9121959672487040736' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/9121959672487040736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/9121959672487040736'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2010/08/fulent-apis.html' title='Fluent Api&apos;s'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_iUI-C9OjkTY/TFXuEVPW9AI/AAAAAAAAAMM/PS9l_7ClPgo/s72-c/FluentApi.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-1043415643346195775</id><published>2010-06-27T13:45:00.000-07:00</published><updated>2010-11-25T10:50:39.249-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PowerShell'/><title type='text'>My experiences with PowerShell</title><content type='html'>I was not&amp;nbsp;into&amp;nbsp;scripting before but when I started using powershell, I loved it so much that now I can't live without it :).Its simple yet so powerful and with 2.0 release it has become even more powerful with the addition of remote administration. &lt;br /&gt;&lt;br /&gt;PowerShell out of the box provides lot of CommandLets (cmdlets) which can executed to get the work done. PowerShell is built on top of .Net, so basically you can do anything you in it , that you can do in VisualStudio and it can hosted in different applications like WPF app, Windows Forms etc.&lt;br /&gt;&lt;br /&gt;Any data that can be modelled as hierarchical data or flat data, can be used with the general command lets that powershell provides.For Eg : Drives, Environment Variables, &lt;br /&gt;&lt;br /&gt;In this post I am going to just list the normal commandlets I use, later in next blogs I will show how to create CommandLets using c# code.&lt;br /&gt;&lt;br /&gt;Commandlets that I used often&lt;br /&gt;&lt;br /&gt;1) &lt;strong&gt;Get-Help&lt;/strong&gt; "CommandLet name"&amp;nbsp;&amp;nbsp; -- To get help about how to use the cmdlets, what parameter and arguments&lt;br /&gt;2) &lt;strong&gt;Get-Member&lt;/strong&gt; -InputObject&amp;nbsp; "Object"&lt;br /&gt;3) &lt;strong&gt;Copy-Item&lt;/strong&gt;&amp;nbsp; fromlocation tolocation &lt;br /&gt;4) &lt;strong&gt;Get-ChildItem&lt;/strong&gt; "Path"&amp;nbsp;&amp;nbsp;-recurse &amp;nbsp;-- this is very useful to get the child elements of a Hierarchical data eg : Certs,Registry etc&lt;br /&gt;5) &lt;strong&gt;Get-Process&lt;/strong&gt; &lt;br /&gt;6) &lt;strong&gt;Stop-Process&lt;/strong&gt; -whatif&lt;br /&gt;7) &lt;strong&gt;Get-Content&lt;/strong&gt; -- to read the contents and show it on the PowerShell Host&lt;br /&gt;8) &lt;strong&gt;Set-Content&lt;/strong&gt; -- to set some content back to the source&lt;br /&gt;9) &lt;strong&gt;Remove-Item&lt;/strong&gt; - to remove any item&lt;br /&gt;10) &lt;strong&gt;Get-WmiObject&lt;/strong&gt; "Win32_XXXX"&lt;br /&gt;11) &lt;strong&gt;Where-Object&lt;/strong&gt;&amp;nbsp; {"Expression"} -- From Filtering the output, you can pipe the output of different cmdlets and then filter the output by using Where-Object.&lt;br /&gt;12) &lt;strong&gt;Select -Object&lt;/strong&gt; {"Expression}&amp;nbsp; -- Used for Projection&lt;br /&gt;&lt;br /&gt;Accessing .Net Classes and imvoking member functions&lt;br /&gt;&lt;br /&gt;13) "String".Substring()&amp;nbsp;&amp;nbsp; -- Accessing function of an .Net Object&lt;br /&gt;14) [System.Guid]::NewGuid()&amp;nbsp;&amp;nbsp; -- Accessing static members of .Net Classes&lt;br /&gt;&lt;br /&gt;Declaring Arrays and HashTable in PowerShell&lt;br /&gt;&lt;br /&gt;15) $x&amp;nbsp; = @{ "key1"="Yash"; "key2" = "Patil"}&amp;nbsp; -- Declaring HashTable&lt;br /&gt;16) $x = @("Yash","Patil")&amp;nbsp; -- Declaring array &lt;br /&gt;&lt;br /&gt;To Set the Drives installed on the machine, Setting Different drives&lt;br /&gt;&lt;br /&gt;17) &lt;strong&gt;Get-PSDrive&lt;/strong&gt; &lt;br /&gt;18) &lt;strong&gt;Set-Location&lt;/strong&gt;&amp;nbsp; -- To set the location to different drives like Environment, Drives etc.&lt;br /&gt;&lt;br /&gt;19) &lt;strong&gt;Select-String&lt;/strong&gt; -- Replacement for Unix's Grep&lt;br /&gt;20) &lt;strong&gt;Invoke-Command&lt;/strong&gt; -ComputerName&amp;nbsp;{&amp;nbsp;Expression }&lt;br /&gt;&lt;br /&gt;PowerShell is very powerful and can be used with Remote Machines as well i.e the same cmdlets that you run on localMachine can be used with remote machine.&lt;br /&gt;&lt;br /&gt;A good ebook to learn more about PowerShell : &lt;a href="http://powershell.com/cs/blogs/ebook/default.aspx"&gt;http://powershell.com/cs/blogs/ebook/default.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Love the power PowerShell gives with command lines and the uniform way of accessing different Data-Stores.&lt;br /&gt;&lt;br /&gt;-Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-1043415643346195775?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/1043415643346195775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=1043415643346195775' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/1043415643346195775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/1043415643346195775'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2010/06/my-experiences-with-powershell.html' title='My experiences with PowerShell'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-5432485657861890916</id><published>2010-06-13T16:38:00.000-07:00</published><updated>2010-06-14T02:54:11.315-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Validation'/><title type='text'>Simple Asp.Net Custom Validator Control</title><content type='html'>Asp.Net Validators are very cool and useful in certain scenarios. There are certain scenarios where Asp.Net required field validator fails such as while validating CheckBox,CheckBoxList etc. The reason for this is because these controls are multiple input controls there is no way for the framework to know which case is valid. &lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;Asp.Net&amp;nbsp; provides two ways to create CustomValidators.&lt;br /&gt;&lt;br /&gt;1) Deriving from System.Web.UI.WebControls.BaseValidator&lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;2) Deriving from System.Web.UI.WebControls.CustomValidator&lt;/div&gt;&lt;br /&gt;Here, I have created my custom control by deriving it from CustomValidator class. If you examine the CustomValidator class you will find there is an event &lt;strong&gt;"ServerValidate". &lt;/strong&gt;Developer has to provide a handler and add custom validation logic in that handler.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_iUI-C9OjkTY/TBVpamlWaeI/AAAAAAAAAL0/qmA-_TXY3yE/s1600/BaseClassForUserControl.PNG" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="243" qu="true" src="http://4.bp.blogspot.com/_iUI-C9OjkTY/TBVpamlWaeI/AAAAAAAAAL0/qmA-_TXY3yE/s640/BaseClassForUserControl.PNG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Framework allows developers to add client side validation by providing the client side validation in the &lt;strong&gt;"ClientValidationFunction"&lt;/strong&gt; property.Framework will call this method to perform the validations.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_iUI-C9OjkTY/TBVqvCBiYUI/AAAAAAAAAL8/9MoyGKTIDO4/s1600/ClientSideValidation.PNG" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="182" qu="true" src="http://2.bp.blogspot.com/_iUI-C9OjkTY/TBVqvCBiYUI/AAAAAAAAAL8/9MoyGKTIDO4/s640/ClientSideValidation.PNG" width="640" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;One of the important thing to remember is "always make your UserControl derive from a custom Base class which extends the Asp.net UserControl class". This way you can add your logic for eg EventHandlers in the custombase class.&lt;br /&gt;&lt;br /&gt;SourceCode can be found &lt;a href="http://cid-928a438e82450145.office.live.com/self.aspx/.Public/CustomValidator.zip"&gt;&lt;span style="color: blue;"&gt;here&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;-Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-5432485657861890916?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/5432485657861890916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=5432485657861890916' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/5432485657861890916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/5432485657861890916'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2010/06/simple-aspnet-custom-validator-control.html' title='Simple Asp.Net Custom Validator Control'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_iUI-C9OjkTY/TBVpamlWaeI/AAAAAAAAAL0/qmA-_TXY3yE/s72-c/BaseClassForUserControl.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-4236863834811734510</id><published>2010-05-13T00:04:00.000-07:00</published><updated>2010-05-13T16:23:27.110-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Closure'/><title type='text'>ClientSide Control</title><content type='html'>&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;ClientSide controls are a lot of fun to create.Today, I am going to blog about one simple client control that I created which heavily uses javascript concepts like "Namespaces", "Singleton", "Closure", "Prototype Inheritance" etc.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;QueryControl basically makes a Ajax call with the query thats typed in the textbox and shows its output. QueryControl is a client side control which encapsulates the functionality of &lt;/div&gt;1) Making a ajax call and getting the Result by calling a handler.&lt;br /&gt;2) Show the response in a placeHolder.&lt;br /&gt;&lt;br /&gt;Many instances of the same control&amp;nbsp;are added to the Page, and the control registers itself to a collection in its constructor.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_iUI-C9OjkTY/S-uhxX5J13I/AAAAAAAAALk/cbfd8RbAIpM/s1600/ClientControl.PNG" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="306" src="http://4.bp.blogspot.com/_iUI-C9OjkTY/S-uhxX5J13I/AAAAAAAAALk/cbfd8RbAIpM/s640/ClientControl.PNG" width="640" wt="true" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;I have not made the final output, pretty becuase my aim was to make the concepts clear rather than make the UI pretty. To really understand the code, you will have to debug it atleast once.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_iUI-C9OjkTY/S-ukRBE7GNI/AAAAAAAAALs/z0X0kjnJGLg/s1600/QueryControl.PNG" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="313" src="http://1.bp.blogspot.com/_iUI-C9OjkTY/S-ukRBE7GNI/AAAAAAAAALs/z0X0kjnJGLg/s640/QueryControl.PNG" width="640" wt="true" /&gt;&lt;/a&gt;&lt;/div&gt;Code Sample:&amp;nbsp;&lt;a href="http://cid-928a438e82450145.skydrive.live.com/self.aspx/.Public/ClientControlEx.zip"&gt;Download!!&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;--Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-4236863834811734510?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/4236863834811734510/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=4236863834811734510' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/4236863834811734510'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/4236863834811734510'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2010/05/clientside-control.html' title='ClientSide Control'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_iUI-C9OjkTY/S-uhxX5J13I/AAAAAAAAALk/cbfd8RbAIpM/s72-c/ClientControl.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-2227052012572012838</id><published>2010-04-18T14:10:00.000-07:00</published><updated>2010-04-18T14:10:01.786-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Design Pattern'/><title type='text'>Template Method Pattern ( Encapsulating the Algorithm)</title><content type='html'>Template Method Pattern is a useful pattern when you want to &lt;strong&gt;encapsulate the algorithm, &lt;/strong&gt;but the individual steps in the algorithm can change depending on the implemetation given by the clients.&lt;br /&gt;&lt;br /&gt;The basic principle of writing good code which is loosely coupled is to make sure that the things that change are seperate from the things that remain same.&lt;br /&gt;&lt;br /&gt;In template method pattern, since the algorithm remains the same, we add that algorithm in the base class and make the method non-virtual, so that the class that derive from the abstract classes cannot override the method. &lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_iUI-C9OjkTY/S8twEsQ2j3I/AAAAAAAAALY/N_Qa1hStp20/s1600/TemplateMethodPattern.PNG" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="228" src="http://2.bp.blogspot.com/_iUI-C9OjkTY/S8twEsQ2j3I/AAAAAAAAALY/N_Qa1hStp20/s640/TemplateMethodPattern.PNG" width="640" wt="true" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;As shown in the above architecture diagram, ProcessData is an abstract class which has 3 method,&lt;br /&gt;&lt;br /&gt;1)ProcessRequest&amp;nbsp; (This is the main algorithm, and it cannot be overridden by the clients)&lt;br /&gt;2) GetConnection ( This is a hook method, i.e it has a default implementation, but it&amp;nbsp; is virtual and can be&amp;nbsp;overriden by the client, to provide thier own implementation)&lt;br /&gt;3) GetData&amp;nbsp; ( This is an abstract Method and client will provide the implementation)&lt;br /&gt;4) ShowData ( This is an abstract Method and clients&amp;nbsp;will provide the implentation)&lt;br /&gt;&lt;br /&gt;CustomerData and EmployeeData derive from ProcessData and provide thier own implementation of how to get the Data and show it in different controls. In future if you want to add new clients all you have to do is derive from ProcessData and provide your own implementation.&lt;br /&gt;&lt;br /&gt;When the BaseClass Concrete method is called to Get/Render the data, it internally calls the clients implementation of GetData and ShowData methods.&lt;br /&gt;&lt;br /&gt;You can download the code &lt;a href="http://cid-928a438e82450145.skydrive.live.com/self.aspx/.Public/TemplateMethodPatternBlogEx.zip"&gt;&lt;span style="color: blue;"&gt;here&lt;/span&gt;&lt;/a&gt;&lt;span style="color: blue;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;-Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-2227052012572012838?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/2227052012572012838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=2227052012572012838' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/2227052012572012838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/2227052012572012838'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2010/04/template-method-pattern-encapsulating.html' title='Template Method Pattern ( Encapsulating the Algorithm)'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_iUI-C9OjkTY/S8twEsQ2j3I/AAAAAAAAALY/N_Qa1hStp20/s72-c/TemplateMethodPattern.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-7900994831851061160</id><published>2010-04-08T21:12:00.000-07:00</published><updated>2010-05-13T17:01:30.867-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Closure'/><title type='text'>Closure</title><content type='html'>Closure is one of the&amp;nbsp; most useful programming construct which I find very fasinating and exciting to use.&lt;br /&gt;Closure: Innerfunction can access the enclosing function variables&amp;nbsp;even after the&amp;nbsp;enclosing has finished executing.&lt;br /&gt;&lt;br /&gt;Simple example of closure:&lt;br /&gt;&lt;strong&gt;(function EnclosingFunc()&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var x = {"Name": "Yashwant Patil"};&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.PrintName = function()&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert(x.Name);&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;})();&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;this.PrintName();&lt;/strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Output of this will be&amp;nbsp; &lt;strong&gt;Yashwant Patil&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;When PrintName is called, it is able to access the x variable even though the enclosing function has already exited.&amp;nbsp; &lt;br /&gt;Closure are extensively used in lot of javascript libraries like JQuery , ASP.Net Ajax library etc.&lt;br /&gt;&lt;br /&gt;Following examples will demonstrate where closures can be useful.&lt;br /&gt;&lt;br /&gt;1) Closure can be used to &lt;strong&gt;maintain the state.&lt;/strong&gt;&lt;br /&gt;2) Closure can be used in &lt;strong&gt;callback functions&lt;/strong&gt;.&lt;br /&gt;3) Closure can be used to give a &lt;strong&gt;restricted scope to a variable&lt;/strong&gt;, thus avoiding the global variable issue in javascript.&lt;br /&gt;4) Closure are very useful in avoiding the &lt;strong&gt;"this" issue in javascript&lt;/strong&gt;. Closure are extensively used in eventhandlers.&lt;br /&gt;&lt;br /&gt;I think its a very powerful programming construct which can be little tricky to understand but once you get it, you will wonder how you ever lived without it. :)&lt;br /&gt;&lt;br /&gt;-Yashwant&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-7900994831851061160?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/7900994831851061160/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=7900994831851061160' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/7900994831851061160'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/7900994831851061160'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2010/04/closure.html' title='Closure'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-2144636901415314166</id><published>2010-04-04T11:57:00.000-07:00</published><updated>2010-04-04T11:59:37.217-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Design Pattern'/><title type='text'>Decorator Pattern Implementation</title><content type='html'>Decorator pattern is one of the simplest and powerful design pattern. Decorator pattern as the name suggests allows you to add/Decorate i.e&lt;strong&gt; add/Modify&amp;nbsp;functionality of the existing class&lt;/strong&gt; &lt;strong&gt;&lt;span style="color: black;"&gt;dynamically at Runtime&lt;/span&gt;&lt;/strong&gt;.&lt;br /&gt;Decorate pattern is an alternative to inheritance. It is a widely used pattern and a good example of it is the &lt;strong&gt;Stream class in .Net&lt;/strong&gt;.&lt;br /&gt;In this example I am using Decorator pattern to log all the calls to DoWork Method. &lt;br /&gt;&lt;br /&gt;Important things to remember in Decorator pattern are:&lt;br /&gt;&lt;br /&gt;1) It changes the functionality of the object at runtime.&lt;br /&gt;2) Decorator class always Derives/Implements the Main class/Interface and keeps a private instance of the MainClass as a member field. Overides and/or provides new methods.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_iUI-C9OjkTY/S7jcZ-prDvI/AAAAAAAAALQ/8-_swyRRHdA/s1600/DecoratorPatternEx.PNG" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="456" nt="true" src="http://1.bp.blogspot.com/_iUI-C9OjkTY/S7jcZ-prDvI/AAAAAAAAALQ/8-_swyRRHdA/s640/DecoratorPatternEx.PNG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;You can download the code &lt;a href="http://cid-928a438e82450145.skydrive.live.com/self.aspx/.Public/DecoratorPatternBlogExample.zip"&gt;&lt;span style="color: red;"&gt;&lt;strong&gt;here&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;-Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-2144636901415314166?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/2144636901415314166/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=2144636901415314166' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/2144636901415314166'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/2144636901415314166'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2010/04/decorator-pattern-implementation.html' title='Decorator Pattern Implementation'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_iUI-C9OjkTY/S7jcZ-prDvI/AAAAAAAAALQ/8-_swyRRHdA/s72-c/DecoratorPatternEx.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-1947724596402328547</id><published>2010-04-03T16:16:00.000-07:00</published><updated>2010-04-05T16:58:25.779-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript intellisense in Visual Studio 2008/+</title><content type='html'>This is a simple post about Javascript Intellisense in Visual Studio 2008 onwards.&lt;br /&gt;&lt;br /&gt;Visual Studio will provide intellisense for javascript function&amp;nbsp; if you provide information in the below format, which is similar to how intellisense works in C#.&lt;br /&gt;&lt;br /&gt;Here I have two Javascript files:&lt;br /&gt;Script1 folder has Utility.js&lt;br /&gt;Script2 folder has Helper.js&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_iUI-C9OjkTY/S7fKt_y-lDI/AAAAAAAAALA/bYn4KorFz4E/s1600/JSIntellisense.PNG" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="155" nt="true" src="http://3.bp.blogspot.com/_iUI-C9OjkTY/S7fKt_y-lDI/AAAAAAAAALA/bYn4KorFz4E/s640/JSIntellisense.PNG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;You can use the&amp;nbsp; name and type attributes to&amp;nbsp; show the parameter name and parameter return type in the intellisense respectively.&lt;br /&gt;&lt;br /&gt;To get the intellisense for Print function in Helper.js all I have to do it add the reference to Utility.js file in Helper.js.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_iUI-C9OjkTY/S7fLRlO4IiI/AAAAAAAAALI/riovyD0SLKA/s1600/JSIntellisense1.PNG" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="172" nt="true" src="http://4.bp.blogspot.com/_iUI-C9OjkTY/S7fLRlO4IiI/AAAAAAAAALI/riovyD0SLKA/s640/JSIntellisense1.PNG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;To update the intellisense engine to take your latest changes, press CTRL + SHIFT+ J. No need to close-reopen the file.&lt;br /&gt;&lt;br /&gt;I think is very important to have intellisense in a dynamic language like javascript.&lt;br /&gt;&lt;br /&gt;--Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-1947724596402328547?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/1947724596402328547/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=1947724596402328547' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/1947724596402328547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/1947724596402328547'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2010/04/javascript-intellisense-in-visual.html' title='Javascript intellisense in Visual Studio 2008/+'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_iUI-C9OjkTY/S7fKt_y-lDI/AAAAAAAAALA/bYn4KorFz4E/s72-c/JSIntellisense.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-4325811000552748037</id><published>2010-03-27T10:41:00.000-07:00</published><updated>2010-03-27T22:53:54.578-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><category scheme='http://www.blogger.com/atom/ns#' term='Debugging'/><title type='text'>.Net Tracing/Debugging with DebugView</title><content type='html'>Recently, I came across a tool called &lt;a href="http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx"&gt;DebugView&lt;/a&gt; . This is a great tool which writes all the debug statement to the window. I use it a lot while development to log the important parameters to the window. It does make life a lot easier.&lt;br /&gt;&lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;For eg:&lt;/div&gt;&lt;div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_iUI-C9OjkTY/S65Bxra3p1I/AAAAAAAAAKw/SCOcphKTO-U/s1600/Tracing.PNG" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="196" nt="true" src="http://2.bp.blogspot.com/_iUI-C9OjkTY/S65Bxra3p1I/AAAAAAAAAKw/SCOcphKTO-U/s640/Tracing.PNG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;As you can see all the Debug/Trace statement will be caught by DebugView. WinDbg also catches all the messages like DebugView does.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_iUI-C9OjkTY/S65CcORsG-I/AAAAAAAAAK4/Mqk1XlDs_2k/s1600/DebugView.PNG" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="333" nt="true" src="http://1.bp.blogspot.com/_iUI-C9OjkTY/S65CcORsG-I/AAAAAAAAAK4/Mqk1XlDs_2k/s400/DebugView.PNG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp;This is really very helpful while development as well as while debugging a issue in the TEST environment.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Happy Programming!!&lt;br /&gt;&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-4325811000552748037?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/4325811000552748037/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=4325811000552748037' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/4325811000552748037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/4325811000552748037'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2010/03/net-tracingdebugging-with-debugview.html' title='.Net Tracing/Debugging with DebugView'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_iUI-C9OjkTY/S65Bxra3p1I/AAAAAAAAAKw/SCOcphKTO-U/s72-c/Tracing.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-1016541373255817312</id><published>2010-02-26T11:58:00.000-08:00</published><updated>2010-02-26T12:01:26.048-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Debugging'/><category scheme='http://www.blogger.com/atom/ns#' term='windbg'/><title type='text'>Debugging Managed App with windbg</title><content type='html'>One of my coworker showed me how to use WinDbg tool for debugging&amp;nbsp;managed apps. Many times we see in Test Environments that exception is thrown but its not getting logged anywhere and its difficult to find the exact reason.&lt;br /&gt;&lt;br /&gt;This is where WinDbg comes in. Windbg stands for windows debugger. It&amp;nbsp; is a multipurpose tool which can be used to analyse dumps, Finding exception, getting stackTrace etc. There are couple of steps that you need to take to use this tool.&lt;br /&gt;&lt;br /&gt;1) WinDbg is a free tool. Just google it or click here &lt;a href="http://lmgtfy.com/?q=download+windbg"&gt;http://lmgtfy.com/?q=download+windbg&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2) WinDbg gets installed in C:\ProgramFiles\Debugging tools for windows&lt;br /&gt;&lt;br /&gt;3) Launch windbg.exe, And type this command &lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;em&gt;.loadby sos mscorwks&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;This is an extension that you need to load to debug Managed &amp;nbsp;applications.&lt;br /&gt;&lt;br /&gt;4) Go to Debug Menu/ Event Filters -- enable CLR Exception&lt;br /&gt;&lt;br /&gt;5) Attach to the w3wp.exe process and&amp;nbsp; &lt;strong&gt;Start the Debugger Or Click F5.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;6) You can view all the exception thrown by your application, stack trace, function parameters by using different commands &lt;br /&gt;&lt;br /&gt;&amp;nbsp; !pe ---&amp;gt; Print Exception&lt;br /&gt;&amp;nbsp; !clrstack --&amp;gt; Print the whole stack Trace.&lt;br /&gt;&amp;nbsp; !help --&amp;gt; To view all commands available in Windbg.&lt;br /&gt;&lt;br /&gt;-Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-1016541373255817312?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/1016541373255817312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=1016541373255817312' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/1016541373255817312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/1016541373255817312'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2010/02/debugging-managed-app-with-windbg.html' title='Debugging Managed App with windbg'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-6513027920072520862</id><published>2010-01-31T21:41:00.000-08:00</published><updated>2010-01-31T21:46:59.322-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Validation'/><category scheme='http://www.blogger.com/atom/ns#' term='Wcf'/><title type='text'>Inspecting Parameters passed to an Operation through IParameterInspector</title><content type='html'>Windows Communication Foundation has a very extensible and loosely coupled architecture.&amp;nbsp;Recently I was trying to do some input validations on the parameters that were passed to the WCF Service.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_iUI-C9OjkTY/S2Zn6I1o9vI/AAAAAAAAAKQ/JBKdLmCsfOM/s1600-h/Server+Side+Message+Dispatching.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="403" kt="true" src="http://1.bp.blogspot.com/_iUI-C9OjkTY/S2Zn6I1o9vI/AAAAAAAAAKQ/JBKdLmCsfOM/s640/Server+Side+Message+Dispatching.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;IParameterInsepctor is the interface you need to implement. Before I explain the code, just want to give a overview of extension points in WCF. I came across a &lt;a href="http://msdn.microsoft.com/en-us/magazine/cc163302.aspx"&gt;very nice article&lt;/a&gt;, which explains all the extension points. &lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;On the server side when the message is received by the WCF runtime, it goes through different channels before the operationCode is executed. The main extensibility points here are&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;1) MessageInspection -- You can get the Xml representation of the message here, you can SIGN the messages, Log it, Validate it against a schema.&lt;/div&gt;2) OperationSelector -- You can do some kind of Caching etc&lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;3) MessageFormatting -- Here you can do some customFormatting of the message.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;4) Parameter Inspection -- Here you can do Input parameter validation etc. Bascially you get access to the paramaters passed by the client to your operation.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&amp;nbsp;All you have to do it &lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&amp;nbsp; a) Implement the IParameterInspector&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;a href="http://2.bp.blogspot.com/_iUI-C9OjkTY/S2ZpCwuqM0I/AAAAAAAAAKY/sLgVQ8RoFoo/s1600-h/Parameter+Inspector.JPG" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="175" kt="true" src="http://2.bp.blogspot.com/_iUI-C9OjkTY/S2ZpCwuqM0I/AAAAAAAAAKY/sLgVQ8RoFoo/s400/Parameter+Inspector.JPG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&amp;nbsp; &lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;b) Implement a class which derives from Attribute and implements IOperationBehaviour interface. Bascially you have to add the CustomBehaviour to the Runtime. So when runtime tries to call the operation it will first go through the Custom Behaviour.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_iUI-C9OjkTY/S2ZpTLbGj7I/AAAAAAAAAKg/NtRKT61COGo/s1600-h/InspectorAttribute.JPG" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="183" kt="true" src="http://3.bp.blogspot.com/_iUI-C9OjkTY/S2ZpTLbGj7I/AAAAAAAAAKg/NtRKT61COGo/s400/InspectorAttribute.JPG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;c)Add this attribute on the Operation.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_iUI-C9OjkTY/S2ZpcKdZepI/AAAAAAAAAKo/G2ZbPzIV3LY/s1600-h/Interface.JPG" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="160" kt="true" src="http://2.bp.blogspot.com/_iUI-C9OjkTY/S2ZpcKdZepI/AAAAAAAAAKo/G2ZbPzIV3LY/s400/Interface.JPG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;br /&gt;d) If you want to add the behaviour through config then you need to implement a class which derives from&amp;nbsp;BehaviorExtensionElement.&lt;/div&gt;&lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;WCF runtime uses reflection to find the behaviours, after that it checks the Config file for any custom behaviours.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;You can download the &lt;a href="http://cid-928a438e82450145.skydrive.live.com/self.aspx/.Public/WcfParameterInspectorDemo.zip"&gt;SourceCode Here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Enjoy&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-6513027920072520862?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/6513027920072520862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=6513027920072520862' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/6513027920072520862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/6513027920072520862'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2010/01/inspecting-parameters-passed-to.html' title='Inspecting Parameters passed to an Operation through IParameterInspector'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_iUI-C9OjkTY/S2Zn6I1o9vI/AAAAAAAAAKQ/JBKdLmCsfOM/s72-c/Server+Side+Message+Dispatching.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-7614481168691422581</id><published>2010-01-01T20:10:00.000-08:00</published><updated>2010-01-01T20:14:45.335-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><title type='text'>Ajaxify your web application...</title><content type='html'>Happy New Year!!! This year I have made a resolution that I will blog more about the things I learn :)&lt;br /&gt;&lt;br /&gt;Today I am going to blog about how to implement Ajax functionality without using the Asp.Net Ajax.What AJAX functionality means is -- you can make a request to the server from the client without the page being refreshed.It gives a better user experience.&lt;br /&gt;&lt;br /&gt;The main object behind Ajax functionality is the &lt;b&gt;&lt;i&gt;XmlHttpRequest&lt;/i&gt;&lt;/b&gt; Object. This object has a method called send which can make request to the server.&lt;br /&gt;&lt;br /&gt;In this application, I will show how to populate a dropdownlist based on user selection without doing a complete postback. &lt;br /&gt;&lt;br /&gt;The way I have designed this application is:&lt;br /&gt;1)I have added a HttpHandler which executes functions based on the querystring input.&lt;br /&gt;2)Ajax Request is made to this handler from javascript with appropriate parameters i.e&lt;br /&gt;a)BusinessFunction Name, which should be executed&lt;br /&gt;b)Parameters which the businessfunction needs.&lt;br /&gt;&lt;br /&gt;I have created custom attributes which keep track of which classes and functions are business functions, i.e the functions that can be executed from the Ajax Handler. &lt;b&gt;&lt;i&gt;FrameworkHelper&lt;/i&gt;&lt;/b&gt; is implemented as &lt;i&gt;&lt;b&gt;singleton&lt;/b&gt;&lt;/i&gt; which will keep all these functions in the dictionary and will execute these functions on the fly using reflection.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_iUI-C9OjkTY/Sz7B3vhETKI/AAAAAAAAAKI/hjbJZflwQo0/s1600-h/AjaxApplication.JPG" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" ps="true" src="http://3.bp.blogspot.com/_iUI-C9OjkTY/Sz7B3vhETKI/AAAAAAAAAKI/hjbJZflwQo0/s400/AjaxApplication.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can download this application&amp;nbsp; &lt;a href="http://cid-928a438e82450145.skydrive.live.com/self.aspx/.Public/AjaxAppBlogExample.zip"&gt;&lt;strong&gt;&lt;span style="color: red;"&gt;here&lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Happy Programming!!!&lt;br /&gt;&lt;br /&gt;-Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-7614481168691422581?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/7614481168691422581/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=7614481168691422581' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/7614481168691422581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/7614481168691422581'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2010/01/ajaxify-your-web-application.html' title='Ajaxify your web application...'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_iUI-C9OjkTY/Sz7B3vhETKI/AAAAAAAAAKI/hjbJZflwQo0/s72-c/AjaxApplication.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-6893760642504880552</id><published>2009-10-04T11:09:00.000-07:00</published><updated>2009-11-01T13:27:22.211-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascipt Basics - Part 2</title><content type='html'>I did one blogpost couple of months back regarding Javascript Basics. This is continuation of that post.&lt;br /&gt;&lt;br /&gt;A)&lt;strong&gt;EncodeUri and EncodeUriComponent&lt;/strong&gt; -&lt;br /&gt;These are builtin function which are used to encode the parameters.&lt;br /&gt;&lt;br /&gt;EncodeUri(uri)-- will encode the part of the Url after the "http://somehostName/{This part will be encoded}&lt;br /&gt;&lt;br /&gt;EncodeUrlComponent(url) -- it assumes that you will passing only the parameter that you want to encode. It will encode whatever you pass to the function.&lt;br /&gt;&lt;br /&gt;For eg: if you pass&lt;br /&gt;&lt;br /&gt;var url = 'http://yashwant.dns.mycompany.com/H ome&lt;/DEFAU lt.aspx&gt;';&lt;br /&gt;alert(encodeURI(url));&lt;br /&gt;Output:&lt;a href="http://yashwant.dns.mycompany.com/H%20ome%3C/defau%20lt.aspx%3E"&gt;http://yashwant.dns.mycompany.com/H%20ome%3C/defau%20lt.aspx%3E&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;alert(encodeURIComponent(url));&lt;br /&gt;Output:http%3A%2F%2Fyashwant.dns.mycompany.com%2FH%20ome%3C%2Fdefau%20lt.aspx%3E&lt;br /&gt;&lt;br /&gt;B)&lt;strong&gt; Functions as Data&lt;/strong&gt;&lt;br /&gt;Javascripts treats functions as Data. So a function can be assigned to a varaible.&lt;br /&gt;for eg:&lt;br /&gt;var x = function()&lt;br /&gt;{&lt;br /&gt;alert('this is a function');&lt;br /&gt;}&lt;br /&gt;This notation is called as &lt;strong&gt;&lt;em&gt;function literal notation&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;C) &lt;strong&gt;Anonymous Functions&lt;/strong&gt;&lt;br /&gt;Anonymous function are declared in place and dont have a name. Main use of Anonymous functions are it makes the code more elegant. They are used a lot as callback functions. As we know that Functions can be treated as data, so we can pass a function to another function as a parameter in javascript.&lt;br /&gt;For eg:&lt;br /&gt;&lt;br /&gt;var y = function (functionParameter)&lt;br /&gt;{&lt;br /&gt;alert('I am in functionA');&lt;br /&gt;&lt;strong&gt;//CallBack the anonymous function that you passedin&lt;/strong&gt;&lt;br /&gt;functionParameter();&lt;br /&gt;}&lt;br /&gt;y(function() { alert('I am the callback function')});&lt;br /&gt;&lt;br /&gt;D) &lt;strong&gt;Global Objects&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;When we declare a varaible using the &lt;strong&gt;object literal notation&lt;/strong&gt; i.e&lt;br /&gt;&lt;br /&gt;var Person = {&lt;br /&gt;firstName: 'Yashwant',&lt;br /&gt;middleName: 'Jaywant',&lt;br /&gt;lastName: 'Patil',&lt;br /&gt;print: function() //This is a method&lt;br /&gt;{&lt;br /&gt;alert(this.firstName + " " + this.middleName + " " + this.lastName);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Person property gets attached to the global javascript variable. In this case, since the code is running in a browser "person" property gets attached to the WINDOW object. So you can call the print method on the Person object like this&lt;br /&gt;&lt;br /&gt;//Person Varaible gets attached as a property of the Global Object i.e Window object&lt;br /&gt;window['Person'].print();&lt;br /&gt;&lt;br /&gt;E)&lt;strong&gt;Configuration Objects&lt;/strong&gt;&lt;br /&gt;The rule I follow while writing javascript functions is :If there are more than 3 parameters that need to be passed to a javascript function, it is better to pass it as a JSON configuration object.&lt;br /&gt;&lt;br /&gt;for eg:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;//Cofiguration Objects...&lt;/strong&gt;&lt;br /&gt;var func = function Print(configurationObj)&lt;br /&gt;{&lt;br /&gt;for (var j in configurationObj)&lt;br /&gt;{&lt;br /&gt;alert(configurationObj[j]);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;var obj = {"firstName":"Yashwant",&lt;br /&gt;"middleName":"Jaywant",&lt;br /&gt;"lastName": "Patil"&lt;br /&gt;};&lt;br /&gt;Print(obj);&lt;br /&gt;&lt;br /&gt;It makes the code easire to read and understand.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-6893760642504880552?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/6893760642504880552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=6893760642504880552' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/6893760642504880552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/6893760642504880552'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2009/10/javascipt-basics-part-2.html' title='Javascipt Basics - Part 2'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-2301685234962787162</id><published>2009-08-16T12:48:00.000-07:00</published><updated>2010-02-27T13:29:06.823-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Design Pattern'/><title type='text'>Facade Pattern</title><content type='html'>Facade pattern is a very simple but useful pattern.When I think of Facade pattern.. what comes to my mind is composition.&lt;br /&gt;&lt;br /&gt;Complex System ----&amp;gt; Sub System 1&lt;br /&gt;----&amp;gt; Sub System 2&lt;br /&gt;----&amp;gt; Sub System 3&lt;br /&gt;----&amp;gt; Sub System 4&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For an external system we can create a wrapper which hides all the subsystems and provides an unified interface. Internall this wrapper will dispatch the call to the correct subsystems.&lt;br /&gt;&lt;br /&gt;For eg:&lt;br /&gt;public Class ComplexSystem&lt;br /&gt;{&lt;br /&gt;private SubSystem _subSystem1;&lt;br /&gt;private SubSystem _subSystem2;&lt;br /&gt;private SubSystem _subSystem3;&lt;br /&gt;&lt;br /&gt;public void SubSystem1Method1()&lt;br /&gt;{&lt;br /&gt;_subSystem.Method1();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void SubSystem2Method1()&lt;br /&gt;{&lt;br /&gt;_subSystem2.Method1();&lt;br /&gt;}&lt;br /&gt;public void SubSystem3Method1()&lt;br /&gt;{&lt;br /&gt;_subSystem3.Method1();&lt;br /&gt;}&lt;br /&gt;public void SubSystem4Method1()&lt;br /&gt;{&lt;br /&gt;_subSystem4.Method1();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;I hope this explanation helps. You can donwload a real world example here: &lt;a href="http://dotnetdevblog.googlepages.com/FacadePatters.zip"&gt;http://dotnetdevblog.googlepages.com/FacadePatters.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-2301685234962787162?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/2301685234962787162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=2301685234962787162' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/2301685234962787162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/2301685234962787162'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2009/08/facade-pattern.html' title='Facade Pattern'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-7030330467881042412</id><published>2009-06-14T16:15:00.001-07:00</published><updated>2009-11-01T13:27:22.211-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript Basics......</title><content type='html'>&lt;div&gt;Its been long time since I wrote a post. Was busy with lot of things.&lt;br /&gt;Lately I have been working a lot with Javascript. This is the first time I am using Javascript heavily in a project.&lt;br /&gt;&lt;br /&gt;Today I want to demonstrate some of the basic javascript concept.&lt;br /&gt;1)Static Methods&lt;br /&gt;2)Public Methods/Variables&lt;br /&gt;3)Private Methods/Varables&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In this project.. I created a simple server control which renders a link. Href of this link is a javascript function.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_iUI-C9OjkTY/SjfETi2R_NI/AAAAAAAAAHc/Gszfi4EQypA/s1600-h/CropperCapture%5B1%5D.Bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5347958922576788690" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 306px" alt="" src="http://1.bp.blogspot.com/_iUI-C9OjkTY/SjfETi2R_NI/AAAAAAAAAHc/Gszfi4EQypA/s400/CropperCapture%5B1%5D.Bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Javascript method CreateArt(...) creats an instance of a Window Object.&lt;br /&gt;var win = new Window();&lt;br /&gt;&lt;br /&gt;Window object'ss prototype property has two methods&lt;br /&gt;1)Initialize(..) -- Sets the local variable firstName,middleName,lastName&lt;br /&gt;2)Display(..) -- Displays the names in a table which is attached to the body of the document.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_iUI-C9OjkTY/Slq1JZ87nHI/AAAAAAAAAHs/_dr5iENgAag/s1600-h/Set+the+Prototype+Object.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5357793879900527730" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 150px" alt="" src="http://1.bp.blogspot.com/_iUI-C9OjkTY/Slq1JZ87nHI/AAAAAAAAAHs/_dr5iENgAag/s400/Set+the+Prototype+Object.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Another way to set the prototype is to add each function individually.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="http://2.bp.blogspot.com/_iUI-C9OjkTY/Slq2spyTAKI/AAAAAAAAAH0/5Blr3tB8Msk/s1600-h/CropperCapture%5B2%5D.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5357795584957939874" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 127px" alt="" src="http://2.bp.blogspot.com/_iUI-C9OjkTY/Slq2spyTAKI/AAAAAAAAAH0/5Blr3tB8Msk/s400/CropperCapture%5B2%5D.jpg" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;adding public variable/function and a private variable/function to the Window Object.&lt;/p&gt;&lt;div&gt;&lt;a href="http://3.bp.blogspot.com/_iUI-C9OjkTY/Slq3u0jj-7I/AAAAAAAAAH8/i5SQAoqms7I/s1600-h/Public+and+Private+Variable+in+js.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5357796721720294322" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 129px" alt="" src="http://3.bp.blogspot.com/_iUI-C9OjkTY/Slq3u0jj-7I/AAAAAAAAAH8/i5SQAoqms7I/s400/Public+and+Private+Variable+in+js.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;div&gt;Declaring a public method is done using the this keyword.&lt;br /&gt;&lt;br /&gt;Private methods are declared using a private Variable and then adding a method to that variable. The advantage of this is we dont expose this method from the class.&lt;br /&gt;&lt;br /&gt;Static Method can be easily declared by adding that method to the class. for eg:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_iUI-C9OjkTY/Slq5LrT8ixI/AAAAAAAAAIE/eHW7UHlrOSY/s1600-h/Static+and+Main+Method.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5357798316966710034" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 129px" alt="" src="http://3.bp.blogspot.com/_iUI-C9OjkTY/Slq5LrT8ixI/AAAAAAAAAIE/eHW7UHlrOSY/s400/Static+and+Main+Method.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;If you want to download the source code please click here --&gt; &lt;a href="http://dotnetdevblog.googlepages.com/JavascriptBlogApp.zip"&gt;http://dotnetdevblog.googlepages.com/JavascriptBlogApp.zip&lt;/a&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;I started loving javascript as a language after working on this project. I used to think javascript  was not for real programmer but now I believe it has lot of goodness in it. &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;Embrace It :)&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;Thanks,&lt;/div&gt;&lt;div&gt;Yash&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-7030330467881042412?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/7030330467881042412/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=7030330467881042412' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/7030330467881042412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/7030330467881042412'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2009/06/javascript-basics.html' title='Javascript Basics......'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_iUI-C9OjkTY/SjfETi2R_NI/AAAAAAAAAHc/Gszfi4EQypA/s72-c/CropperCapture%5B1%5D.Bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-3784595060292286051</id><published>2009-02-15T17:21:00.001-08:00</published><updated>2010-02-27T13:31:15.290-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Design Pattern'/><title type='text'>Implementing Strategy Design Pattern...</title><content type='html'>Implementing the strategy pattern helps in decoupling the application.The main idea behind you can interchange the different implementation of your algorithm without breaking the code.&lt;br /&gt;&lt;br /&gt;What I mean by that is .. I have an interface, IGetData which defines a single method which returns a Customer object.&lt;br /&gt;&lt;br /&gt;public interface IGetData&lt;br /&gt;{&lt;br /&gt;Customer GetData();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This interface is implemented by two different classes...SqlDataSource which gets the customer object from the SqlServer Database, while XmlDataSource gets the Customer object from the XmlDatasource.&lt;br /&gt;The data class encapsulates the interface[IGetData]... in the Constructor of the Data class. you can pass in different implementations of IGetData. i.e you can pass any class which implements the IGetData interface.&lt;br /&gt;By doing this .. you can have some factory method which will return the appropriate class which implements the IGetData interface.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_iUI-C9OjkTY/SZjkqatupTI/AAAAAAAAAHE/vVxnIfH61d0/s1600-h/Strategy.jpg"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5303239978605520178" src="http://2.bp.blogspot.com/_iUI-C9OjkTY/SZjkqatupTI/AAAAAAAAAHE/vVxnIfH61d0/s400/Strategy.jpg" style="cursor: hand; height: 243px; width: 400px;" /&gt;&lt;/a&gt;&lt;br /&gt;PS: Click on the image to enlarge.&lt;br /&gt;&lt;br /&gt;You can decouple more by using either factory or abstract factory pattern.&lt;br /&gt;SourceCode download ---&amp;gt; &lt;a href="http://dotnetdevblog.googlepages.com/StrategyPattern.zip"&gt;http://dotnetdevblog.googlepages.com/StrategyPattern.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Happy Programming!!!&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-3784595060292286051?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/3784595060292286051/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=3784595060292286051' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/3784595060292286051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/3784595060292286051'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2009/02/implementing-strategy-design-pattern.html' title='Implementing Strategy Design Pattern...'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_iUI-C9OjkTY/SZjkqatupTI/AAAAAAAAAHE/vVxnIfH61d0/s72-c/Strategy.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-5038575345504461851</id><published>2009-02-15T10:11:00.000-08:00</published><updated>2009-02-16T09:56:01.829-08:00</updated><title type='text'>Accessing Embedded Resources in an assembly....</title><content type='html'>Recently I was working on a project where..I had to embed some Config.Xml files in an assembly. That assembly was later on added to the main project.&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Accessing the resource:&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Step1: Add the resource and make the "BUILD Action" as embedded resource in Visual Studio.&lt;/div&gt;&lt;a href="http://2.bp.blogspot.com/_iUI-C9OjkTY/SZhdAS2CSsI/AAAAAAAAAGk/GWswK1FiCMg/s1600-h/EmbedResourc.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5303090820868623042" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 243px" alt="" src="http://2.bp.blogspot.com/_iUI-C9OjkTY/SZhdAS2CSsI/AAAAAAAAAGk/GWswK1FiCMg/s400/EmbedResourc.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;PS: Click on the image, to View the Code..&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Step2: Use Reflector to get the resource Name.&lt;/div&gt;&lt;div&gt;Step3: Load the assembly .. and use the method "GetManifestResouceStream" to access the resource..&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Assembly assembly = Assembly.Load("MyLib");&lt;br /&gt;Stream st = assembly.GetManifestResourceStream("MyLib.Config.Config.xml");&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Its a nice way to access embedded resources from the build..&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Happy Programming!!!&lt;/div&gt;&lt;div&gt;Yash&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-5038575345504461851?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/5038575345504461851/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=5038575345504461851' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/5038575345504461851'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/5038575345504461851'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2009/02/accessing-embedded-resources-in.html' title='Accessing Embedded Resources in an assembly....'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_iUI-C9OjkTY/SZhdAS2CSsI/AAAAAAAAAGk/GWswK1FiCMg/s72-c/EmbedResourc.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-2860353371790237123</id><published>2009-01-28T15:28:00.000-08:00</published><updated>2009-01-28T15:31:51.851-08:00</updated><title type='text'></title><content type='html'>Hello... today I found an interesting class ...PostBackOption class from the&lt;br /&gt;System.Web.UI namespace.  PostBackOption's is interesting becuase it lets you create controls like&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-2860353371790237123?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/2860353371790237123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=2860353371790237123' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/2860353371790237123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/2860353371790237123'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2009/01/hello.html' title=''/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-7688040039054240056</id><published>2009-01-18T15:01:00.000-08:00</published><updated>2009-01-18T16:10:57.709-08:00</updated><title type='text'>Different implementation of StateBag</title><content type='html'>I am going to show some different implementations of StateBag... many times while developing .Net Application, you need to pass some data from one function to another for eg:&lt;br /&gt;&lt;br /&gt;A() -&gt; B() --&gt; C()&lt;br /&gt;OR&lt;br /&gt;&lt;br /&gt;you want to keep data in some collection and spit it out during page rendering.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Instead of moving the data domain data from function to function, it is a good idea to put the data in the Application Context or in the StateBag.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;StateBag -- This is implentation is not a session implentation but its global becuase I am making the stateBag a static variable.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_iUI-C9OjkTY/SXO6pj4TfII/AAAAAAAAAFc/AEGNeMmWhNE/s1600-h/StateBag.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5292779210259266690" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 243px" alt="" src="http://3.bp.blogspot.com/_iUI-C9OjkTY/SXO6pj4TfII/AAAAAAAAAFc/AEGNeMmWhNE/s400/StateBag.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;PS:Click on the image to enlarge&lt;br /&gt;&lt;br /&gt;StateBag1 implementation:&lt;br /&gt;&lt;p&gt;StateBag1 is a good implementation which exposes a property which will return the StateBag.. The StateBag is stored in the HttpContext. HttpContext provides a items collection where you can dump all your StateBag.This implementation will only work in web centric senario as HttpContext is not available in non web centric application.&lt;br /&gt;&lt;/p&gt;&lt;a href="http://2.bp.blogspot.com/_iUI-C9OjkTY/SXO7tvoiagI/AAAAAAAAAFk/j85GUe31wlY/s1600-h/StateBag1.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5292780381645466114" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 243px" alt="" src="http://2.bp.blogspot.com/_iUI-C9OjkTY/SXO7tvoiagI/AAAAAAAAAFk/j85GUe31wlY/s400/StateBag1.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;StateBag2 implementation:&lt;br /&gt;&lt;br /&gt;This implementation is similar to StateBag1 but can be used in non web-centric as it uses the CallContext object if HttpContext is not available.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_iUI-C9OjkTY/SXO8jyg743I/AAAAAAAAAFs/6975I8mEok4/s1600-h/StateBag2.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5292781310131823474" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 243px" alt="" src="http://4.bp.blogspot.com/_iUI-C9OjkTY/SXO8jyg743I/AAAAAAAAAFs/6975I8mEok4/s400/StateBag2.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Creating your ApplicationContext:&lt;/p&gt;&lt;p&gt;This is bascially a wrapper class around the HttpContext. You can store this AppContext object in the CallContext, this way only one instance is created per thread.I like this implementation a lot.&lt;/p&gt;&lt;a href="http://4.bp.blogspot.com/_iUI-C9OjkTY/SXO9TEcOhHI/AAAAAAAAAF0/L9EQwCeV9XY/s1600-h/MyAppContext.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5292782122397762674" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 250px" alt="" src="http://4.bp.blogspot.com/_iUI-C9OjkTY/SXO9TEcOhHI/AAAAAAAAAF0/L9EQwCeV9XY/s400/MyAppContext.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;You need to searlize this StateBag before the page renders as a hidden string. When postBack happens that time you need to desearlize the StateBag to get the parameters back.&lt;br /&gt;&lt;br /&gt;If you want to download the SourceCode ---&gt; &lt;a class="tr_pseudo-link" id="tr_site-url" onclick="TR_execViewLive('');" href="http://dotnetdevblog.googlepages.com/WebApplication1.Zip"&gt;http://DotNetDevBlog.googlepages.com/WebApplication1.Zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I hope you like the implentations :)&lt;br /&gt;&lt;br /&gt;Happy Coding!!&lt;br /&gt;Yash&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-7688040039054240056?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/7688040039054240056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=7688040039054240056' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/7688040039054240056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/7688040039054240056'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2009/01/different-implementation-of-statebag.html' title='Different implementation of StateBag'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_iUI-C9OjkTY/SXO6pj4TfII/AAAAAAAAAFc/AEGNeMmWhNE/s72-c/StateBag.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-3629348292654538086</id><published>2009-01-17T13:27:00.000-08:00</published><updated>2009-01-29T14:24:08.003-08:00</updated><title type='text'>Adding Reflector as External Tool in Visual Studio</title><content type='html'>I spend most of my dev time in Visual Studio. I hate to go out of VS and open some other programs like fiddler or reflector. In Visual studio you can easily add the tools that you use a lot by adding these tools as external tools.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;All you have to do is go to Tools-&gt;External Tools, configure your tool over there ... Heres a screen shot of to configure Reflector in Visual Studio..&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_iUI-C9OjkTY/SYIr6WqEuUI/AAAAAAAAAGc/UO84uokAr64/s1600-h/CropperCapture%5B1%5D.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5296844393255582018" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 388px" alt="" src="http://2.bp.blogspot.com/_iUI-C9OjkTY/SYIr6WqEuUI/AAAAAAAAAGc/UO84uokAr64/s400/CropperCapture%5B1%5D.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thats it.... next time you want to use the reflector... all you have to do is go to tools and select Reflector.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-3629348292654538086?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/3629348292654538086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=3629348292654538086' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/3629348292654538086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/3629348292654538086'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2009/01/i-spend-most-of-my-dev-time-in-visual.html' title='Adding Reflector as External Tool in Visual Studio'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_iUI-C9OjkTY/SYIr6WqEuUI/AAAAAAAAAGc/UO84uokAr64/s72-c/CropperCapture%5B1%5D.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-1189464186454048821</id><published>2008-12-27T16:36:00.000-08:00</published><updated>2011-11-25T20:41:41.214-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><title type='text'>Tools I use....</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;Today, I am going to list the tools that I use often in my day to day development activities.&lt;br /&gt;&lt;br /&gt;1)Reflector&lt;br /&gt;2)Notepad++&lt;br /&gt;3)Fiddler2&lt;br /&gt;4)LinqPad&lt;br /&gt;5)SOAP UI&lt;br /&gt;6)WCF Trace Viewer&lt;br /&gt;7)Firebug&lt;br /&gt;8)IE development toolbar&lt;br /&gt;9)curl -- command line utility for http&lt;br /&gt;10) Live Headers (FireFox plugin)&lt;br /&gt;11) WinDbg&lt;br /&gt;12)DebugView&lt;br /&gt;13)PowerShell &lt;br /&gt;14) FoxIt Reader for PDF.&lt;br /&gt;15)Process Monitor&lt;br /&gt;Happy holidays!!!&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-1189464186454048821?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/1189464186454048821/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=1189464186454048821' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/1189464186454048821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/1189464186454048821'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2008/12/tools-i-use.html' title='Tools I use....'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-3552991010166116747</id><published>2008-12-07T16:34:00.000-08:00</published><updated>2010-04-04T11:20:00.484-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><title type='text'>Fiddler with ASP.Net Development Server...</title><content type='html'>Fiddler is one a tool that I use very often while debugging,to see what paramaters are going in the request etc....&lt;br /&gt;&lt;br /&gt;Today I was doing some Custom Server Control development, where I was passing some paramaters using Http POST.I thought that Fiddler will automatically capture the request to the dev server, but it doesnt.&lt;br /&gt;&lt;br /&gt;If you are doing any dev work on the ASP.Net Development and want to use fiddler -- try this.&lt;br /&gt;&lt;br /&gt;Suppose the url is: &lt;a href="http://localhost:1203/MyApp/Default.aspx"&gt;http://localhost:1203/MyApp/Default.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;if you just try to capture the request using Fiddler it wont work, you need to change the&lt;br /&gt;url to: &lt;a href="http://localhost.:1203/MyApp/Default.aspx"&gt;http://localhost.:1203/MyApp/Default.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Just append "." after localhost&lt;br /&gt;&lt;br /&gt;Nice little info....&lt;br /&gt;&lt;br /&gt;Enjoy!!!&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-3552991010166116747?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/3552991010166116747/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=3552991010166116747' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/3552991010166116747'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/3552991010166116747'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2008/12/fiddler-with-aspnet-development-server.html' title='Fiddler with ASP.Net Development Server...'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-567505862141296543</id><published>2008-10-11T13:29:00.000-07:00</published><updated>2011-11-24T22:39:35.042-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Utility'/><title type='text'>Commands that I use Everyday</title><content type='html'>Today I am going to list some of the commands that I use all the time while coding... You can type these commands in the Run Prompt.&lt;br /&gt;&lt;br /&gt;1) For Windows Server 2003:&lt;br /&gt;&lt;br /&gt;a) tsadmin (Terminal Services Manager) ---&amp;gt; Used to connect to a computer and see who has logged in, to logoff the users.. etc.&lt;br /&gt;b) qwinsta /server:servername ---&amp;gt; to query windows station.&lt;br /&gt;This is a command line tool that I use to see who has logged into a particular machine...&lt;br /&gt;c) rwinsta ID /server:servername ---&amp;gt; Used to logoff an user from a particular server based on the ID.&lt;br /&gt;First get the ID of a particular user using qwinsta and then logoff the user using rqinsta.&lt;br /&gt;d) mstsc -- to launch the remote desktop connection.&lt;br /&gt;e)inetmgr -- to launch IIS&lt;br /&gt;f)devenv -- to lauch visual stuido 2005 and 2008.&lt;br /&gt;g)lusrmgr.msc -- Used for adding a New User or adding a existing user to a group.&lt;br /&gt;h)query --- to query a session etc..&lt;br /&gt;&lt;br /&gt;2)Windows Server 2008&lt;br /&gt;The only command that has changed from the windows server 2003 is&lt;br /&gt;a) tsadmin.msc .... now you have to add the .msc extension to launch the Terminal Services Manager..&lt;br /&gt;&lt;br /&gt;3)Visual Studio Commands&lt;br /&gt;a) Control + "." to add the usings&lt;br /&gt;b)Control + Alt + "D" --- to view all the breakPoints set in the application&lt;br /&gt;c)Alt + Enter -- to view the properties window&lt;br /&gt;d) Ctrl + Alt + "F" -- to search for some string in the entire solution&lt;br /&gt;e)Ctrl + "F" -- to search for some string in the current file&lt;br /&gt;f) shift + F12 -- to find all the references for a function.&lt;br /&gt;g) Getting VisualStudio CommandPrompt -- Control + W + A&lt;br /&gt;h)Go to LineNumber in code-- &amp;gt; Control + G&lt;br /&gt;i) Open folder in VisualStudio -- &amp;gt; Control + O&lt;br /&gt;j)Go to defition of a fucntion etc - F12&lt;br /&gt;k)Formating Code - Control + K + D&lt;br /&gt;&lt;br /&gt;4) windows general shortCuts I use&lt;br /&gt;a) wins..Key + "R" to get the Run prompt.. very use full for me&lt;br /&gt;b) wins..Key + "D" to get to the Desktop&lt;br /&gt;c) Control Panel -- at the Run prompt type .. control&lt;br /&gt;d) Add remove features -- at the Run prompt type control appwiz.cpl&lt;br /&gt;&lt;br /&gt;5)VisualStudio Command Prompt --&lt;br /&gt;a)np -- add a new project&lt;br /&gt;b)props - open Properties Window&lt;br /&gt;c)View.SolutionExplorer -- for viewing solution explorer&lt;br /&gt;d) open filename -- to open a file from command prompt&lt;br /&gt;&lt;br /&gt;6) Utility Commands&lt;br /&gt;&lt;br /&gt;a) Adding/Deleting a user as a admin on a box.&lt;br /&gt;net localgroup Administrators /Add domain\username&lt;br /&gt;net localgroup administrators /delete domain\username&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Happy Coding!!!&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-567505862141296543?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/567505862141296543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=567505862141296543' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/567505862141296543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/567505862141296543'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2008/10/commands-that-i-use-everyday.html' title='Commands that I use Everyday'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-8346385169311295054</id><published>2008-10-07T14:37:00.000-07:00</published><updated>2010-04-04T11:20:41.650-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Design Pattern'/><title type='text'>Implementing Factory Pattern using  Reflection and Singleton Pattern</title><content type='html'>Today I want to demonstrate how to implement Factory pattern using Reflection...&lt;br /&gt;&lt;br /&gt;Important point that should be considered whenever you write code&lt;br /&gt;1) Keep the coupling between components as low as possible --&lt;br /&gt;&lt;br /&gt;what this means is when you write components, you should always try to keep the code independent of the other components. It should be testable by itself. It should be reusable without the need of other components.&lt;br /&gt;&lt;br /&gt;One of the standard technique that lot of people use to reduce the coupling is by using the Factory Pattern.&lt;br /&gt;&lt;br /&gt;Generally use the "new" keyword to instantiate a class, but my doing so we make our code dependent on that object.&lt;br /&gt;Factory pattern separates the creation and initialization of object.&lt;br /&gt;&lt;br /&gt;To demonstrate this,&lt;br /&gt;Lets see the class diagram&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_iUI-C9OjkTY/SOv9oNC_m9I/AAAAAAAAAE0/7RXtS8gB8tI/s1600-h/FactoryClassDiagram.jpg.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5254572257396628434" src="http://1.bp.blogspot.com/_iUI-C9OjkTY/SOv9oNC_m9I/AAAAAAAAAE0/7RXtS8gB8tI/s400/FactoryClassDiagram.jpg.jpg" style="cursor: pointer;" /&gt;&lt;/a&gt;&lt;br /&gt;PS: Please click on the image to see the image contents.&lt;br /&gt;&lt;br /&gt;Computer is an abstract base class and different computers like (BrandXComputer or ConcreteComputer) inherit from this interface. Computer as an abstract property called Mhz. Different derived classed will override this property.&lt;br /&gt;&lt;br /&gt;Similarly, there is an Abstract class called ComputerFactory, it has an abstract method called "GetFactory". Every class you create will have a corresponding concretefactory class which will return an instance of the corresponding Concrete Computer class. Each concrete factory has a Singleton implementation i.e only one instance of these classes are created. This make sense here as we dont want to instantiate the Factory class everyone.. which will be a wastage of memory.&lt;br /&gt;&lt;br /&gt;Alright, till now what we have done is standard factory implementation. It gets interesting when you actually get an instance of the factory. The way this is implemented is through Reflection.&lt;br /&gt;&lt;br /&gt;All the concrete factories that you need are kept in the App.Config Files...&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_iUI-C9OjkTY/SOv_5tjgxwI/AAAAAAAAAE8/zmcu-2OP6UM/s1600-h/AppConfigFactorySettings.jpg.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5254574757203986178" src="http://4.bp.blogspot.com/_iUI-C9OjkTY/SOv_5tjgxwI/AAAAAAAAAE8/zmcu-2OP6UM/s400/AppConfigFactorySettings.jpg.jpg" style="cursor: pointer;" /&gt;&lt;/a&gt;&lt;br /&gt;PS: Please click on the image to see the image contents.&lt;br /&gt;&lt;br /&gt;In the config file bascially we keep all the entries of the concrete factory along with their types i.e class names.&lt;br /&gt;&lt;br /&gt;There is one more class which is very important in this whole setup and that class is -- ComputerFactories.&lt;br /&gt;&lt;br /&gt;Computer factories has one Static method GetFactory which will take the factoryname (i.e key from the app.config file) , from that it will get the type of the factory and using FieldInfo class it will get that singleton instance we created. Reflection is a very powerful and it has been extensively used in the .Net Base Class Library.&lt;br /&gt;&lt;br /&gt;As you can see we, the client code doesnt need to know anything about the Computer Object instantiation or initialization. The code is not tightly coupled.&lt;br /&gt;&lt;br /&gt;To download the SourceCode -- &lt;a href="http://dotnetdevblog.googlepages.com/FactoryPatternImplementation.rar"&gt;Click Here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Happy Programming!!!&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-8346385169311295054?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/8346385169311295054/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=8346385169311295054' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/8346385169311295054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/8346385169311295054'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2008/10/implementing-factory-and-singleton.html' title='Implementing Factory Pattern using  Reflection and Singleton Pattern'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_iUI-C9OjkTY/SOv9oNC_m9I/AAAAAAAAAE0/7RXtS8gB8tI/s72-c/FactoryClassDiagram.jpg.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-1233236222299555087</id><published>2008-10-04T15:43:00.000-07:00</published><updated>2008-10-05T17:10:26.193-07:00</updated><title type='text'>Great Plugin for Xml Debugging... Xml Visualizer v.2</title><content type='html'>While going through the CodePlex website (one of my fvt website) I found this new Visualizer for Xml.&lt;br /&gt;&lt;br /&gt;Its a great plugin that you have to copy paste  in the "MyDocument\Visual Studio(2005/2008)\Visualizers" directory.&lt;br /&gt;&lt;br /&gt;I really wanted a tool where I can just load the Xml into memory and play with the XPath Queries.This visualizer lets me do that and more.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_iUI-C9OjkTY/SOf2ghcdnPI/AAAAAAAAAEU/vsdj6sY4Ag8/s1600-h/XmlVisualizer2+ScreenShot1.Bmp"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_iUI-C9OjkTY/SOf2ghcdnPI/AAAAAAAAAEU/vsdj6sY4Ag8/s400/XmlVisualizer2+ScreenShot1.Bmp" alt="" id="BLOGGER_PHOTO_ID_5253438528944970994" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;PS: Please click on the image to view the contents of the image.&lt;br /&gt;&lt;br /&gt;1) I can easily add  a XPath Query and check the results.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_iUI-C9OjkTY/SOf30C9IaYI/AAAAAAAAAEc/sZLukSt_bbA/s1600-h/XpathQuery.bmp.Bmp"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_iUI-C9OjkTY/SOf30C9IaYI/AAAAAAAAAEc/sZLukSt_bbA/s400/XpathQuery.bmp.Bmp" alt="" id="BLOGGER_PHOTO_ID_5253439963869505922" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;PS: Please click on the image to view the contents of the image.&lt;br /&gt;&lt;br /&gt;As you can see in this screenshot I have added a XPathQuery  and you can see the results in the output. Very nice feature while debugging.... or if you are doing some xml parsing.&lt;br /&gt;&lt;br /&gt;2) I can see the xml output in a browser.&lt;br /&gt;&lt;br /&gt;3) I can create StyleSheets and use them to style my Xml file contents.&lt;br /&gt;&lt;br /&gt;You can download the XmlVisualizer 2.0 from CodePlex.&lt;br /&gt;&lt;br /&gt;Link --&gt; &lt;a href="http://www.codeplex.com/XmlVisualizer"&gt;Download Location&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I think developers can be definitely more productive if they use this tool.&lt;br /&gt;&lt;br /&gt;Happy Programming!!!&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-1233236222299555087?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/1233236222299555087/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=1233236222299555087' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/1233236222299555087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/1233236222299555087'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2008/10/great-plugin-for-xml-debugging-xml.html' title='Great Plugin for Xml Debugging... Xml Visualizer v.2'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_iUI-C9OjkTY/SOf2ghcdnPI/AAAAAAAAAEU/vsdj6sY4Ag8/s72-c/XmlVisualizer2+ScreenShot1.Bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-4108125159889212662</id><published>2008-09-19T11:09:00.000-07:00</published><updated>2008-11-27T16:19:41.764-08:00</updated><title type='text'>How to Query Active Directory for Users and Groups..</title><content type='html'>Last couple of months I was really busy working on a small ASP.Net project from scratch....&lt;br /&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;Alright... enough of that.Lets get to the Code....&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;First of all I want to show you guys how I divided the whole application into small components... here's is a screen shot of the app...&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://1.bp.blogspot.com/_iUI-C9OjkTY/SNPunk_xPfI/AAAAAAAAADw/gFUxVSr166Y/s1600-h/Components.Bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5247800354530213362" alt="" src="http://1.bp.blogspot.com/_iUI-C9OjkTY/SNPunk_xPfI/AAAAAAAAADw/gFUxVSr166Y/s400/Components.Bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;PS: Please click on the image to view the contents.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Each component is a stand alone component for a specific purpose....&lt;br /&gt;So.. lets get into the Auth component...&lt;/div&gt;&lt;br /&gt;&lt;div&gt;We had a requirement where we wanted to Authenticate a user against the Active Directory...basically certain pages were not visible to certain groups...&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Querying Active Directory in c# is very easy task.. but before that if you are not familiar with the structure of your active directory you can install a great utility from Microsoft called ldp.exe.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;I tried it to see what is the structure of our Active Directory.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;So basically to query an Active Directory you need a ldappath... like&lt;/div&gt;&lt;div&gt;&lt;a href="ldap://NXdfsdfqwM03.ABC150.org/DC=ABC150,DC=org"&gt;LDAP://NXdfsdfqwM03.ABC150.org/DC=ABC150,DC=org&lt;/a&gt; , A username and password who has access to this Active Directory.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Now to get All the Users in a particular Group this is the code...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This function bascially calls the GetUserByGroup which in turn calls the GetUserDetails function where I am querying the active directory for a particular user.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://3.bp.blogspot.com/_iUI-C9OjkTY/SNPxmI3NgUI/AAAAAAAAAD4/kiLpy-eR39M/s1600-h/GetAllUsers.Bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5247803628333138242" alt="" src="http://3.bp.blogspot.com/_iUI-C9OjkTY/SNPxmI3NgUI/AAAAAAAAAD4/kiLpy-eR39M/s400/GetAllUsers.Bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;PS: Please click on the image to view contents...&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_iUI-C9OjkTY/SOf8ovG89yI/AAAAAAAAAEk/6p9ztg5kf84/s1600-h/GetApplicationUsersByGroup.jpg.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5253445267121567522" style="CURSOR: pointer" alt="" src="http://4.bp.blogspot.com/_iUI-C9OjkTY/SOf8ovG89yI/AAAAAAAAAEk/6p9ztg5kf84/s400/GetApplicationUsersByGroup.jpg.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;PS: Please click on the image to view contents...&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_iUI-C9OjkTY/SOf97V-JEEI/AAAAAAAAAEs/mTHRwP7Syxw/s1600-h/GetUserDetails.jpg.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5253446686302867522" style="CURSOR: pointer" alt="" src="http://4.bp.blogspot.com/_iUI-C9OjkTY/SOf97V-JEEI/AAAAAAAAAEs/mTHRwP7Syxw/s400/GetUserDetails.jpg.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;PS:Please click on the image to view contents...&lt;br /&gt;&lt;br /&gt;Important classes are DirectoryEntry, DirectorySearcher, DirectoryEntires.. etc.&lt;br /&gt;&lt;br /&gt;I hope this gives a basic idea about how to query an Active Directory.&lt;br /&gt;&lt;br /&gt;Happy Programming!!!&lt;br /&gt;Yash&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-4108125159889212662?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/4108125159889212662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=4108125159889212662' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/4108125159889212662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/4108125159889212662'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2008/09/how-to-query-active-directory-for-users.html' title='How to Query Active Directory for Users and Groups..'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_iUI-C9OjkTY/SNPunk_xPfI/AAAAAAAAADw/gFUxVSr166Y/s72-c/Components.Bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-1142559938577269907</id><published>2008-09-11T15:38:00.000-07:00</published><updated>2008-09-22T18:35:11.247-07:00</updated><title type='text'>Pics from the Trip to Philadelphia,PA</title><content type='html'>Check out the pics at ... &lt;a href="http://picasaweb.google.com/DotNetDevBlog/PATrip"&gt;http://picasaweb.google.com/DotNetDevBlog/PATrip&lt;/a&gt;#&lt;br /&gt;&lt;br /&gt;Enjoy!!!&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-1142559938577269907?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/1142559938577269907/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=1142559938577269907' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/1142559938577269907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/1142559938577269907'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2008/09/pics-from-trip-to-philadelphiapa.html' title='Pics from the Trip to Philadelphia,PA'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-2366427409072611188</id><published>2008-07-05T21:42:00.000-07:00</published><updated>2008-07-05T21:47:51.632-07:00</updated><title type='text'>Foundation of Programming free e-book</title><content type='html'>Last week while watching Channel 9 video, I came across this  good free e-book (Foundation of Programming) from  Karl &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Seguin&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Download it and read it, really good book. I have not covered even 50 % of it, but I love the things that he has explained like ... mock objects,TDD, Dependency injection  etc.&lt;br /&gt;&lt;br /&gt;Initially its bit tough but very useful in long run.&lt;br /&gt;&lt;br /&gt;Grab it!!!!&lt;br /&gt;&lt;br /&gt;http://codebetter.com/files/folders/codebetter_downloads/entry179694.aspx&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;Yash&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-2366427409072611188?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/2366427409072611188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=2366427409072611188' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/2366427409072611188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/2366427409072611188'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2008/07/foundation-of-programming-free-e-book.html' title='Foundation of Programming free e-book'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-6241275689909088620</id><published>2008-06-30T22:05:00.000-07:00</published><updated>2011-05-07T12:19:30.191-07:00</updated><title type='text'>Lambda Expression</title><content type='html'>Lambda Expression -- introduced by Microsoft in C# 3.0 is a very fascinating topic. It has been extensively used in LINQ(Language Intergrated Query).&lt;br /&gt;&lt;br /&gt;So, what is Lambda Expression?&lt;br /&gt;&lt;br /&gt;Lambda Expression is basically nothing but an anonymous function.&lt;br /&gt;&lt;br /&gt;In .Net 1.1 we used to create delegates using delegate type. Delegate is a type safe datatype which contains a reference to a function.&lt;br /&gt;Eg:&lt;br /&gt;&lt;a href="http://bp3.blogger.com/_iUI-C9OjkTY/SGm-un1engI/AAAAAAAAABQ/mSkb8qzJFpM/s1600-h/CropperCapture%5B1%5D.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5217911351461977602" src="http://bp3.blogger.com/_iUI-C9OjkTY/SGm-un1engI/AAAAAAAAABQ/mSkb8qzJFpM/s400/CropperCapture%5B1%5D.jpg" style="cursor: pointer;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;.Net 2.0 introduced the concept of Anonymous delegates. what is means is you can write the whole function inline. This makes the code more readable and you don't have to define instance or static methods.&lt;br /&gt;Eg:&lt;br /&gt;&lt;a href="http://bp3.blogger.com/_iUI-C9OjkTY/SGnA2mnO_EI/AAAAAAAAABg/8RmwmimsI5E/s1600-h/CropperCapture%5B4%5D.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5217913687596006466" src="http://bp3.blogger.com/_iUI-C9OjkTY/SGnA2mnO_EI/AAAAAAAAABg/8RmwmimsI5E/s400/CropperCapture%5B4%5D.jpg" style="cursor: pointer;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;As you can see the code is readable and concise.&lt;br /&gt;&lt;br /&gt;In C# 3.0 the concept of anonymous delegates has been taken to the next level by adding lambda expression.&lt;br /&gt;&lt;br /&gt;Lambda expression uses an operator ( =&amp;gt;) which should be read as "goes to".&lt;br /&gt;Eg:&lt;br /&gt;&lt;a href="http://bp0.blogger.com/_iUI-C9OjkTY/SGnCTSI8mUI/AAAAAAAAABo/t3KWEtllSbo/s1600-h/CropperCapture%5B5%5D.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5217915279828097346" src="http://bp0.blogger.com/_iUI-C9OjkTY/SGnCTSI8mUI/AAAAAAAAABo/t3KWEtllSbo/s400/CropperCapture%5B5%5D.jpg" style="cursor: pointer;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;As you can see the code is very elegant and the IL(intermediate language) generated by all the 3 ways of using delegates is the same. So the point to understand here is that the complier will generate exactly the same IL for all the 3 implementations so we don't need a new runtime for executing this code. .Net 2.0 runtime will be able to execute this code for us.&lt;br /&gt;&lt;br /&gt;Lambda's can be expression or statements. Lambda statement are nothing but a group of c# statements clubbed together.&lt;br /&gt;&lt;br /&gt;IL generate by instance methods:&lt;br /&gt;&lt;a href="http://bp1.blogger.com/_iUI-C9OjkTY/SGnEZL4qMfI/AAAAAAAAABw/5oDsQeEJIco/s1600-h/CropperCapture%5B6%5D.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5217917580251640306" src="http://bp1.blogger.com/_iUI-C9OjkTY/SGnEZL4qMfI/AAAAAAAAABw/5oDsQeEJIco/s400/CropperCapture%5B6%5D.jpg" style="cursor: pointer;" /&gt;&lt;/a&gt;&lt;br /&gt;IL generated by anonymous delegates (.Net 2.0)&lt;br /&gt;&lt;a href="http://bp1.blogger.com/_iUI-C9OjkTY/SGnEe6g33OI/AAAAAAAAAB4/DKkiD_EMeWI/s1600-h/CropperCapture%5B7%5D.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5217917678667685090" src="http://bp1.blogger.com/_iUI-C9OjkTY/SGnEe6g33OI/AAAAAAAAAB4/DKkiD_EMeWI/s400/CropperCapture%5B7%5D.jpg" style="cursor: pointer;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;IL generated by Lambda Expression&lt;br /&gt;&lt;a href="http://bp3.blogger.com/_iUI-C9OjkTY/SGnF88uV3TI/AAAAAAAAACI/Dg65Fjt-_dE/s1600-h/CropperCapture%5B8%5D.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5217919294168751410" src="http://bp3.blogger.com/_iUI-C9OjkTY/SGnF88uV3TI/AAAAAAAAACI/Dg65Fjt-_dE/s400/CropperCapture%5B8%5D.jpg" style="cursor: pointer;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dotnetdevblog.googlepages.com/LambdaExpressionExplained.zip"&gt;&lt;span style="text-decoration: underline;"&gt;Click here to download the SourceCode:&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I hope this will help you understand what Lambda expressions are.&lt;br /&gt;&lt;br /&gt;One of the many cool things you can do with lambda expression/Anonymous Methods&amp;nbsp;is it gives seperation of concern. Since you are passing a function as data, you have the liberty of executing that function anytime.&lt;br /&gt;&lt;br /&gt;For eg: I wanted a to write a function to print out all the elements in a list to Console. I took this approach.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-UEDiok0yD6s/TcWbGJMggkI/AAAAAAAAAOM/b48kRpx_U2E/s1600/Generic+Methods.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="233" j8="true" src="http://2.bp.blogspot.com/-UEDiok0yD6s/TcWbGJMggkI/AAAAAAAAAOM/b48kRpx_U2E/s640/Generic+Methods.PNG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;Thanks,&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-6241275689909088620?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/6241275689909088620/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=6241275689909088620' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/6241275689909088620'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/6241275689909088620'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2008/06/lambda-expression.html' title='Lambda Expression'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_iUI-C9OjkTY/SGm-un1engI/AAAAAAAAABQ/mSkb8qzJFpM/s72-c/CropperCapture%5B1%5D.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-7768825142502007110</id><published>2008-06-29T14:13:00.000-07:00</published><updated>2008-06-29T16:31:05.890-07:00</updated><title type='text'>How to Read custom entries from the Web.Config/App.Config file</title><content type='html'>Today I am going to blog about "How to read custom entries from the Web.Config/App.Config file."&lt;br /&gt;&lt;br /&gt;Working as a .Net Developer, there will be many occasions when we want to store some data (Maybe Key/Value Pair) in the configuration file but we dont want to add to the AppSettings. In such situations, I have always found is very easy to store my Config entires in the Custom Config sections in Web.Config files.&lt;br /&gt;&lt;br /&gt;I want to read the custom section shown below.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bp2.blogger.com/_iUI-C9OjkTY/SGgT1OGIi7I/AAAAAAAAAA4/6m9BqXKYDKM/s1600-h/CustomSection.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5217441973346536370" style="CURSOR: hand" alt="" src="http://bp2.blogger.com/_iUI-C9OjkTY/SGgT1OGIi7I/AAAAAAAAAA4/6m9BqXKYDKM/s400/CustomSection.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The idea behind reading or writing to the config files is that -- "You should tell the framework how you want your data to be Serialized/Deserialized.&lt;br /&gt;&lt;br /&gt;In .Net 2.0 made it very easy to Read/Write config data into the configuration file by providing the functionality in System.Configuration.dll.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bp0.blogger.com/_iUI-C9OjkTY/SGgWH7Q34RI/AAAAAAAAABI/EXBzBY2loUc/s1600-h/ConfigSection1.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5217444493732077842" style="CURSOR: hand" alt="" src="http://bp0.blogger.com/_iUI-C9OjkTY/SGgWH7Q34RI/AAAAAAAAABI/EXBzBY2loUc/s400/ConfigSection1.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Add the entry shown above, in the ConfigSection so that framework can create an instance of the class at runtime using reflection.&lt;br /&gt;&lt;br /&gt;I have attached the SourceCode for this application.&lt;br /&gt;&lt;br /&gt;Source Code Loc:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dotnetdevblog.googlepages.com/ReadCustomConfigSections.zip"&gt;http://dotnetdevblog.googlepages.com/ReadCustomConfigSections.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you like/dislike something, feel free to leave comments.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-7768825142502007110?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/7768825142502007110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=7768825142502007110' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/7768825142502007110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/7768825142502007110'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2008/06/how-to-read-custom-entries-from.html' title='How to Read custom entries from the Web.Config/App.Config file'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_iUI-C9OjkTY/SGgT1OGIi7I/AAAAAAAAAA4/6m9BqXKYDKM/s72-c/CustomSection.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-1809796361051511451</id><published>2008-05-31T18:28:00.000-07:00</published><updated>2008-06-18T15:26:15.016-07:00</updated><title type='text'>Tools to Write Solid code!!!</title><content type='html'>Today I am going to blog about two important tools most of the developers should have to write solid code.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1)FxCop&lt;br /&gt;&lt;br /&gt;This is a free tool from Microsoft which will run through your .dll files and will point out where yo have made design mistakes or where you have violated coding standards.&lt;br /&gt;&lt;br /&gt;I started to use this tool sometime back and its really neat.&lt;br /&gt;&lt;br /&gt;I would recommend other software developer to use this tool.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2)Stylecop or Source Analysis.&lt;br /&gt;&lt;br /&gt;Very nice tool from Microsoft which is free now. Get a copy. It is integrated with visual studio .&lt;br /&gt;&lt;br /&gt;Just run it and make your code more readable and pretty.&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;Happy Programming!!!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;Yash&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-1809796361051511451?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/1809796361051511451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=1809796361051511451' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/1809796361051511451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/1809796361051511451'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2008/05/tools-to-write-solid-code.html' title='Tools to Write Solid code!!!'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-2369746926494453105</id><published>2008-05-31T15:35:00.000-07:00</published><updated>2008-06-18T15:28:33.094-07:00</updated><title type='text'>How to Write Solid Piece of Code</title><content type='html'>The most important point to consider while designing and writing code&lt;br /&gt;&lt;br /&gt;1) Always design code in such a way that it is Open for extension but Closed for modification.&lt;br /&gt;&lt;br /&gt;i.e when a new requirement comes don't add new code to the classes that work but create new classes to fulfill those requirement . i.e the previous code is locked.&lt;br /&gt;&lt;br /&gt;The more code code you add to the existing working code the more possibility of introducing new bugs and ofcourse you have to change the UnitTest Code too.&lt;br /&gt;&lt;br /&gt;ALWAYS TRY TO USE DESIGN PATTERN LIKE FACTORY,SINGLETON ETC.&lt;br /&gt;&lt;br /&gt;USE OOP CONCEPTS TO KEEP THE DEPENDENCY TO MINIMUM.&lt;br /&gt;&lt;br /&gt;I will give you an example here...&lt;br /&gt;&lt;br /&gt;Create a Abstract base class... and derive your classes from that i.e different version of classes.&lt;br /&gt;&lt;br /&gt;This way you can use the factory pattern and create the appropriate version of the classes depending upon the requirement.&lt;br /&gt;&lt;br /&gt;This way you keep the dependency to minimum.&lt;br /&gt;&lt;br /&gt;VERY USEFUL TECHNIQUE----&lt;br /&gt;&lt;br /&gt;2) ALWAYS GO BACK AND REFACTOR YOUR CODE (Very Important)&lt;br /&gt;&lt;br /&gt;As new requirement come always go back and try to refactor you code, create new classes, delegate functionality to different classes, this makes the individual code more testable.&lt;br /&gt;&lt;br /&gt;Very important while writing code.&lt;br /&gt;&lt;br /&gt;When you have implement something..&lt;br /&gt;&lt;br /&gt;a)Start with simple things... make then work as desired.&lt;br /&gt;b) Then go back and add new functionality to it.&lt;br /&gt;c) Side by Side your integration code should go on, i.e think about how you will integrate with you add i.e creating MSI, installers etc...&lt;br /&gt;&lt;br /&gt;If you write code this way, there are more chances of finding the edge cases and your code will be more solid. Always implement small components i.e small projects and then integrate with the main application.&lt;br /&gt;&lt;br /&gt;Don't code the whole thing in one shot, Very important concept to remember.&lt;br /&gt;&lt;br /&gt;When designing api's, try to separate out the common things from the things that differ. Designing good api is a very important thing in software developers life (atleast for me it is the single most important thing) .&lt;br /&gt;&lt;br /&gt;If you follow this, your code will definitely be more solid and testable.&lt;br /&gt;&lt;br /&gt;These are some of the points I learned from my Manager here in Redmond, WA.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;Update:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Before writing code two things to remember&lt;br /&gt;&lt;br /&gt;1) Code should be as testable as possible.&lt;br /&gt;2) Code should be reusable.&lt;br /&gt;&lt;br /&gt;Consider each functionality as a seperate set of class.-- Always think how I can refactor this functionality into different set of classes. (Very important for good design.)&lt;br /&gt;&lt;br /&gt;Happy Programming!!!&lt;br /&gt;&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-2369746926494453105?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/2369746926494453105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=2369746926494453105' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/2369746926494453105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/2369746926494453105'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2008/05/how-to-write-solid-piece-of-code.html' title='How to Write Solid Piece of Code'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-5312474989482001822</id><published>2008-05-28T15:11:00.000-07:00</published><updated>2008-05-28T15:24:24.795-07:00</updated><title type='text'>Hello There!!!</title><content type='html'>Hello Friends,&lt;br /&gt;&lt;br /&gt;Its been a long time, I have not blogged. Lot of things happened during the last couple of months.&lt;br /&gt;&lt;br /&gt;Most important was I left my Job at Telecom Industry to join one of the biggest companies in software development.&lt;br /&gt;&lt;br /&gt;I loved my job back in Oklahoma but I had to make the tough decision as I am still learning lot of new things in software development and coming here in Seattle,WA was a very important decision in my life.&lt;br /&gt;&lt;br /&gt;I believe that no decision is right or wrong. Everything depends on the how we look at it.&lt;br /&gt;&lt;br /&gt;I struggled a lot here in Seattle initially, but now I have feel like I have come to terms with the new job.&lt;br /&gt;&lt;br /&gt;Learning curve is huge. Lot of new ways of builing apps, writing apps among other things.&lt;br /&gt;&lt;br /&gt;I miss my freinds in tulsa,OK but life goes on ...&lt;br /&gt;&lt;br /&gt;Will be writing some new blogs about the things I learnt here in Seattle, WA.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-5312474989482001822?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/5312474989482001822/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=5312474989482001822' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/5312474989482001822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/5312474989482001822'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2008/05/hello-from-software-developer.html' title='Hello There!!!'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-943553316025301740</id><published>2007-12-25T18:20:00.001-08:00</published><updated>2007-12-25T18:21:20.397-08:00</updated><title type='text'>Happy Xmas and Have a Great New Year....</title><content type='html'>Thank you for reading my post.. I wish you and your family a Happy Xmas and a prosperous New Year(2008!!!!!!)&lt;br /&gt;&lt;br /&gt;Happy Programming!!!&lt;br /&gt;&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-943553316025301740?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/943553316025301740/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=943553316025301740' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/943553316025301740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/943553316025301740'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2007/12/happy-xmas-and-have-great-new-year.html' title='Happy Xmas and Have a Great New Year....'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-6392433589275691863</id><published>2007-11-08T11:51:00.000-08:00</published><updated>2007-12-26T12:50:38.917-08:00</updated><title type='text'>How to Design UserInterface.... AND Custom Validation</title><content type='html'>1) While Designing the User Interface (Presentation Layer) always put all your controls in a Table.&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;br /&gt; &lt;tbody&gt;&lt;tr&gt;&lt;br /&gt;      &lt;td&gt; Place Control 1 Here ... &lt;/td&gt;&lt;br /&gt;      &lt;td&gt; Place Control 2 Here...  &lt;/td&gt;&lt;br /&gt; &lt;/tr&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;2) While designing the Web-Page make use of PlaceHolder Control. The advantage of this technique is that&lt;br /&gt;&lt;br /&gt;   a) You can Dynamically Load and Place the control at runtime... i.e Suppose you have a app- Setting Key/Value pair  in your web.config file --- which you can read in from the web.config file and depending upon what you get from the WeB.Config file you can select which control to  Load in the Palce Holder.&lt;br /&gt;&lt;br /&gt;  b) This gives a uniformity and Flexibility to get User-Interface Design.....&lt;br /&gt;&lt;br /&gt;  c) This way you can totally concentrate on creating the UserControl and not worry about the    Presentation Layer.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-------------------------CUSTOM Validator-------------------------------------------------&lt;br /&gt;&lt;br /&gt;With Custom Validator you get to validate the Control at the&lt;br /&gt;&lt;br /&gt;ServerSide -- By Creating a function OnServerValidate()&lt;br /&gt;ClientSide --  By writing a function in the ClientSideValidation()&lt;br /&gt;&lt;br /&gt;That all that it is...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Thanks,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Happy Programming!!!!!&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-6392433589275691863?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/6392433589275691863/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=6392433589275691863' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/6392433589275691863'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/6392433589275691863'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2007/11/how-to-design-userinterface-and-custom.html' title='How to Design UserInterface.... AND Custom Validation'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-6131700561367873078</id><published>2007-10-31T12:03:00.001-07:00</published><updated>2008-05-28T15:28:02.632-07:00</updated><title type='text'>Asp.Net -- Informative URL's</title><content type='html'>--- This is a good informative Url for CrossPagePosting ---&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/msdnmag/issues/05/09/CuttingEdge/"&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;http://msdn.microsoft.com/msdnmag/issues/05/09/CuttingEdge/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(51,255,51)"&gt;&lt;span style="COLOR: rgb(0,0,0)"&gt;--- This is a good Informative Url for Asp.Net Page Life Cycle ---&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms178472.aspx"&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;http://msdn2.microsoft.com/en-us/library/ms178472.aspx&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(204,0,0)"&gt;Thanks,&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(204,0,0)"&gt;Happy Programming!!!&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-6131700561367873078?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/6131700561367873078/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=6131700561367873078' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/6131700561367873078'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/6131700561367873078'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2007/10/cross-page-posting.html' title='Asp.Net -- Informative URL&apos;s'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-7867754372432357052</id><published>2007-10-31T09:56:00.001-07:00</published><updated>2007-10-31T10:01:18.006-07:00</updated><title type='text'>Bulk Inserting from CSV file into a database</title><content type='html'>Here is the query you can use to Insert data from a CSV file into a Database.&lt;br /&gt;&lt;br /&gt;Bulk Insert [dbo].[TaxationExcludeTn]&lt;br /&gt;From 'C:\TestBulkInsertFile.csv'&lt;br /&gt;with&lt;br /&gt;(&lt;br /&gt;FIELDTERMINATOR = ',',    -- For Comma Seperated File&lt;br /&gt;RowTerminator = '\n',            -- RowTernimator i.e new Line&lt;br /&gt;FIELDTERMINATOR = '\t',  -- Tab Seperated File&lt;br /&gt;&lt;b&gt;FIRSTROW = 2&lt;/b&gt;,                    -- Ignore the First two rows  of the CSV File&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Thanks,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;HappyProgramming!!!!&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-7867754372432357052?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/7867754372432357052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=7867754372432357052' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/7867754372432357052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/7867754372432357052'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2007/10/bulk-inserting-from-csv-file-into.html' title='Bulk Inserting from CSV file into a database'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-3125076444177434102</id><published>2007-10-31T09:36:00.001-07:00</published><updated>2007-10-31T09:54:22.533-07:00</updated><title type='text'>Iterating through a TempTable/Table in SqlServer -- Just like cursor action</title><content type='html'>Here is the code for iterating through a Table in sequential manner....&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Step 1 --  Create a Temperory Table to send the data back from the Stored Procedure&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Create Table #Details&lt;br /&gt;(&lt;br /&gt; AddressId_Out int,&lt;br /&gt; ContactId_Out int,&lt;br /&gt; Tn_Out        char(20),&lt;br /&gt; TnCustomer_Out int,&lt;br /&gt; OrderId_Out    int&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Step 2 - Create a Temperory Table to hold the data which you want to iterate through in a sequential Manner....&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Create Table #OrderId_Table&lt;br /&gt;(&lt;br /&gt;OrderId int&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Step 3 - Insert into that table some data which you will be going through sequentially&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Insert into #OrderId_Table Select Order_Id from Orders_Tbl where  (End_Date is not null) AND (Start_Date &lt;= @ReportStartDateTime_In and End_Date &gt;= @ReportEndDateTime_In)  and Addr_Ind = 'S' and Ordr_Sts_Cd in ('5','8','9','10','11')&lt;br /&gt;&lt;br /&gt;Insert into #OrderId_Table Select Order_Id from Orders_Tbl where  (End_Date is null) AND  Start_Date &lt;= @ReportStartDateTime_In and Addr_Ind = 'S' and Ordr_Sts_Cd in ('5','8','9','10','11') &lt;br /&gt;&lt;br /&gt;Insert into #OrderId_Table Select Order_Id from Orders_Tbl where  (End_Date is not null) AND ( ( (Start_Date &gt; @ReportStartDateTime_In) AND (Start_Date &lt; @ReportEndDateTime_In) ) OR ( (End_Date &gt; @ReportStartDateTime_In) AND (End_Date &lt; @ReportEndDateTime_In)) ) AND Addr_Ind = 'S' AND Ordr_Sts_Cd in ('5','8','9','10','11') &lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Step 4 - Declare the variable which will hold the information in very sequential Move i.e value of the variable&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Declare @GetOrderId int&lt;br /&gt;&lt;br /&gt;Select @GetOrderId = OrderId from #OrderId_Table&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Step 5 - Iterate through the table using @@RowCount, get the entry from the temp Table, get the work done with that entry, delete that entry from the Temp Table...&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;While @@rowcount &lt;&gt; 0&lt;br /&gt;begin&lt;br /&gt; Set rowcount 0&lt;br /&gt; Declare @tempOrderId varchar(4)&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Step 6 -- This is where you get the work done with that variable which stores the value of the first request..&lt;br /&gt;&lt;/span&gt;   Select  @tempOrderId = OrderId from #OrderId_Table where OrderId = @GetOrderId&lt;br /&gt; Insert into #Details(OrderId_Out) Select @tempOrderId&lt;br /&gt; Update #Details Set AddressId_Out = (Select AddressId from dbo.GetOrderDetails_F(@tempOrderId,'AppName')) where OrderId_Out = @tempOrderId&lt;br /&gt; Update #Details Set ContactId_Out = (Select ContactId from dbo.GetOrderDetails_F(@tempOrderId,'AppName')) where OrderId_Out = @tempOrderId&lt;br /&gt; Update #Details Set Tn_Out = (Select Tn from dbo.GetOrderDetails_F(@tempOrderId,'ApName')) where OrderId_Out = @tempOrderId&lt;br /&gt; Update #Details Set TnCustomer_Out = (Select CustomerId from dbo.GetOrderDetails_F(@tempOrderId,'AppName)) where OrderId_Out = @tempOrderId&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-- Logic Get rid of the value after the work is done, this way the table will get empty and you can exit from the loop&lt;/span&gt;&lt;br /&gt; Delete #OrderId_Table where OrderId = @GetOrderId&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-- This step is very important , this will keep the loop going as its value is not Equal &lt;&gt; to Zero..&lt;/span&gt;&lt;br /&gt; set rowcount 1 &lt;span style="color: rgb(255, 0, 0);"&gt;&lt;br /&gt;-- If the table gets empty, the value of the @@rowcount will be set to Zero, and you will exit from the loop&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;&lt;/span&gt;&lt;br /&gt; Select @GetOrderId = OrderId from #OrderId_Table  &lt;span style="color: rgb(255, 0, 0);"&gt;&lt;/span&gt;&lt;br /&gt;End&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;br /&gt;-- This is not needed&lt;/span&gt;&lt;br /&gt;Set rowcount 0  &lt;span style="color: rgb(255, 0, 0);"&gt;&lt;/span&gt;&lt;br /&gt;Select AddressId_Out as AddressId, ContactId_Out as ContactId,Tn_Out as Tn,TnCustomer_Out as TnCustomer,OrderId_Out as OrderId from #Details&lt;br /&gt;drop table #Details&lt;br /&gt;drop table #OrderId_Table&lt;br /&gt;End&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This is a cool way of iterating through a Table&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Thanks,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Happy Programming!!!!&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-3125076444177434102?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/3125076444177434102/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=3125076444177434102' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/3125076444177434102'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/3125076444177434102'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2007/10/iterating-through-temptabletable-in.html' title='Iterating through a TempTable/Table in SqlServer -- Just like cursor action'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-1682231320499011240</id><published>2007-10-30T14:19:00.001-07:00</published><updated>2007-10-30T14:20:15.096-07:00</updated><title type='text'>Informative .Net WebSite</title><content type='html'>Multithreading using C# --  &lt;a href="http://www.yoda.arachsys.com/csharp/threads/"&gt;http://www.yoda.arachsys.com/csharp/threads/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-1682231320499011240?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/1682231320499011240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=1682231320499011240' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/1682231320499011240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/1682231320499011240'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2007/10/informative-net-website.html' title='Informative .Net WebSite'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-379619742256021215</id><published>2007-10-30T12:59:00.001-07:00</published><updated>2007-10-30T13:30:03.586-07:00</updated><title type='text'>Deployment ASP.Net 2.0 Application.....</title><content type='html'>&lt;div style="text-align: justify;"&gt;Today, I am going to write a blog on  deployment in Asp.Net 2.0 using&lt;br /&gt;&lt;br /&gt;1) Aspnet_compiler.exe  ---&gt;  Inplace Precompilation&lt;br /&gt;                                         ---&gt;  Precompilation for Deployment&lt;br /&gt;Uses:&lt;br /&gt;a) Since this is pre-complied, when the first request comes it is faster as the code is already compiled.&lt;br /&gt;b) It provides code security as the application can be deployed without the source code.&lt;br /&gt;c) Since this utility goes and hits all the pages, compile time and configuration errors can be found out before deployment.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2) PublishWebSite   ---&gt; Web Site Project&lt;br /&gt;                                         Web Application Project ---&gt;This is not updatable by default.&lt;br /&gt;                                                                                             i.e Binary Deployment is not possible.&lt;br /&gt;&lt;br /&gt;3) Copy WebSite --&gt; This way you can copy the entire website to some other location, it supports Ftp,http protocol for FileTransfer.&lt;br /&gt;&lt;br /&gt;---Excerpts taken from MSDN WebSite ---&lt;br /&gt;&lt;br /&gt;a) "The first decision you have to make when using the publish utility is whether you want your .as*x files to be updatable once deployed (use the "Allow this precompiled site to be updatable" option of -u switch in the aspnet_compiler.exe command-line utility).&lt;br /&gt;b)When a site is published as not updatable, it is possible to completely remove all .as*x files and publish only binary assemblies (plus configuration files and static content).&lt;br /&gt;c)However, without the physical files in place, it is impossible for ASP.NET to tell which classes to use for which endpoint requests."  From MSDN Website [Thats why you find the .compiled files so that the location can be determined by the server]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For thorough understanding of this topic read&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/msdnmag/issues/07/04/ExtremeASPNET/default.aspx"&gt; http://msdn.microsoft.com/msdnmag/issues/07/04/ExtremeASPNET/default.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This is a great article to learn about ASP.Net 2.0 deployment&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Thanks&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Happy Programming!!!&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-379619742256021215?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/379619742256021215/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=379619742256021215' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/379619742256021215'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/379619742256021215'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2007/10/deployment-aspnet-20-application.html' title='Deployment ASP.Net 2.0 Application.....'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-501543738623761490</id><published>2007-10-30T08:30:00.000-07:00</published><updated>2007-10-30T08:44:04.138-07:00</updated><title type='text'>Deploying your application Locally on your Dev Machine.....</title><content type='html'>Today, I will blog about how to deploy an application in your local machine without using the Micorsoft's Development Server... but using IIS Server.&lt;br /&gt;&lt;br /&gt;1) Create a Folder in your C:\xxxProjectFolder  Drive and deploying your application.&lt;br /&gt;2) For each project in your solution create a folder for that project in C:\xxxProjectFolder folder.&lt;br /&gt;3) From the code publish your code to those respective folders.&lt;br /&gt;4)Change the Web.Config file to according to your needs like WebServiceUrl's, logFile Paths and other settings...&lt;br /&gt;&lt;br /&gt;5) Go to IIS server (Start--&gt;Run--&gt;Inetmgr) and create virtual directories for all those folders.&lt;br /&gt;&lt;br /&gt;6) Go to http://localhost/xxxProjectName&lt;span style="color: rgb(204, 0, 0);"&gt;Alias/Login.aspx Folder&lt;br /&gt;&lt;br /&gt;Deployment Complete.....&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Happy Programming!!!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-501543738623761490?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/501543738623761490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=501543738623761490' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/501543738623761490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/501543738623761490'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2007/10/deploying-your-application-locally-on.html' title='Deploying your application Locally on your Dev Machine.....'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-3383435915379342768</id><published>2007-10-30T06:47:00.000-07:00</published><updated>2007-10-30T07:06:57.044-07:00</updated><title type='text'>Foreach... and Common Mistakes Done</title><content type='html'>Today, I am going to blog about some bug I found in my Code.....&lt;br /&gt;&lt;br /&gt;In the code block, IndividualCustomer is actually pointing to Custs[i] where 0 &lt; i&lt; Custs.count -1, So whatever Change I make to the IndividualCustomer, the change is actually being made to the Custs[i] i.e the Custs object is getting changed.   &lt;br /&gt;&lt;br /&gt;  OutputCustomer = IndividualCustomer;// This statement is interesting&lt;br /&gt;&lt;br /&gt;This statement is interesting because because I am passing the IndividualCustomer object to a function which will set the feilds in the IndividualCustomer Object. I want these changes to be reflected in the Custs[i] object. I could probably have sent the Custs[i].PrimaryAddress object or IndividualCustomer object to the function GetInventory and achieved the same effect.&lt;br /&gt;&lt;br /&gt;                int CustCount = 0;&lt;br /&gt;                foreach (Customer IndividualCustomer in Custs)&lt;br /&gt;                {&lt;br /&gt;                    Customer OutputCustomer = new Customer();&lt;br /&gt;                    OutputCustomer.PrimaryAddress = new PAddress();&lt;br /&gt;                    IndividualCustomer.PrimaryAddress = new PAddress();&lt;br /&gt;                    OutputCustomer = IndividualCustomer;// This statement is interesting&lt;br /&gt;&lt;br /&gt;                    if (releaseVerSion == "7.2")&lt;br /&gt;                    {&lt;br /&gt;                        GetInventory72(IndividualCustomer.Tn, ref OutputCustomer);&lt;br /&gt;                    }&lt;br /&gt;                    else&lt;br /&gt;                    {&lt;br /&gt;                        GetInventory73(IndividualCustomer.Tn, ref OutputCustomer);&lt;br /&gt;                    }&lt;br /&gt;&lt;br /&gt;                    //---Actually this is not needed---&lt;br /&gt;                    Custs[CustCount].PrimaryAddress = OutputCustomer.PrimaryAddress;&lt;br /&gt;                    Custs[CustCount].BillingAccountNumber = OutputCustomer.BillingAccountNumber;&lt;br /&gt;                    CustCount = CustCount + 1;&lt;br /&gt;                }&lt;br /&gt;&lt;br /&gt;                    //---Actually this is not needed---&lt;br /&gt;                    Custs[CustCount].PrimaryAddress = OutputCustomer.PrimaryAddress;&lt;br /&gt;                    Custs[CustCount].BillingAccountNumber = OutputCustomer.BillingAccountNumber;&lt;br /&gt;                    CustCount = CustCount + 1;&lt;br /&gt;&lt;br /&gt;This is actually just an overhead and is not required becuase the Custs[i].PrimaryAddres and Custs[i].BillingAccountNumber are already set in the Code.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Happy Programming!!!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-3383435915379342768?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/3383435915379342768/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=3383435915379342768' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/3383435915379342768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/3383435915379342768'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2007/10/foreach-and-common-mistakes-done.html' title='Foreach... and Common Mistakes Done'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-1786780080807676349</id><published>2007-10-17T08:12:00.001-07:00</published><updated>2007-10-17T08:21:26.579-07:00</updated><title type='text'>Differences Between Structs and Classes in C#</title><content type='html'>These are the basic differences between Struct and Classes.&lt;br /&gt;&lt;br /&gt;1) Structs are Value Types and Classes are Reference Types. What this means is that Structs are stored in Stack while Classes are stored in a heap. There is a overhead for storing a variable on a heap.&lt;br /&gt;&lt;br /&gt;2) You cannot have default Constructor i.e Constructor with no parameter for structs. If you do provide a default constructor it will give you an compile time error as the compiler provides the default constructor for structs.&lt;br /&gt;&lt;br /&gt;3) Structs cannot be inheritied because they are Value type and Value types are sealed classes.&lt;br /&gt;&lt;br /&gt;Struct x = new Struct(); // Works&lt;br /&gt;&lt;br /&gt;Struct MyStruct  ///Does not work you cannot initialize the fields in the structs&lt;br /&gt;{&lt;br /&gt;public string x = 10;&lt;br /&gt;public string k = 20;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;4) Structs are generally used you have small data and you want to group data together. Genarally fields in Structs are public.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-1786780080807676349?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/1786780080807676349/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=1786780080807676349' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/1786780080807676349'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/1786780080807676349'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2007/10/differences-between-structs-and-classes.html' title='Differences Between Structs and Classes in C#'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-6912111607476245962</id><published>2007-10-16T14:18:00.000-07:00</published><updated>2007-10-16T14:25:00.174-07:00</updated><title type='text'>Logic for Validating(States,Order Status etc)  in WebService</title><content type='html'>Here is the logic you can use to validate in web service&lt;br /&gt;&lt;br /&gt;1) Create a web service like a Lookup web service which will get the required data(States,Order Status etc) from the Database.&lt;br /&gt;&lt;br /&gt;2) In the Global.asax file -- write the code in the Application_Start function to load the required information from the web service and load it into the cache. i.e call the Lookup web service from this function.&lt;br /&gt;&lt;br /&gt;3) In the DataAccess Layer write function to validate state i.e check if the state code sent from the web service is in the cache or not. If not then throw some exception like State not found.&lt;br /&gt;&lt;br /&gt;4)From your web service call this DataAccess Layer Function.&lt;br /&gt;&lt;br /&gt;Happy Programming!!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-6912111607476245962?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/6912111607476245962/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=6912111607476245962' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/6912111607476245962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/6912111607476245962'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2007/10/logic-for-validatingstatesorder-status.html' title='Logic for Validating(States,Order Status etc)  in WebService'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-7599312285243487722</id><published>2007-10-16T11:04:00.000-07:00</published><updated>2007-10-17T07:20:01.081-07:00</updated><title type='text'>Beginxxx and Endxxx --- Async and Completed</title><content type='html'>I am working for a big Telecom Client where the code is developed in .Net 2.0. We are calling some web services asynchronously with the BeginXXX and EndXXX Model. When I joined this company and did some development work I found that Begin and End model was not generated while creating the proxy in VS 2005.&lt;br /&gt;&lt;br /&gt;Here is the Link -- &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=288660"&gt;https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=288660&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;if you want to find more information about this and   there is a work around for this issue too.&lt;br /&gt;&lt;br /&gt;Anyway, I had to change the code to Sync due to lack of time, but I found this info in the  Microsoft WebSite which I think will help you guys to figure out why this is happening.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If I had known about this bug, I would have done the workaround.......&lt;br /&gt;&lt;br /&gt;Happy Programming!!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-7599312285243487722?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/7599312285243487722/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=7599312285243487722' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/7599312285243487722'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/7599312285243487722'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2007/10/beginxxx-and-endxxx-async-and-completed.html' title='Beginxxx and Endxxx --- Async and Completed'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-954885857108135149.post-4356612583638482626</id><published>2007-10-16T08:37:00.001-07:00</published><updated>2007-10-16T08:38:02.042-07:00</updated><title type='text'>Soap Message Viewer</title><content type='html'>This is a great tool for checking Soap Messages with Webservice endpoints -- SoapUI . Its a freeware.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-4356612583638482626?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdevblog.blogspot.com/feeds/4356612583638482626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=954885857108135149&amp;postID=4356612583638482626' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/4356612583638482626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/954885857108135149/posts/default/4356612583638482626'/><link rel='alternate' type='text/html' href='http://dotnetdevblog.blogspot.com/2007/10/soap-message-viewer.html' title='Soap Message Viewer'/><author><name>Yash</name><uri>http://www.blogger.com/profile/17731680871788448962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_iUI-C9OjkTY/TGonr62f3ZI/AAAAAAAAAMw/AqmkIXgfEc4/S220/DSC00124.JPG'/></author><thr:total>0</thr:total></entry></feed>
