<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tech Insight !</title>
	<atom:link href="http://techinsight.dhanashree.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://techinsight.dhanashree.com</link>
	<description>Technical blog on ASP.Net, PHP, Web Development, Web hosting , Database Programming</description>
	<lastBuildDate>Thu, 15 Jul 2010 09:32:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Communication – A developer point of view</title>
		<link>http://techinsight.dhanashree.com/communication-%e2%80%93-a-developer-point-of-view-2/</link>
		<comments>http://techinsight.dhanashree.com/communication-%e2%80%93-a-developer-point-of-view-2/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 09:10:24 +0000</pubDate>
		<dc:creator>dinctechadmin</dc:creator>
				<category><![CDATA[Communication]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://techinsight.dhanashree.com/communication-%e2%80%93-a-developer-point-of-view-2/</guid>
		<description><![CDATA[Introduction:
By definition communication means: &#8220;It is the process of passing information and understanding from one person to another. It is essentially a bridge of meaning between people. By using the bridge of meaning, a person can safely cross the river of misunderstanding that separates all the people.&#8220;
History of communication says that it comes from a [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction:</strong></p>
<p><span style="font-family: Verdana; font-size: 10pt;">By definition communication means: &#8220;<em>It is the process of passing information and understanding from one person to another. It is essentially a bridge of meaning between people. By using the bridge of meaning, a person can safely cross the river of misunderstanding that separates all the people.</em>&#8220;</span></p>
<p><span style="font-family: Verdana; font-size: 10pt;">History of communication says that it comes from a Latin word: &#8220;communicare&#8221;, which as three meaning imminent from it:</span></p>
<ul>
<li>&#8220;To make common&#8221;, which is probably can be derived from 2 or 3.</li>
<li>&#8220;Cum + munus&#8221;, its like having a gift to share in mutual donation.</li>
<li>Building together a defence.</li>
</ul>
<p>From the developer point of view (I hope reader is somewhere involved programming <span style="font-family: Wingdings;">J</span> ), communication is real important factor to improvise one&#8217;s potentiality. A good leader has to be a good communicator. It&#8217;s not so that communication skills means the way you talk, the way you present your idea to others. Communication skill involves many other areas. Like:  Verbal communication, Non verbal communication, written communication, Gesture communication etc.</p>
<p>All these are nuts &amp; bolts for being a good communicator.</p>
<p>Communication makes you perfect in demonstrating your ideas to front end people. Let&#8217;s take few examples that give you glimpse why communication skill is so important for a developer/leader.
</p>
<ol>
<li>Think what if you are a technical leader and your client has given you a task. You are supposed to present him technical feasibility report or say you wanted to explain him/her flow of your system. If you are not have a good command over your English, collections vocabulary, you are not used to prepare &amp; utilize MS word, then?</li>
<li>In number of different occasions, we as developer/leader need to talk with different users. These users may be end users of system, stack holders, clients who have given as project to work on. Different people have different emotions and different style of communication. In these cases, you need to communicate in a balanced view.</li>
<li>When I was a fresher, digging into the word of programming. We were instructed that when any CRUD operation is performed, you need to show users a message that operation successfully completed. When in an application someone create a PO from their site, I say them &#8220;operation successfully completed.&#8221; But what operation?<br />
  <span style="font-family: Wingdings;">J</span></li>
</ol>
<p>Well, there are many many many other points that can be put here in list, but in that case you may avoid to read my article. And I don&#8217;t want to make that happen<br />
 <span style="font-family: Wingdings;">J</span>.</p>
<p>So let&#8217;s take a took some important <strong>characteristics of a good communication</strong>.
</p>
<ol>
<li><strong>It&#8217;s a two way process</strong> – It&#8217;s quite understandable. In any communication system there are two parties involved. One is<br />
  <em>Transmitter</em> another is <em>receiver</em>. Overall motto of communication is to delivery your message to other parties. It may be comprising of debate, discussion etc.</li>
<li><strong>It&#8217;s continuous process – </strong>Communication process continues to the extent that ideas and messages are communicated and received. Like for e.g. if we are at system analysis stage for any project. Continues discussion is very important. As a analyst, we have to be in contact with stack holder to understand their requirement. We have to identify end user who is going to use the software/application.<br />
  <strong></strong></li>
<li>It can be in formal way or informal way, though it may be in different medium.</li>
</ol>
<p><strong>Elements of communication </strong></p>
<p>&nbsp;</p>
<p><img src="http://jatinkacha.files.wordpress.com/2010/07/071510_0732_1.png?w=480" alt="" />
</p>
<p><strong>Why communication is so important for us? </strong>It is important because….</p>
<ol>
<li>Making enterprise run smoothly.</li>
<li>Quick decision and implementation.</li>
<li>Project planning &amp; coordination.</li>
<li>Maximizing productivity.</li>
<li>Morale building/Motivation tool and developing your democratic leadership style.</li>
</ol>
<p>Properly recorded communication documents, system analysis docs., technical specification, ER diagrams, these are the documents that we generally prepare so that it make ease for any new comer in organization to get settle with his project. This makes organization to run smooth.</p>
<p>Moreover, properly maintained documents allow you to make quick discussion in hurry.</p>
<p>For proper co-ordination and maintenance, developer can utilize different project management tools. To name few here are some of them.
</p>
<ol>
<li><a href="http://www.mantisbt.org">www.mantisbt.org</a> &#8211; MantisBT is a popular free web-based bug tracking system.</li>
<li><a title="BasecampHQ.com" href="http://tomuse.com/goto/Basecamp" target="_blank">Basecamp</a></li>
<li><a title="CentralDesktop.com" href="http://tomuse.com/goto/CentralDesktop" target="_blank">Central Desktop</a></li>
<li><a title="5pmweb.com" href="http://tomuse.com/goto/5pm" target="_blank">5pm</a></li>
</ol>
<p>You can get more information for such tools from this article.</p>
<p> <a href="http://tomuse.com/top-10-best-free-online-project-management-application-services/">http://tomuse.com/top-10-best-free-online-project-management-application-services/</a></p>
<p>There are different kinds of communication methods. Like…</p>
<ul>
<li>Verbal or oral communication</li>
<li>Written communication</li>
<li>Formal communication, informal communication</li>
</ul>
<p>Developers are used to choose from these methods according to availability of resources and situation. Mostly verbal or written communication is widely popular among us. Formal communication has special delegation of authority, which means a project leader has given sufficient rights to make certain decision without asking to their superiors. Where in informal communication, there is no authority defined. It is conveyed by simple gesture, glance, smile, silence.</p>
<p><strong>Effective communication<br />
</strong></p>
<ol>
<li>While you are in presentation, instructing to group of developers, doing video conferencing with other peers on remote location, <strong>Clarity of Thoughts</strong><span style="font-family: Tahoma; font-size: 12pt;"><br />
</span>is really important<span style="font-family: Tahoma; font-size: 12pt;">.</span><strong><br />
</strong></li>
<li>Something just can&#8217;t be explained by words. You have to react with your body. It is important to <strong>attach importance to actions rather than words</strong>.</li>
<li><strong>Participation –</strong> as said earlier, it&#8217;s a two way process which require involvement of all the parties. If you are not involved mentally in communication process, you are not going to perform your task well. Your presence is must. If your leader informed you about coding standard to be maintained, and if you don&#8217;t remember those, you will in trouble.<strong><br />
</strong></li>
<li><strong>What to communicate?</strong> – Prepare the agenda that you need to talk about before you initiate. Collect all the required documents, technical specifications, proof reports, different analysis report before you talk with your superior or clients.<strong><br />
</strong></li>
<li><strong>When to communicate?</strong> – Mutually decide timing with your parties involved in. You can either initiate or let your parties to initiate and decide when to communicate. You can place meeting request in outlook, send them emails, take care of geographical difference in timing, ask for the availability and long will be the meeting etc.<strong><br />
</strong></li>
<li><strong>How to communicate?</strong> – Choose the medium that you want to communicate through. If discussion matter to be explained to a technical person, chat or peer to peer method can be best suited. If talking with non technical person, you have to represent your ideas to your parties in such a way that he can understand your thoughts. You may explain them using different diagrams, preparing documents and go through documents while you discuss, giving them references about what are trying to demonstrate him. There are no. of collaboration tools are there in market which you can use for this purpose. Like we have google wave, Webex, Skype voice chat, video conferencing through different tools etc.<strong><br />
</strong></li>
<li><strong>How often to communicate? – </strong>As I said that it&#8217;s a continuous process. You can&#8217;t make sure that having discussion for 5-6 hours, you will come out with your objective. It&#8217;s an iterative process. You should try to divide your agenda into groups. Discuss them at different time interval. Make all agenda clear step by step. Try to identify issues relating to each other and communicate them as well. <strong><br />
</strong></li>
<li><strong>What is the objective of communication? – </strong>It is almost similar to identifying communication goal/agenda. But the objective of communication here is in the term of what is the outcome we are expecting to come from it. When project is running out of time, meeting by team leader is to motivate developers to encourage them to get it done at right time.<strong><br />
</strong></li>
<li><strong>Keep the channel alive<br />
</strong></li>
<li><strong>Cordial superior – </strong>Once finished communication, it should be conveyed to your superior that what was the outcome? What where the agenda? What are clients new requirements? What do you suggest for different points to client? How was the response from client etc.<strong><br />
</strong></li>
<li><strong>Get the feedback – </strong>Generally when you dial in to customer care of your cellular provider, right after you finish your talk with them, you receive message regarding feedback for the person you talked with. This is the process of evaluation. It&#8217;s not to make garbage employees collection. It&#8217;s about gathering customer&#8217;s response how they like customer care person to be behaved. So gathering those feedback we can evaluate and enhance process.   <strong><br />
</strong></li>
</ol>
<p>To make such effective communication, what should you do? Or what should you have? Here is answer for you.</p>
<ul>
<li><strong>Develop a positive attitude</strong>.</li>
<li><strong>Bad feelings should not hamper discussion – </strong>Human is social animal. Different people have different mentality. All have different approach to grow and perform tasks. When we are working in organization, we work in a team. It is sometime obvious that different group member have conflict with other peers. When working as team, it is must that team show their team effort rather than individuals. So your bad feeling with others should not hinder communication.  <strong><br />
</strong></li>
<li><strong>Use logic to manage difficult situations<br />
</strong></li>
<li><strong>Develop Harmonious interpersonal relationships. It is secret of business relationship</strong>.</li>
</ul>
<p>And for effective oral communication, you should have..</p>
<ul>
<li><strong>Understanding and use of appropriate language.<br />
</strong></li>
<li><strong>Organize and sequence of thoughts properly.<br />
</strong></li>
<li><strong>Vocabulary power.<br />
</strong></li>
<li><strong>Command over illustrations, examples.<br />
</strong></li>
<li><strong>Proper pronunciation.<br />
</strong></li>
<li><strong>Proper use of sound system/equipments.<br />
</strong></li>
<li><strong>Listening ability.<br />
</strong></li>
<li><strong>Effective telephonic talk.<br />
</strong></li>
</ul>
<p>And for written communication….</p>
<ul>
<li><strong>Command over the language.<br />
</strong></li>
<li><strong>Word power and spelling.<br />
</strong></li>
<li><strong>Correct grammar.<br />
</strong></li>
<li><strong>Proper structuring of the written message<br />
</strong></li>
<li><strong>Use of appropriate channels like courier, e-mail, etc.<br />
</strong></li>
<li><strong>Attention to hand writing, typing, printing.<br />
</strong></li>
</ul>
<p>And for non verbal communication….</p>
<ul>
<li><strong>Observation skills.<br />
</strong></li>
<li><strong>Awareness about the body movement.<br />
</strong></li>
<li><strong>Proper interpretation of the non-verbal message.<br />
</strong></li>
</ul>
<p>Well no system is perfect in the world. There is always barrier in everything we do. Effective communication itself has its own. It is said that 30% communication the word are failed to success due to loss in transmission. Inaccurate translation, false impression, fear, noise etc. are the elements as barrier of communication. Though I am not going to tell you all here <span style="font-family: Wingdings;">J</span>.</p>
<p>So here I would like to conclude my article, hope I covered all skills of written communication in my article <span style="font-family: Wingdings;">J</span>. I also hope that I am able to convey to my message.</p>
<p>So see you next time till then happy communication &amp; happy programming…</p>
<p>Cheers..</p>
]]></content:encoded>
			<wfw:commentRss>http://techinsight.dhanashree.com/communication-%e2%80%93-a-developer-point-of-view-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Combine/Compress/Minify JavaScript, CSS in Asp.net</title>
		<link>http://techinsight.dhanashree.com/combinecompressminify-javascript-css-in-asp-net/</link>
		<comments>http://techinsight.dhanashree.com/combinecompressminify-javascript-css-in-asp-net/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 11:00:28 +0000</pubDate>
		<dc:creator>kiran</dc:creator>
				<category><![CDATA[.Net 2.0]]></category>
		<category><![CDATA[.net framework]]></category>
		<category><![CDATA[CSS 3]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Web Developement]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[.net developement]]></category>
		<category><![CDATA[asp.net developement]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://techinsight.dhanashree.com/combinecompressminify-javascript-css-in-asp-net/</guid>
		<description><![CDATA[Introduction:

When we design and develop the website, the performance is in the core of development. The system you are developing must produce the result with high speed. For the web development perspective, website load performance is very essential thing to take care of. You need good working layout, easy layout and easy navigation.
Here with this [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction:<br />
</strong></p>
<p>When we design and develop the website, the performance is in the core of development. The system you are developing must produce the result with high speed. For the web development perspective, website load performance is very essential thing to take care of. You need good working layout, easy layout and easy navigation.</p>
<p>Here with this article I m not going to talk about of all the aspects of web application performance improvements. But I am specifically targeting the topic when it comes to the CSS and JavaScript faster loading in the client browser.  In fact Google is also counting the speed of your website site when indexing to your website.</p>
<p>The goal was to improve overall performance on the client side. At the same time, it will show how we can force a client side script to be coached at the browser, so that in subsequent visit, it will take those scripts from the cache. This becomes increasingly important when using AJAX techniques within an application that introduce new features and functionality.</p>
<p>First of all I will outline the requirements and essential steps that this project is made of. So that if you want to implement the same in your development, it become easy for you to set up project.</p>
<p>To download complete project, <a href="http://www.esnips.com/doc/bb247398-9971-4fac-bb8e-02a8e8ebad7d/JS-CSS-Combiner-Minifier">click here</a></p>
<p><strong>Setup:<br />
</strong></p>
<p>To begin with, we will have following list of files to be created in the development studio.</p>
<ol>
<li>2 XML files, first one to hold source of JS files for each page and second to  hold CSS files for each page.</li>
<li>A generic class that implement <em>IHttpHandler, </em>that will be used to delivery combined and compressed JavaScript/CSS at the client.</li>
<li>And at last your .ASPX file that will be used to serve combined and compressed Javascript/CSS at client side.</li>
</ol>
<p><strong>Step by Step Implementation:<br />
</strong></p>
<p>Now let&#8217;s get dig into the actual development. To summarize, let&#8217;s say we have a page default.aspx that has following no. of JavaScript files and CSS files. Think of these file that we wanted to combine them and deliver at one go at the client browser.</p>
<ol>
<li>jquery.js</li>
<li>script-file-1.js</li>
<li>style-1.css</li>
<li>style-2.css</li>
</ol>
<p>As you can see, we have 2 different JavaScript file &amp; 2 CSS files. So what basically we will do in the next is to create a utility which can combine given JavaScript and compress it, then send it to client browser. Next the same process will be done for the CSS. Both the CSS files will be combined and compressed and send to client browser.</p>
<p>Now it&#8217;s time to take a look at into actual stuff that does this underlying work.</p>
<p>First of all we will create a CS class file that will hold the programming stuffs.</p>
<p>So perform the following steps to create &amp; configure that CS class file.</p>
<ol>
<li>
<div>Create CS class file with the name <em>ScriptCombiner.cs</em> and put the following code in that.</div>
</li>
</ol>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">public</span><span style="color: blue;"> </span><span style="color: blue;">class</span><br />
<span style="color: #2b91af;">ScriptCombiner</span> : <span style="color: #2b91af;">IHttpHandler<span style="color: #000000;">{</span></span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">private</span><span style="color: blue;"> </span><span style="color: blue;">readonly</span><span style="color: blue;"> </span><span style="color: blue;">static</span><span style="color: blue;"> </span><span style="color: #2b91af;">TimeSpan</span> CACHE_DURATION = <span style="color: #2b91af;">TimeSpan</span>.FromDays(1);</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">private</span><span style="color: blue;"> </span><span style="color: #2b91af;">HttpContext</span> context;</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">public</span><span style="color: blue;"> </span><span style="color: blue;">void</span> ProcessRequest(<span style="color: #2b91af;">HttpContext</span> context){</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> }<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">public</span><span style="color: blue;"> </span><span style="color: blue;">bool</span> IsReusable{</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">get</span> { <span style="color: blue;">return</span><span style="color: blue;"> </span><span style="color: blue;">true</span>; }<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> }</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;">}</span></p>
<p>As you can see, we are implementing the <span style="color: #2b91af; font-family: Courier New; font-size: 10pt;">IHttpHandler </span>interface.</p>
<p>You can write custom HTTP handlers to process specific, predefined types of HTTP requests in any Common Language Specification (CLS) compliant language. Executable code defined in the HttpHandler classes, rather than conventional ASP or ASP.NET Web pages, responds to these specific requests. HTTP handlers give you a means of interacting with the low-level request and response services of the IIS Web server and provide functionality much like ISAPI extensions but with a simpler programming model.</p>
<p>We are also implementing <span style="font-family: Courier New; font-size: 10pt;">IsReusable </span>properly as it is compulsory to implement as a part of inheritance of <span style="color: #2b91af; font-family: Courier New; font-size: 10pt;">IHttpHandler </span>interface.</p>
<p>Now, let&#8217;s put the nuts &amp; bolts inside the <span style="font-family: Courier New; font-size: 10pt;">ProcessRequest </span>function. I will also explain you the step by step each execution that is inside this function.</p>
<ol>
<li>We will also create another CS class file that is used to compress JavaScript. That file is named as &#8220;JavaScriptMinifier.cs&#8221;. Please take a look at the attached project solution file. As it is contain long lines of code, I can&#8217;t put it here.</li>
<li>Complete your class file with following functions.</li>
</ol>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">public</span><span style="color: blue;"> </span><span style="color: blue;">void</span> ProcessRequest(<span style="color: #2b91af;">HttpContext</span> context)<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> {</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">string</span> xStrType, xStrSet, xStrVer, xStrpagecode;</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: #2b91af;">Boolean</span> xBlnCanCompress;</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">this</span>.context = context;</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: #2b91af;">HttpRequest</span> request = context.Request;</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;">xStrType = (!<span style="color: #2b91af;">String</span>.IsNullOrEmpty(request[<span style="color: #a31515;">"type"</span>])) ? request[<span style="color: #a31515;">"type"</span>] : <span style="color: blue;">null</span>;</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> xStrSet = (!<span style="color: #2b91af;">String</span>.IsNullOrEmpty(request[<span style="color: #a31515;">"s"</span>])) ? request[<span style="color: #a31515;">"s"</span>] : <span style="color: blue;">null</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> xStrVer = (!<span style="color: #2b91af;">String</span>.IsNullOrEmpty(request[<span style="color: #a31515;">"v"</span>])) ? request[<span style="color: #a31515;">"v"</span>] : <span style="color: blue;">null</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> xStrpagecode = (!<span style="color: #2b91af;">String</span>.IsNullOrEmpty(request[<span style="color: #a31515;">"pcode"</span>])) ? request[<span style="color: #a31515;">"pcode"</span>] : <span style="color: blue;">null</span>;</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: green;">//first check if client browser can support compressions<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> xBlnCanCompress = CanClientGZip(request);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">using</span> (<span style="color: #2b91af;">MemoryStream</span> memStream = <span style="color: blue;">new</span><span style="color: blue;"> </span><span style="color: #2b91af;">MemoryStream</span>(8092))<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> {</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: #2b91af;">Stream</span> writer;</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: green;">//if browser is supporing GZip compression then create a new object using ICSharpCode.SharpZipLib.GZip</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: green;">//library which allow the compressed respose to send to client<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">if</span> (xBlnCanCompress) </span></p>
<p><span style="font-family: Courier New; font-size: 10pt;">writer = (<span style="color: blue;">new</span> ICSharpCode.SharpZipLib.GZip.GZipOutputStream(memStream));</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">else<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> writer = memStream;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">using</span> (writer){</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: green;">//now its time to read all the script/css files into a StringBuilder object.<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: #2b91af;">StringBuilder</span> combinedSource = <span style="color: blue;">new</span><span style="color: blue;"> </span><span style="color: #2b91af;">StringBuilder</span>();<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">foreach</span> (<span style="color: blue;">string</span> file <span style="color: blue;">in</span> GetFileNames(xStrSet, xStrpagecode, xStrType))<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> combinedSource.Append(System.IO.<span style="color: #2b91af;">File</span>.ReadAllText(context.Server.MapPath(file), <span style="color: #2b91af;">Encoding</span>.UTF8));<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: green;">//Upto now we have combined all css/javascript based on request.<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: green;">//its now time to remove extra white spaces and other unwanted characters from respose.</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: green;">//compression will take place now.<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">string</span> minified;</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: green;">//use the YUI Javascript/CSS minifier to compress all js files<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">if</span> (xStrType == <span style="color: #a31515;">&#8220;js&#8221;</span>)<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> minified = combinedSource.ToString();<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">else<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> minified = CompressCSS(combinedSource.ToString());<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: green;">// Send minfied string to output stream<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">byte</span>[] bt = <span style="color: #2b91af;">Encoding</span>.UTF8.GetBytes(minified);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> writer.Write(bt, 0, bt.Length);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> }</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: green;">//cache the respose so that in next request it can be reused<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">byte</span>[] responseBytes = memStream.ToArray();<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: green;">//context.Cache.Insert(GetCacheKey(xStrSet, xStrType, xStrVer, xBlnCanCompress), responseBytes, null, System.Web.Caching.Cache.NoAbsoluteExpiration, CACHE_DURATION);<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: green;">// Generate the response<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">this</span>.WriteBytes(responseBytes, xBlnCanCompress, xStrType);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> }<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> }</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">private</span><span style="color: blue;"> </span><span style="color: blue;">bool</span> CanClientGZip(<span style="color: #2b91af;">HttpRequest</span> request){</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">string</span> acceptEncoding = request.Headers[<span style="color: #a31515;">"Accept-Encoding"</span>];<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">if</span> (!<span style="color: blue;">string</span>.IsNullOrEmpty(acceptEncoding) &amp;&amp;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> (acceptEncoding.Contains(<span style="color: #a31515;">&#8220;gzip&#8221;</span>) || acceptEncoding.Contains(<span style="color: #a31515;">&#8220;deflate&#8221;</span>)))<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">return </span><span style="color: blue;">true</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">return</span><span style="color: blue;"> </span><span style="color: blue;">false</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> }</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: green;">// helper method that return an array of file names inside the text file stored in App_Data folder<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">private</span><span style="color: blue;"> </span><span style="color: blue;">static</span><span style="color: blue;"> </span><span style="color: blue;">string</span>[] GetFileNames(<span style="color: blue;">string</span> setName, <span style="color: blue;">string</span> pagecode, <span style="color: blue;">string</span> type)<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> {System.Xml.XPath.<span style="color: #2b91af;">XPathDocument</span> doc2;</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> System.Xml.XPath.<span style="color: #2b91af;">XPathNavigator</span> navigator;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> System.Xml.XPath.<span style="color: #2b91af;">XPathNodeIterator</span> iterator;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> System.Collections.Generic.<span style="color: #2b91af;">List</span>&lt;<span style="color: blue;">string</span>&gt; scripts = <span style="color: blue;">new</span> System.Collections.Generic.<span style="color: #2b91af;">List</span>&lt;<span style="color: blue;">string</span>&gt;();<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">string</span> key;</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">if</span> (type == <span style="color: #a31515;">&#8220;js&#8221;</span>)<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> key = <span style="color: #a31515;">&#8220;scriptfile&#8221;</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">else<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> key = <span style="color: #a31515;">&#8220;cssfile&#8221;</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">if</span> (System.Web.<span style="color: #2b91af;">HttpContext</span>.Current.Cache[key] != <span style="color: blue;">null</span>)<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> {doc2 = (System.Xml.XPath.<span style="color: #2b91af;">XPathDocument</span>)System.Web.<span style="color: #2b91af;">HttpContext</span>.Current.Cache[key];</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> }<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">else<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> {</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">string</span> filename;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> filename = System.Web.<span style="color: #2b91af;">HttpContext</span>.Current.Server.MapPath(<span style="color: #2b91af;">String</span>.Format(<span style="color: #a31515;">&#8220;~/App_Data/{0}.xml&#8221;</span>, setName));<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> doc2 = <span style="color: blue;">new</span> System.Xml.XPath.<span style="color: #2b91af;">XPathDocument</span>(filename);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> System.Web.<span style="color: #2b91af;">HttpContext</span>.Current.Cache.Insert(key, doc2, <span style="color: blue;">new</span> System.Web.Caching.<span style="color: #2b91af;">CacheDependency</span>(filename), <span style="color: #2b91af;">DateTime</span>.Now.AddMinutes(60), <span style="color: #2b91af;">TimeSpan</span>.Zero);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> }</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;">navigator = doc2.CreateNavigator();</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">if</span> (type == <span style="color: #a31515;">&#8220;js&#8221;</span>)</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;">iterator = navigator.Select(<span style="color: #a31515;">&#8220;/scripts/page[@pagecode='"</span> + pagecode + <span style="color: #a31515;">"']/script&#8221;</span>);</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">else<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> iterator = navigator.Select(<span style="color: #a31515;">&#8220;/styles/page[@pagecode='"</span> + pagecode + <span style="color: #a31515;">"']/style&#8221;</span>);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">while</span> (iterator.MoveNext())<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> scripts.Add(iterator.Current.InnerXml);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">return</span> scripts.ToArray();<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> }<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">private</span><span style="color: blue;"> </span><span style="color: blue;">string</span> GetCacheKey(<span style="color: blue;">string</span> type, <span style="color: blue;">string</span> setName, <span style="color: blue;">string</span> version, <span style="color: blue;">bool</span> cancompress)<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> {</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">return</span><span style="color: blue;"> </span><span style="color: #a31515;">&#8220;HttpCombiner.&#8221;</span> + setName + <span style="color: #a31515;">&#8220;.&#8221;</span> + type + <span style="color: #a31515;">&#8220;.&#8221;</span> + version + <span style="color: #a31515;">&#8220;.&#8221;</span> + cancompress;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> }<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">private</span><span style="color: blue;"> </span><span style="color: blue;">void</span> WriteBytes(<span style="color: blue;">byte</span>[] bytes, <span style="color: blue;">bool</span> isCompressed, <span style="color: blue;">string</span> type)<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> {<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: #2b91af;">HttpResponse</span> response = context.Response;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> response.AppendHeader(<span style="color: #a31515;">&#8220;Content-Length&#8221;</span>, bytes.Length.ToString());<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">if</span> (type == <span style="color: #a31515;">&#8220;js&#8221;</span>)<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> response.ContentType = <span style="color: #a31515;">&#8220;application/x-javascript&#8221;</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">else<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> response.ContentType = <span style="color: #a31515;">&#8220;text/css&#8221;</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">if</span> (isCompressed)<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> response.AppendHeader(<span style="color: #a31515;">&#8220;Content-Encoding&#8221;</span>, <span style="color: #a31515;">&#8220;gzip&#8221;</span>);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">else<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> response.AppendHeader(<span style="color: #a31515;">&#8220;Content-Encoding&#8221;</span>, <span style="color: #a31515;">&#8220;utf-8&#8243;</span>);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> context.Response.Cache.SetCacheability(<span style="color: #2b91af;">HttpCacheability</span>.Public);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> context.Response.Cache.SetExpires(<span style="color: #2b91af;">DateTime</span>.Now.Add(CACHE_DURATION));<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> context.Response.Cache.SetMaxAge(CACHE_DURATION);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> response.ContentEncoding = <span style="color: #2b91af;">Encoding</span>.Unicode;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> response.OutputStream.Write(bytes, 0, bytes.Length);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> response.Flush();<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> }<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">public</span><span style="color: blue;"> </span><span style="color: blue;">static</span><br />
<span style="color: blue;">string</span> GetScriptTag(<span style="color: blue;">string</span> setname, <span style="color: blue;">string</span> pageid, <span style="color: blue;">string</span> type, <span style="color: blue;">string</span> ver)<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> {</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">string</span> result = <span style="color: #a31515;">&#8220;&#8221;</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">if</span> (type == <span style="color: #a31515;">&#8220;js&#8221;</span>)<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> result += <span style="color: #2b91af;">String</span>.Format(<span style="color: #a31515;">&#8220;&lt;script type=\&#8221;text/javascript\&#8221; src=\&#8221;/&#8221;</span> + Web.Utility.Functions.GetURLPrefix() + <span style="color: #a31515;">&#8220;ScriptCombiner.axd?s={0}&amp;v={1}&amp;type=js&amp;pcode={2}\&#8221;&gt;&lt;/script&gt;&#8221;</span>, setname, ver, pageid);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">else<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> result += <span style="color: #2b91af;">String</span>.Format(<span style="color: #a31515;">&#8220;&lt;link link href=\&#8221;ScriptCombiner.axd?s={0}&amp;v={1}&amp;type=css&amp;pcode={2}\&#8221; rel=\&#8221;stylesheet\&#8221; type=\&#8221;text/css\&#8221;/&gt;&#8221;</span>, setname, ver, pageid);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">return</span> result;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> }<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">public</span><span style="color: blue;"> </span><span style="color: blue;">static</span><span style="color: blue;"> </span><span style="color: blue;">string</span> CompressCSS(<span style="color: blue;">string</span> body)<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> {<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> body = <span style="color: #2b91af;">Regex</span>.Replace(body, <span style="color: #a31515;">&#8220;/\\*.+?\\*/&#8221;</span>, <span style="color: #a31515;">&#8220;&#8221;</span>, <span style="color: #2b91af;">RegexOptions</span>.Singleline);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> body = body.Replace(<span style="color: #a31515;">&#8221;  &#8220;</span>, <span style="color: blue;">string</span>.Empty);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> body = body.Replace(<span style="color: #2b91af;">Environment</span>.NewLine + <span style="color: #2b91af;">Environment</span>.NewLine + <span style="color: #2b91af;">Environment</span>.NewLine, <span style="color: blue;">string</span>.Empty);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> body = body.Replace(<span style="color: #2b91af;">Environment</span>.NewLine + <span style="color: #2b91af;">Environment</span>.NewLine, <span style="color: #2b91af;">Environment</span>.NewLine);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> body = body.Replace(<span style="color: #2b91af;">Environment</span>.NewLine, <span style="color: blue;">string</span>.Empty);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> body = body.Replace(<span style="color: #a31515;">&#8220;\\t&#8221;</span>, <span style="color: blue;">string</span>.Empty);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> body = body.Replace(<span style="color: #a31515;">&#8221; {&#8220;</span>, <span style="color: #a31515;">&#8220;{&#8220;</span>);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> body = body.Replace(<span style="color: #a31515;">&#8221; :&#8221;</span>, <span style="color: #a31515;">&#8220;:&#8221;</span>);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> body = body.Replace(<span style="color: #a31515;">&#8220;: &#8220;</span>, <span style="color: #a31515;">&#8220;:&#8221;</span>);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> body = body.Replace(<span style="color: #a31515;">&#8220;, &#8220;</span>, <span style="color: #a31515;">&#8220;,&#8221;</span>);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> body = body.Replace(<span style="color: #a31515;">&#8220;; &#8220;</span>, <span style="color: #a31515;">&#8220;;&#8221;</span>);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> body = body.Replace(<span style="color: #a31515;">&#8220;;}&#8221;</span>, <span style="color: #a31515;">&#8220;}&#8221;</span>);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> body = <span style="color: #2b91af;">Regex</span>.Replace(body, <span style="color: #a31515;">&#8220;/\\*[^\\*]*\\*+([^/\\*]*\\*+)*/&#8221;</span>, <span style="color: #a31515;">&#8220;$1&#8243;</span>);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> body = <span style="color: #2b91af;">Regex</span>.Replace(body, <span style="color: #a31515;">&#8220;(?&lt;=[&gt;])\\s{2,}(?=[&lt;])|(?&lt;=[&gt;])\\s{2,}(?=&amp;nbsp;)|(?&lt;=&amp;ndsp;)\\s{2,}(?=[&lt;])&#8221;</span>, <span style="color: blue;">string</span>.Empty);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">return</span> body;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> }</span></p>
<p>You are now almost done with 50% of work for your project.</p>
<p>Now let&#8217;s take a look at the few of important execution steps that are in this function.</p>
<p>First of all we are declaring four different string variables:</p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">string</span> xStrType, xStrSet, xStrVer, xStrpagecode;<br />
</span></p>
<p>They will be used to get the Querystring passed in to this handler. This is utilized later on the code.</p>
<p>Moving next, you will find these function call:</p>
<p><span style="color: green; font-family: Courier New; font-size: 10pt;">//first check if client browser can support compressions<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> xBlnCanCompress = CanClientGZip(request);<br />
</span></p>
<p>This is basically to check does client browser support GZip compression.</p>
<p>Gzip compression, otherwise known as content encoding, is a publicly defined way to compress textual content transferred from web servers to browsers. HTTP compression uses public domain compression algorithms, like gzip and compress, to compress XHTML, JavaScript, CSS, and other text files at the server. This standards-based method of delivering compressed content is built into HTTP 1.1, and most modern browsers that support HTTP 1.1 support ZLIB inflation of deflated documents. In other words, they can decompress compressed files automatically, which saves time and bandwidth.</p>
<p>In the next step it is preparing the <em>stream</em> object used to hold the response output. We will not take dipper look into that code. As I expect that the a beginning developer even must be able know about next few line of code. <span style="font-family: Wingdings;">J</span></p>
<p>Let&#8217;s move to the line of code:</p>
<p><span style="color: green; font-family: Courier New; font-size: 10pt;">//now its time to read all the script/css files into a StringBuilder object.<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><br />
<span style="color: #2b91af;">StringBuilder</span> combinedSource = <span style="color: blue;">new</span><br />
<span style="color: #2b91af;">StringBuilder</span>();<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">foreach</span> (<span style="color: blue;">string</span> file <span style="color: blue;">in</span> GetFileNames(xStrSet, xStrpagecode, xStrType))<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> combinedSource.Append(System.IO.<span style="color: #2b91af;">File</span>.ReadAllText(context.Server.MapPath(file), <span style="color: #2b91af;">Encoding</span>.UTF8));<br />
</span></p>
<p>As you can see in the foreach loop, it is calling to method <span style="font-family: Courier New; font-size: 10pt;">GetFileNames, </span>by passing 3 different parameters. Here this is also core and important part of this project. Let me outline you first what this function basically do. This function will read to the &#8220;script.xml&#8221; file that hold content of script file that we want to load. Please look inside the attached project solution to understand it better. The function will read xml file and return array of string object containing JavaScript files to read.</p>
<p>In the subsequent line of code, it iterate through each file name and read it. Each content of read file is placed inside a <span style="color: #2b91af; font-family: Courier New; font-size: 10pt;">StringBuilder </span>object.</p>
<p>Please take look at the code inside the <span style="font-family: Courier New; font-size: 10pt;">GetFileNames </span>function to understand what is actually happening inside it. It fetches the JavaScript/CSS based on the parameter passed. And return either the JavaScript file name array or CSS file name array.</p>
<p>So now we have a combined script/CSS with us. It&#8217;s a time to minify JavaScript/CSS now.</p>
<p>Following line of code will minify respective JavaScript/CSS based on type of client script requested.</p>
<p><span style="color: green; font-family: Courier New; font-size: 10pt;">//use the YUI Javascript/CSS minifier to compress all js files<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><br />
<span style="color: blue;">if</span> (xStrType == <span style="color: #a31515;">&#8220;js&#8221;</span>)<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> {</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: #2b91af;">JavaScriptMinifier</span> minifier = <span style="color: blue;">new</span><br />
<span style="color: #2b91af;">JavaScriptMinifier</span>();<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> minified = minifier.Minify(combinedSource.ToString());<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> }</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">else<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> {<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> minified = CompressCSS(combinedSource.ToString());<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> }<br />
</span></p>
<p>The <span style="color: #2b91af; font-family: Courier New; font-size: 10pt;">JavaScriptMinifier </span>has been created in the 2<sup>nd</sup> step. Please refer to the attached solution project for more detail regarding this class file. I have adopted this class file from one of the article</p>
<p>You will also see function <span style="font-family: Courier New; font-size: 10pt;">CompressCSS </span>that is used to compress CSS file. The compressor of CSS file is done through just few regular expression. JavaScript compression has different algorithm.</p>
<p>After that it is calling to <span style="font-family: Courier New; font-size: 10pt;">WriteBytes </span>function that will prepare the combined &amp; compressed JavaScript &amp; CSS response and send it to the client.</p>
<p>Hurray… as part of implementation we are done.</p>
<p>Now it&#8217;s time to check that in action. You can run the project attached here with and check it In live action.</p>
<p>To download complete project, <a href="http://www.esnips.com/doc/bb247398-9971-4fac-bb8e-02a8e8ebad7d/JS-CSS-Combiner-Minifier">click here</a></p>
<p>Let&#8217;s compare the result of two different pages. The first one is with the compressed JavaScript &amp; CSS. The second one is with the normal JavaScript &amp; CSS. We will also see the difference in load time and size of content received.</p>
<p>Response time with compressed JavaScript &amp; CSS.</p>
<p><img src="http://techinsight.dhanashree.com/article-images/040510_1059_CombineComp1.jpg" alt="" /></p>
<p>Response time without compressed JavaScript &amp; CSS.</p>
<p><img src="http://techinsight.dhanashree.com/article-images/040510_1059_CombineComp2.jpg" alt="" /></p>
<p>As you can see from given statistics</p>
<p>With Combined &amp; Compressed JavaScript and CSS ..</p>
<p>Total request: 3</p>
<p>Response size: 16.3 KB</p>
<p>Without Combined &amp; Compressed JavaScript and CSS ..</p>
<p>Total request: 5</p>
<p>Response size: 96 KB</p>
<p>You can clearly see the difference between these two request.</p>
<p>To get more idea open and run the project yourself. That will give you better idea.</p>
<p>Hope you will find it very useful.</p>
<p>Happy coding…. <span style="font-family: Wingdings;">J</span></p>
<p><span style="font-family: Calibri; font-size: 15px; color: #ff0000;">NOTE<span style="mso-spacerun: yes;"> </span>:</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span lang="EN-IN"><span style="font-size: 11pt; font-family: Calibri;">If you are in need of any </span><a href="http://dhanashree.com/web-development-services/asp-php-web-development" target="_blank"><span style="font-size: 11pt; font-family: Calibri;">Web Development</span></a><span style="font-size: 11pt; font-family: Calibri;"> feel free to <span style="text-decoration: underline;"><a href="http://dhanashree.com/contact-web-designing-company" target="_blank">Inquire us</a></span> .<span style="mso-spacerun: yes;"> </span><span style="text-decoration: underline;"><a href="http://dhanashree.com/" target="_blank">Dhanashree Inc</a></span>. Expertise in <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/asp-php-web-development/dot-net-web-designing" target="_blank">Asp.net Development</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/asp-php-web-development/lamp-development-php-web-designing" target="_blank">Php Development</a></span>,<span style="mso-spacerun: yes;"> </span><span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/website-designing" target="_blank">Website designing</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/open-source-wordpress-joomla-oscommerce-customisation" target="_blank">Open Source customisation</a></span>. <span style="text-decoration: underline;"><a href="http://dhanashree.com/" target="_blank">Dhanashree Inc</a> </span>can be our <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/offshore-website-designing-company" target="_blank">offshore development company</a></span> / </span><a href="http://dhanashree.com/web-designing-outsource-advantages" target="_blank"><span style="font-size: 11pt; font-family: Calibri;">outsourcing</span></a><span style="font-size: 11pt; font-family: Calibri;"> <span style="text-decoration: underline;"><a href="http://dhanashree.com/dhanashree-web-development-profile" target="_blank">web development company</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/dedicated-php-dotnet-developer" target="_blank">hire dedicated web programmers</a></span>.</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span lang="EN-IN"><span style="font-size: 11pt; font-family: Calibri;">Above information is for knowledge sharing<span style="mso-spacerun: yes;"> </span>if you have problem / issue / suggestion please intimate us with details for proper and prompt action.</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://techinsight.dhanashree.com/combinecompressminify-javascript-css-in-asp-net/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Implementing JQuery Model Popup Plug-In and Playing FLV file in a model popup</title>
		<link>http://techinsight.dhanashree.com/implementing-j-query-model-popup-plug-in-and-playing-flv-file-in-a-model-popup/</link>
		<comments>http://techinsight.dhanashree.com/implementing-j-query-model-popup-plug-in-and-playing-flv-file-in-a-model-popup/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 12:48:26 +0000</pubDate>
		<dc:creator>kiran</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[J-Query]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Developement]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://techinsight.dhanashree.com/implementing-j-query-model-popup-plug-in-and-playing-flv-file-in-a-model-popup/</guid>
		<description><![CDATA[Implementing J-Query Model popup Plug In

As shown in above screen, developing Model Popup will require 2 layers:

Disabled Back ground
Popup content Panel

We will implement a plug In and call it on Popup Panel element.
Somewhat like:  $(&#8220;div.popupDiv&#8221;).ShowPopup();

ShowPopup();
Is a plug-In method which will initiate an instance of the plug-In which we going to implement as next step.
Prior [...]]]></description>
			<content:encoded><![CDATA[<h1><span style="font-size: 13px;"><em>Implementing J-Query Model popup Plug In</em></span></h1>
<p><img src="http://techinsight.dhanashree.com/article-images/032410_1247_Implementin1.png" alt="" /></p>
<p>As shown in above screen, developing Model Popup will require 2 layers:</p>
<ol>
<li>Disabled Back ground</li>
<li>Popup content Panel</li>
</ol>
<p>We will implement a plug In and call it on Popup Panel element.</p>
<p>Somewhat like:  <span style="font-family: Courier New; font-size: 10pt;">$(<span style="color: #a31515;">&#8220;div.popupDiv&#8221;</span>).ShowPopup();<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><strong><em>ShowPopup();</em></strong><br />
</span>Is a plug-In method which will initiate an instance of the plug-In which we going to implement as next step.</p>
<p>Prior to that a CSS for Disabled background needs to be developed</p>
<p>Which we can achieve as below:</p>
<p><span style="color: #a31515; font-family: Courier New; font-size: 10pt;">.popupbackGround<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;">{<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">position</span>: <span style="color: blue;">absolute</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">height</span>: <span style="color: blue;">100%</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">width</span>: <span style="color: blue;">100%</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">left</span>: <span style="color: blue;">0px</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">top</span>: <span style="color: blue;">0px</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">background-color</span>: <span style="color: blue;">#000</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">z-index</span>: <span style="color: blue;">1</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">opacity</span>: <span style="color: blue;">0.5</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">filter</span>: <span style="color: blue;">alpha(opacity =50)</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">display</span>: <span style="color: blue;">none</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;">}<br />
</span></p>
<p><span style="color: gray;"><em>We don&#8217;t have to assign this CSS class anywhere in HTML, but we will use this class while implementing Plug-In.</em><br />
</span></p>
<p><span style="color: gray;">Next to this, we will implement Model Popup J-Query Plug-In.<br />
</span></p>
<p><span style="color: gray;">Parameter to be passed to Plug-In: </span><span style="color: green; font-family: Courier New; font-size: 10pt;"><strong>closeButtonCSS<br />
</strong></span></p>
<p><span style="color: gray;">The plug in will be called on the popup panel itself and take one parameter called <strong>CloseButtonCSS </strong>which will be used to close the Model popup.<br />
</span></p>
<p><span style="color: gray;">We will create close event on the specified close button in parameter.<br />
</span></p>
<p><strong>model-popup.js<span style="color: gray;"> (Plug-In file)<br />
</span></strong></p>
<p><span style="font-family: Courier New; font-size: 10pt;">jQuery.noConflict();<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;">(<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">function</span>($K){<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;">$K.fn.ShowPopup=<span style="color: blue;">function</span>(data)<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> {</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: green;">/*<br />
</span></span></p>
<p><span style="color: green; font-family: Courier New; font-size: 10pt;"> Parameters:<br />
</span></p>
<p><span style="color: green; font-family: Courier New; font-size: 10pt;"> closeButtonCSS,<br />
</span></p>
<p><span style="color: green; font-family: Courier New; font-size: 10pt;"> */<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> $K(<span style="color: blue;">this</span>).each(<span style="color: blue;">function</span>(i)<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> {</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">var</span> dbBack,intTopAxis=0;</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">var</span> objCloseButton= $K(<span style="color: #a31515;">&#8220;.&#8221;</span> + data.closeButtonCSS);</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">var</span> objPopup= $K(<span style="color: blue;">this</span>);</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">var</span> a;</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;">objCloseButton.click(<span style="color: blue;">function</span>(){</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> HidePopup();<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> });<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> $K(window).scroll(<span style="color: blue;">function</span>()<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> {</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">var</span> xTop= parseInt($K(window).scrollTop()) + intTopAxis ;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> objPopup.animate({top:xTop+ <span style="color: #a31515;">&#8220;px&#8221;</span>},{queue: <span style="color: blue;">false</span>, duration: 350});<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> });<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> initBackGround = <span style="color: blue;">function</span>()<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> {<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> dbBack  = $K(<span style="color: #a31515;">&#8220;&lt;div&gt;&lt;/div&gt;&#8221;</span>).attr(<span style="color: #a31515;">&#8220;class&#8221;</span>,<span style="color: #a31515;">&#8220;popupbackGround&#8221;</span>).css(<span style="color: #a31515;">&#8220;height&#8221;</span>,$K(document).height()).hide();<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> $K(<span style="color: #a31515;">&#8220;body&#8221;</span>).append(dbBack);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> intTopAxis= parseInt(($K(window).height())/2)-(objPopup.height()/2);<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> }<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> ShowPopup = <span style="color: blue;">function</span>()<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> {<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> initBackGround();<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> dbBack.fadeIn(<span style="color: blue;">function</span>(){objPopup.show();});<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> objPopup.css({<span style="color: #a31515;">&#8220;left&#8221;</span>: (($K(window).width())/2)-(objPopup.width()/2),<span style="color: #a31515;">&#8220;top&#8221;</span>: (($K(window).height())/2)-(objPopup.height()/2)+parseInt($K(window).scrollTop())}) ;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> }<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> HidePopup = <span style="color: blue;">function</span>()<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> {<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> objPopup.fadeOut();<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> dbBack.fadeOut();<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> }<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> ShowPopup();<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> });<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> }<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;">})(jQuery);</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><br />
</span></p>
<h1><span style="font-size: 13px;"><em>How to call Model Popup</em></span></h1>
<h1><span style="font-weight: normal; font-size: 13px;">Popup Plug-In can be called on any Div object. And the DIV itself will get displayed as a popup like shown in the above screen.</span></h1>
<p>For example:</p>
<p>Target popup DIV class is <span style="color: #a31515; font-family: Courier New; font-size: 10pt;">popupDiv.<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><br />
<span style="color: blue;">&lt;</span><span style="color: #a31515;">div</span><span style="color: #a31515;"> </span><span style="color: red;">class</span><span style="color: blue;">=&#8221;popupDiv&#8221;&gt;</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;</span><span style="color: #a31515;">div</span><span style="color: blue;">&gt;<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;"> </span> Popup Content Goes Here..</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;/</span><span style="color: #a31515;">div</span><span style="color: blue;">&gt;</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;</span><span style="color: #a31515;">div</span><span style="color: #a31515;"> </span><span style="color: red;">class</span><span style="color: blue;">=&#8221;close&#8221;&gt;<span style="color: #000000;"><span style="color: blue;">&lt;</span><span style="color: #a31515;">a <span style="color: #000000;"><span style="color: red;">class</span><span style="color: blue;">=&#8221;lnkClose&#8221;&gt;<span style="color: #000000;"><span style="color: blue;">&lt;</span><span style="color: #a31515;">img <span style="color: #000000;"><span style="color: red;">src</span><span style="color: blue;">=&#8221;resource/small-closelabel.gif&#8221; <span style="color: #000000;"><span style="color: blue;">/&gt;&lt;/</span><span style="color: #a31515;">a</span><span style="color: blue;">&gt;</span></span></span></span></span></span></span></span></span></span></span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">&lt;/</span><span style="color: #a31515;">div</span><span style="color: blue;">&gt;</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;/</span><span style="color: #a31515;">div</span><span style="color: blue;">&gt;<br />
</span></span></p>
<p>We can popup by placing the following javascript :</p>
<p><span style="font-family: Courier New; font-size: 10pt;"> $k(<span style="color: #a31515;">&#8220;div.popupDiv&#8221;</span>).ShowPopup(<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> {<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> closeButtonCSS:<span style="color: #a31515;">&#8220;lnkClose&#8221;<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> });<br />
</span></p>
<p>Here &#8220;<span style="font-family: Courier New; font-size: 10pt;"><strong>closeButtonCSS:<span style="color: #a31515;">&#8220;lnkClose&#8221; </span></strong></span> is used to treat <strong>lnkClose </strong>as close button of popup.</p>
<h1></h1>
<h1><span style="font-size: 13px;"><em>Playing FLV</em></span></h1>
<p>To play any FLV file in HTML will require a flash based FLV player. There are many FLV players available among of those we will use one, which is a flash file and we can play FVL using the flash FLV player.</p>
<p>Here we will require 2 flash (SWF) files:</p>
<ol style="margin-left: 72pt;">
<li>flvplayer.swf (<a href="http://2gjqqg.bay.livefilestore.com/y1p79qAzBvUgYqQtUPobIBUzQlAhWgykS5T2dZdugTJteJPjhhsdFgkAa_B5ct_qVqgK8pBYFuwUhYeAc62aw4ycNoyv7gt2hce/flvplayer.swf?download">download </a>)</li>
<li>SteelExternalAll.swf (needs to be placed on same path of container HTML page) (<a href="http://2gjqqg.bay.livefilestore.com/y1pw8tb94dM-ToD4wwDeGTsH5473I2rvajjlhNetdx1lnAVF2smHXqBO17mTkfnOKhU-IPUg4PhoNtc-vcPe9cg9PbPC5V1HQwu/SteelExternalAll.swf?download">Download</a>)</li>
</ol>
<p>Below is how to embed object in HTML page to play FLV using above FLV player.</p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">&lt;</span><span style="color: #a31515;">object</span><span style="color: #a31515;"> </span><span style="color: red;">id</span><span style="color: blue;">=&#8221;Object1&#8243;</span><span style="color: blue;"> </span><span style="color: red;">height</span><span style="color: blue;">=&#8221;380&#8243;</span><span style="color: blue;"> </span><span style="color: red;">width</span><span style="color: blue;">=&#8221;400&#8243;</span><span style="color: blue;"> </span><span style="color: red;">classid</span><span style="color: blue;">=&#8221;clsid:D27CDB6E-AE6D-11cf-96B8- 444553540000&#8243; <span style="color: #000000;"><span style="color: red;">codebase</span><span style="color: blue;">=&#8221;http://macromedia.com/cabs/swflash.cab#version=6,0,0,0&#8243;&gt;</span></span></span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;"><span style="color: #000000;"><span style="color: blue;"><span style="color: #000000;"><span style="color: blue;">&lt;</span><span style="color: #a31515;">param <span style="color: #000000;"><span style="color: red;">name</span><span style="color: blue;">=&#8221;movie&#8221; <span style="color: #000000;"><span style="color: red;">value</span><span style="color: blue;">=&#8221;flash/flvplayer.swf&#8221; /&gt;</span></span></span></span></span></span></span></span></span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;</span><span style="color: #a31515;">param</span><span style="color: #a31515;"> </span><span style="color: red;">name</span><span style="color: blue;">=&#8221;FlashVars&#8221;</span><span style="color: blue;"> </span><span style="color: red;">value</span><span style="color: blue;">=&#8221;flvurl=../flash/test.flv&#8221;</span><span style="color: blue;"> </span><span style="color: blue;">/&gt;</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;</span><span style="color: #a31515;">param</span><span style="color: #a31515;"> </span><span style="color: red;">name</span><span style="color: blue;">=&#8221;quality&#8221;</span><span style="color: blue;"> </span><span style="color: red;">value</span><span style="color: blue;">=&#8221;high&#8221;</span><span style="color: blue;"> </span><span style="color: blue;">/&gt;</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;</span><span style="color: #a31515;">param</span><span style="color: #a31515;"> </span><span style="color: red;">value</span><span style="color: blue;">=&#8221;true&#8221;</span><span style="color: blue;"> </span><span style="color: red;">name</span><span style="color: blue;">=&#8221;autoplay&#8221;</span><span style="color: blue;"> </span><span style="color: blue;">/&gt;<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">&lt;</span><span style="color: #a31515;">embed</span><span style="color: #a31515;"> </span><span style="color: red;">height</span><span style="color: blue;">=&#8221;380&#8243;</span><span style="color: blue;"> </span><span style="color: red;">width</span><span style="color: blue;">=&#8221;400&#8243;</span><span style="color: blue;"> </span><span style="color: red;">src</span><span style="color: blue;">=&#8221;flash/flvplayer.swf&#8221;</span><span style="color: blue;"> </span><span style="color: red;">flashvars</span><span style="color: blue;">=&#8221;flvurl=../flash/test.flv&#8221; <span style="color: #000000;"><span style="color: red;">type</span><span style="color: blue;">=&#8221;application/x-shockwave-flash&#8221; /&gt;</span></span></span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">&lt;/</span><span style="color: #a31515;">object</span><span style="color: blue;">&gt;<br />
</span></span></p>
<p>Above code will take FLV file path as a parameter, that is been specified at 2 places.</p>
<ol>
<li><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;">flashvars</span><span style="color: blue;">=&#8221;flvurl=../flash/test.flv&#8221;</span></span></li>
<li><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">&lt;</span><span style="color: #a31515;">param</span><span style="color: #a31515;"> </span><span style="color: red;">name</span><span style="color: blue;">=&#8221;movie&#8221;</span><span style="color: blue;"> </span><span style="color: red;">value</span><span style="color: blue;">=&#8221;flash/flvplayer.swf&#8221;</span><span style="color: blue;"> </span><span style="color: blue;">/&gt;<br />
</span></span></li>
</ol>
<p>Your FLV file path will go here.</p>
<h1></h1>
<h1><span style="font-weight: normal; font-size: 13px;"><strong><em>Putting all together</em></strong></span></h1>
<p>Now we got both things ready with us.</p>
<ol style="margin-left: 72pt;">
<li>Implemented J-Query plug-In for model popup</li>
<li>FLV player</li>
</ol>
<p>Simply placing the &lt;object&gt; tag inside the Popup Div will result in our targeted output.</p>
<p>In addition to that we will require a Button to be clicked to show model popup. Like shown below</p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">&lt;</span><span style="color: #a31515;">a</span><span style="color: #a31515;"> </span><span style="color: red;">class</span><span style="color: blue;">=&#8221;lnkPopup&#8221;&gt;</span>Play FLV in Popup<span style="color: blue;">&lt;/</span><span style="color: #a31515;">a</span><span style="color: blue;">&gt;<br />
</span></span></p>
<p>Let&#8217;s create a simple J-Query click event of the above link and call popup plug-In inside click event, like shown below.</p>
<p><span style="font-family: Courier New; font-size: 10pt;"><br />
<span style="color: blue;">&lt;</span><span style="color: #a31515;">script</span><span style="color: #a31515;"> </span><span style="color: red;">type</span><span style="color: blue;">=&#8221;text/javascript&#8221;</span><span style="color: blue;"> </span><span style="color: red;">language</span><span style="color: blue;">=&#8221;javascript&#8221;&gt;<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><br />
<span style="color: blue;">var</span> $k=jQuery.noConflict();<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> $k(document).ready(<span style="color: blue;">function</span>()<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> {<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> $k(<span style="color: #a31515;">&#8220;a.lnkPopup&#8221;</span>).click(<span style="color: blue;">function</span>()<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> {<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> $k(<span style="color: #a31515;">&#8220;div.popupDiv&#8221;</span>).ShowPopup(<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> {<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> closeButtonCSS:<span style="color: #a31515;">&#8220;lnkClose&#8221;<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> });<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> });<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> });</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;/</span><span style="color: #a31515;">script</span><span style="color: blue;">&gt;<br />
</span></span></p>
<p>You can also download full source code ZIP file by clicking <a href="http://cid-180d3957230b5ca6.skydrive.live.com/self.aspx/Blog%20files/Popup%20FLV%20play/FLVplay-jq-modelpopup.rar">here</a> .</p>
<p><span style="font-family: Calibri; font-size: 15px; color: #ff0000;">NOTE<span style="mso-spacerun: yes;"> </span>:</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span lang="EN-IN"><span style="font-size: 11pt; font-family: Calibri;">If you are in need of any </span><a href="http://dhanashree.com/web-development-services/asp-php-web-development" target="_blank"><span style="font-size: 11pt; font-family: Calibri;">Web Development</span></a><span style="font-size: 11pt; font-family: Calibri;"> feel free to <span style="text-decoration: underline;"><a href="http://dhanashree.com/contact-web-designing-company" target="_blank">Inquire us</a></span> .<span style="mso-spacerun: yes;"> </span><span style="text-decoration: underline;"><a href="http://dhanashree.com/" target="_blank">Dhanashree Inc</a></span>. Expertise in <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/asp-php-web-development/dot-net-web-designing" target="_blank">Asp.net Development</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/asp-php-web-development/lamp-development-php-web-designing" target="_blank">Php Development</a></span>,<span style="mso-spacerun: yes;"> </span><span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/website-designing" target="_blank">Website designing</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/open-source-wordpress-joomla-oscommerce-customisation" target="_blank">Open Source customisation</a></span>. <span style="text-decoration: underline;"><a href="http://dhanashree.com/" target="_blank">Dhanashree Inc</a> </span>can be our <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/offshore-website-designing-company" target="_blank">offshore development company</a></span> / </span><a href="http://dhanashree.com/web-designing-outsource-advantages" target="_blank"><span style="font-size: 11pt; font-family: Calibri;">outsourcing</span></a><span style="font-size: 11pt; font-family: Calibri;"> <span style="text-decoration: underline;"><a href="http://dhanashree.com/dhanashree-web-development-profile" target="_blank">web development company</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/dedicated-php-dotnet-developer" target="_blank">hire dedicated web programmers</a></span>.</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span lang="EN-IN"><span style="font-size: 11pt; font-family: Calibri;">Above information is for knowledge sharing<span style="mso-spacerun: yes;"> </span>if you have problem / issue / suggestion please intimate us with details for proper and prompt action.</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://techinsight.dhanashree.com/implementing-j-query-model-popup-plug-in-and-playing-flv-file-in-a-model-popup/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Greetings on St-Patrick’s-Day &#8211; Happy St Patrick&#8217;s Day</title>
		<link>http://techinsight.dhanashree.com/greetings-on-st-patrick%e2%80%99s-day-happy-st-patricks-day/</link>
		<comments>http://techinsight.dhanashree.com/greetings-on-st-patrick%e2%80%99s-day-happy-st-patricks-day/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 13:05:23 +0000</pubDate>
		<dc:creator>kiran</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://techinsight.dhanashree.com/greeting-on-st-patrick%e2%80%99s-day-happy-st-patricks-day/</guid>
		<description><![CDATA[St. Patrick&#8217;s Day is celebrated on March 17, his religious feast day and the anniversary of his death in the fifth century. The Irish have observed this day as a religious holiday for over a thousand years. On St. Patrick&#8217;s Day, which falls during the Christian season of Lent, Irish families would traditionally attend church [...]]]></description>
			<content:encoded><![CDATA[<p>St. Patrick&#8217;s Day is celebrated on March 17, his religious feast day and the anniversary of his death in the fifth century. The Irish have observed this day as a religious holiday for over a thousand years. On St. Patrick&#8217;s Day, which falls during the Christian season of Lent, Irish families would traditionally attend church in the morning and celebrate in the afternoon. Lenten prohibitions against the consumption of meat were waived and people would dance, drink and feast—on the traditional meal of Irish bacon and cabbage.</p>
<p>St. Patrick&#8217;s Day is celebrated by the Irish and Irish at Heart in big cities and small towns alike with parades, &#8220;wearing of the green,&#8221; music and songs, Irish food and drink, and activities for kids such as crafts, coloring and games. It&#8217;s a time for fun.</p>
<p>Wearing of the Green Goes Global</p>
<p>Today, St. Patrick&#8217;s Day is celebrated by people of all backgrounds in the United States, Canada and Australia. Although North America is home to the largest productions, St. Patrick&#8217;s Day has been celebrated in other locations far from Ireland, including Japan, Singapore and Russia.</p>
<p style="text-align: right;"><strong>Happy St Patrick&#8217;s Day</strong></p>
<p><span style="font-family: Calibri; font-size: 15px; color: #ff0000;">NOTE<span style="mso-spacerun: yes;"> </span>:</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span lang="EN-IN"><span style="font-size: 11pt; font-family: Calibri;">If you are in need of any </span><a href="http://dhanashree.com/web-development-services/asp-php-web-development" target="_blank"><span style="font-size: 11pt; font-family: Calibri;">Web Development</span></a><span style="font-size: 11pt; font-family: Calibri;"> feel free to <span style="text-decoration: underline;"><a href="http://dhanashree.com/contact-web-designing-company" target="_blank">Inquire us</a></span> .<span style="mso-spacerun: yes;"> </span><span style="text-decoration: underline;"><a href="http://dhanashree.com/" target="_blank">Dhanashree Inc</a></span>. Expertise in <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/asp-php-web-development/dot-net-web-designing" target="_blank">Asp.net Development</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/asp-php-web-development/lamp-development-php-web-designing" target="_blank">Php Development</a></span>,<span style="mso-spacerun: yes;"> </span><span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/website-designing" target="_blank">Website designing</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/open-source-wordpress-joomla-oscommerce-customisation" target="_blank">Open Source customisation</a></span>. <span style="text-decoration: underline;"><a href="http://dhanashree.com/" target="_blank">Dhanashree Inc</a> </span>can be our <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/offshore-website-designing-company" target="_blank">offshore development company</a></span> / </span><a href="http://dhanashree.com/web-designing-outsource-advantages" target="_blank"><span style="font-size: 11pt; font-family: Calibri;">outsourcing</span></a><span style="font-size: 11pt; font-family: Calibri;"> <span style="text-decoration: underline;"><a href="http://dhanashree.com/dhanashree-web-development-profile" target="_blank">web development company</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/dedicated-php-dotnet-developer" target="_blank">hire dedicated web programmers</a></span>.</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span lang="EN-IN"><span style="font-size: 11pt; font-family: Calibri;">Above information is for knowledge sharing<span style="mso-spacerun: yes;"> </span>if you have problem / issue / suggestion please intimate us with details for proper and prompt action.</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://techinsight.dhanashree.com/greetings-on-st-patrick%e2%80%99s-day-happy-st-patricks-day/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Utilizing CSS3 features: Creating interactive and optimized HTML form using CSS3 selectors</title>
		<link>http://techinsight.dhanashree.com/utilizing-css3-features-creating-interactive-and-optimized-html-form-using-css3-selectors/</link>
		<comments>http://techinsight.dhanashree.com/utilizing-css3-features-creating-interactive-and-optimized-html-form-using-css3-selectors/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 04:58:34 +0000</pubDate>
		<dc:creator>kiran</dc:creator>
				<category><![CDATA[CSS 3]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Web Developement]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://techinsight.dhanashree.com/utilizing-css3-features-creating-interactive-and-optimized-html-form-using-css3-selectors/</guid>
		<description><![CDATA[CSS3 gives a great flexibility to designers to create optimized HTML by utilizing CSS3 features.
CSS3 selectors gives rich amount of DOM element filtering, which will let designers to minimize inline attributes and inline styles in HTML code.
Here I am giving an overview of how to utilize CSS3 to develop an HTML form as shown below.

We [...]]]></description>
			<content:encoded><![CDATA[<p>CSS3 gives a great flexibility to designers to create optimized HTML by utilizing CSS3 features.</p>
<p>CSS3 selectors gives rich amount of DOM element filtering, which will let designers to minimize inline attributes and inline styles in HTML code.</p>
<p>Here I am giving an overview of how to utilize CSS3 to develop an HTML form as shown below.</p>
<p><img src="http://techinsight.dhanashree.com/article-images/030910_0457_UtilizingCS1.png" alt="" /></p>
<p>We will try to optimize HTML as much as possible by giving all styles and attributes through CSS3 in css file itself.</p>
<p><strong>Form Concept:<br />
</strong></p>
<p>As shown in below screen, we will be dividing form into 4 pieces,</p>
<ol>
<li>Header part (<span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">&lt;</span><span style="color: maroon;">th</span><span style="color: blue;">&gt;</span></span> )</li>
<li>Left side labels (<span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">&lt;</span><span style="color: maroon;">td</span><span style="color: blue;">&gt;</span></span>)</li>
<li>Right side textbox area (<span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">&lt;</span><span style="color: maroon;">td</span><span style="color: blue;">&gt; &amp; &lt;</span><span style="color: maroon;">input</span><span style="color: maroon;"> </span><span style="color: red;">type</span><span style="color: blue;">=&#8221;text&#8221;</span><span style="color: blue;"> </span><span style="color: blue;">/&gt; </span></span> )</li>
<li>Bottom Buttons (  <span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">&lt;</span><span style="color: maroon;">input</span><span style="color: maroon;"> </span><span style="color: red;">type</span><span style="color: blue;">=&#8221;submit&#8221;/&gt;</span></span> )</li>
</ol>
<p><img src="http://techinsight.dhanashree.com/article-images/030910_0457_UtilizingCS2.png" alt="" /></p>
<p><strong>Generating Simple HTML form:<br />
</strong></p>
<p>As shown in below HTML, we will not give any attributes to TABLE or TD.</p>
<p>Just a simple Table with only one class which is assigned to TABLE, like <span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;">class</span><span style="color: blue;">=&#8221;tblform&#8221;. </span></span>Very neat HTML without any kind of attributes assigned.</p>
<p><span style="text-decoration: underline;"><strong><em>HTML file code<span style="color: blue; font-family: Courier New; font-size: 10pt;"><br />
</span></em></strong></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">&lt;</span><span style="color: maroon;">table </span><span style="color: red;">class</span><span style="color: blue;">=&#8221;tblform&#8221;&gt;</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;</span><span style="color: maroon;">tr</span><span style="color: blue;">&gt;</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;</span><span style="color: maroon;">th</span><span style="color: maroon;"> </span><span style="color: red;">colspan</span><span style="color: blue;">=&#8221;2&#8243;&gt;<span style="color: #000000;">Please enter your details below.<span style="color: blue;">&lt;/</span><span style="color: maroon;">th</span><span style="color: blue;">&gt;</span></span></span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;/</span><span style="color: maroon;">tr</span><span style="color: blue;">&gt;</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;</span><span style="color: maroon;">tr</span><span style="color: blue;">&gt;</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;</span><span style="color: maroon;">td</span><span style="color: blue;">&gt;<span style="color: #000000;">Name<span style="color: blue;">&lt;/</span><span style="color: maroon;">td</span><span style="color: blue;">&gt;</span></span></span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;</span><span style="color: maroon;">td</span><span style="color: blue;">&gt;<span style="color: #000000;"><span style="color: blue;">&lt;</span><span style="color: maroon;">input <span style="color: #000000;"><span style="color: red;">type</span><span style="color: blue;">=&#8221;text&#8221; /&gt;</span></span></span></span></span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;/</span><span style="color: maroon;">td</span><span style="color: blue;">&gt;</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;/</span><span style="color: maroon;">tr</span><span style="color: blue;">&gt;</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;</span><span style="color: maroon;">tr</span><span style="color: blue;">&gt;</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;</span><span style="color: maroon;">td</span><span style="color: blue;">&gt;<span style="color: #000000;">Email<span style="color: blue;">&lt;/</span><span style="color: maroon;">td</span><span style="color: blue;">&gt;</span></span></span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;</span><span style="color: maroon;">td</span><span style="color: blue;">&gt;<span style="color: #000000;"><span style="color: blue;">&lt;</span><span style="color: maroon;">input <span style="color: #000000;"><span style="color: red;">type</span><span style="color: blue;">=&#8221;text&#8221; /&gt;</span></span></span></span></span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;/</span><span style="color: maroon;">td</span><span style="color: blue;">&gt;</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;/</span><span style="color: maroon;">tr</span><span style="color: blue;">&gt;</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;</span><span style="color: maroon;">tr</span><span style="color: blue;">&gt;</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;</span><span style="color: maroon;">td</span><span style="color: blue;">&gt;<span style="color: #000000;">Mobile<span style="color: blue;">&lt;/</span><span style="color: maroon;">td</span><span style="color: blue;">&gt;</span></span></span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;</span><span style="color: maroon;">td</span><span style="color: blue;">&gt;<span style="color: #000000;"><span style="color: blue;">&lt;</span><span style="color: maroon;">input <span style="color: #000000;"><span style="color: red;">type</span><span style="color: blue;">=&#8221;text&#8221; /&gt;</span></span></span></span></span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;/</span><span style="color: maroon;">td</span><span style="color: blue;">&gt;</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;"><span style="color: #000000;"><span style="color: blue;">&lt;/</span><span style="color: maroon;">tr</span><span style="color: blue;">&gt;</span></span></span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;</span><span style="color: maroon;">tr</span><span style="color: blue;">&gt;</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;</span><span style="color: maroon;">td</span><span style="color: blue;">&gt;</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;/</span><span style="color: maroon;">td</span><span style="color: blue;">&gt;</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;</span><span style="color: maroon;">td</span><span style="color: blue;">&gt;<span style="color: #000000;"><span style="color: blue;">&lt;</span><span style="color: maroon;">input <span style="color: #000000;"><span style="color: red;">type</span><span style="color: blue;">=&#8221;submit&#8221; <span style="color: #000000;"><span style="color: red;">value</span><span style="color: blue;">=&#8221;Submit&#8221; /&gt;<span style="color: #000000;"><span style="color: blue;">&lt;</span><span style="color: maroon;">input <span style="color: #000000;"><span style="color: red;">type</span><span style="color: blue;">=&#8221;submit&#8221; <span style="color: #000000;"><span style="color: red;">value</span><span style="color: blue;">=&#8221;Cancel&#8221; /&gt;</span></span></span></span></span></span></span></span></span></span></span></span></span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;/</span><span style="color: maroon;">td</span><span style="color: blue;">&gt;</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;/</span><span style="color: maroon;">tr</span><span style="color: blue;">&gt;</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;/</span><span style="color: maroon;">table</span><span style="color: blue;">&gt;<br />
</span></span></p>
<p><strong>Developing CSS file:<br />
</strong></p>
<p>Once we got the above HTML ready, our all focus will be now on CSS to make it look like as shown in above screen shot,</p>
<p>In HTML there is only 1 CSS class assigned to TABLE which is <span style="color: blue; font-family: Courier New; font-size: 10pt;">tblform.<br />
</span></p>
<p>Further will be doing all stuffs in the CSS as given below,</p>
<p><span style="text-decoration: underline;"><strong><em>CSS file code<br />
</em></strong></span></p>
<p><span style="color: maroon; font-family: Courier New; font-size: 10pt;">.tblform<span style="color: #000000;">{</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">border-collapse</span>: <span style="color: blue;">collapse</span>;</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;">width</span>: <span style="color: blue;">100%</span>;</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">font-family</span>: <span style="color: blue;">Calibri</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">font-size</span>: <span style="color: blue;">11pt</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;">}<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: maroon;">.tblform</span><span style="color: maroon;"> </span><span style="color: maroon;">td<span style="color: #000000;">{</span></span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: maroon;"><span style="color: #000000;"><span style="color: red;">padding</span>: <span style="color: blue;">5px</span>;</span></span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">border</span>: <span style="color: blue;">solid</span><span style="color: blue;"> </span><span style="color: blue;">1px</span><span style="color: blue;"> </span><span style="color: blue;">#E1E1E1</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;">}<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: maroon;">.tblform</span><span style="color: maroon;"> </span><span style="color: maroon;">th<span style="color: #000000;">{</span></span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">padding</span>: <span style="color: blue;">5px</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">border</span>: <span style="color: blue;">solid</span><span style="color: blue;"> </span><span style="color: blue;">1px</span><span style="color: blue;"> </span><span style="color: blue;">#E1E1E1</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">font-weight</span>: <span style="color: blue;">normal</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">text-align</span>: <span style="color: blue;">left</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">background-color</span>: <span style="color: blue;">#E1E1E1</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">font-weight</span>: <span style="color: blue;">bold</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;">}<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: maroon;">.tblform</span><span style="color: maroon;"> </span><span style="color: maroon;">td</span><span style="color: maroon;"> </span><span style="color: maroon;">input[type=text]<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;">{<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">border</span>: <span style="color: blue;">1px</span><span style="color: blue;"> </span><span style="color: blue;">solid</span><span style="color: blue;"> </span><span style="color: blue;">#CCCCCC</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">width</span>: <span style="color: blue;">180px</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">height</span>: <span style="color: blue;">20px</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">padding-left</span>: <span style="color: blue;">5px</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;">}<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: maroon;">.tblform</span><span style="color: maroon;"> </span><span style="color: maroon;">td:first-child<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;">{<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">padding</span>: <span style="color: blue;">5px</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">border</span>: <span style="color: blue;">solid</span><span style="color: blue;"> </span><span style="color: blue;">1px</span><span style="color: blue;"> </span><span style="color: blue;">#E1E1E1</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">background-color</span>: <span style="color: blue;">#F2F2F2</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;">}<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: maroon;">.tblform</span><span style="color: maroon;"> </span><span style="color: maroon;">td</span><span style="color: maroon;"> </span><span style="color: maroon;">input[type=submit]</span>, <span style="color: maroon;">.tblform</span><span style="color: maroon;"> </span><span style="color: maroon;">td</span><span style="color: maroon;"> </span><span style="color: maroon;">input[type=submit]:hover<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;">{<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">background-image</span>: <span style="color: blue;">url(button-bg.gif)</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">background-repeat</span>: <span style="color: blue;">repeat-x</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">line-height</span>: <span style="color: blue;">22px</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">height</span>: <span style="color: blue;">25px</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">font-family</span>: <span style="color: blue;">Verdana,</span><span style="color: blue;"> </span><span style="color: blue;">Arial,</span><span style="color: blue;">Helvetica,</span><span style="color: blue;"> </span><span style="color: blue;">sans-serif</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">font-weight</span>: <span style="color: blue;">bold</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">font-size</span>: <span style="color: blue;">11px</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">color</span>: <span style="color: blue;">#333333</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">padding</span>: <span style="color: blue;">0px</span><span style="color: blue;"> </span><span style="color: blue;">10px</span><span style="color: blue;"> </span><span style="color: blue;">0px</span><span style="color: blue;"> </span><span style="color: blue;">10px</span>;</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;">border</span>: <span style="color: blue;">1px solid <span style="color: #000000;"><span style="color: blue;">#999999</span>;</span></span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: red;">cursor</span>: <span style="color: blue;">pointer</span><span style="color: blue;"> </span><span style="color: blue;">!important</span>;<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;">}<br />
</span></p>
<p>That&#8217;s it, it will result in a nice form with all CSS applied and HTML will remain neat as it is.</p>
<p><span style="font-family: Calibri; font-size: 15px; color: #ff0000;">NOTE<span style="mso-spacerun: yes;"> </span>:</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span lang="EN-IN"><span style="font-size: 11pt; font-family: Calibri;">If you are in need of any </span><a href="http://dhanashree.com/web-development-services/asp-php-web-development" target="_blank"><span style="font-size: 11pt; font-family: Calibri;">Web Development</span></a><span style="font-size: 11pt; font-family: Calibri;"> feel free to <span style="text-decoration: underline;"><a href="http://dhanashree.com/contact-web-designing-company" target="_blank">Inquire us</a></span> .<span style="mso-spacerun: yes;"> </span><span style="text-decoration: underline;"><a href="http://dhanashree.com/" target="_blank">Dhanashree Inc</a></span>. Expertise in <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/asp-php-web-development/dot-net-web-designing" target="_blank">Asp.net Development</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/asp-php-web-development/lamp-development-php-web-designing" target="_blank">Php Development</a></span>,<span style="mso-spacerun: yes;"> </span><span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/website-designing" target="_blank">Website designing</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/open-source-wordpress-joomla-oscommerce-customisation" target="_blank">Open Source customisation</a></span>. <span style="text-decoration: underline;"><a href="http://dhanashree.com/" target="_blank">Dhanashree Inc</a> </span>can be our <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/offshore-website-designing-company" target="_blank">offshore development company</a></span> / </span><a href="http://dhanashree.com/web-designing-outsource-advantages" target="_blank"><span style="font-size: 11pt; font-family: Calibri;">outsourcing</span></a><span style="font-size: 11pt; font-family: Calibri;"> <span style="text-decoration: underline;"><a href="http://dhanashree.com/dhanashree-web-development-profile" target="_blank">web development company</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/dedicated-php-dotnet-developer" target="_blank">hire dedicated web programmers</a></span>.</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span lang="EN-IN"><span style="font-size: 11pt; font-family: Calibri;">Above information is for knowledge sharing<span style="mso-spacerun: yes;"> </span>if you have problem / issue / suggestion please intimate us with details for proper and prompt action.</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://techinsight.dhanashree.com/utilizing-css3-features-creating-interactive-and-optimized-html-form-using-css3-selectors/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to make SQL Server 2005 database empty using cursor &amp; sys.objects (Delete All Tables, stored procedures, views &amp; UDF’s)</title>
		<link>http://techinsight.dhanashree.com/how-to-make-sql-server-2005-database-empty-using-cursor-sys-objects-delete-all-tables-stored-procedures-views-udf%e2%80%99s/</link>
		<comments>http://techinsight.dhanashree.com/how-to-make-sql-server-2005-database-empty-using-cursor-sys-objects-delete-all-tables-stored-procedures-views-udf%e2%80%99s/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 09:17:51 +0000</pubDate>
		<dc:creator>kiran</dc:creator>
				<category><![CDATA[SQL server 2005]]></category>
		<category><![CDATA[DBMS]]></category>
		<category><![CDATA[SQL server]]></category>

		<guid isPermaLink="false">http://techinsight.dhanashree.com/how-to-make-sql-server-2005-database-empty-using-cursor-sys-objects-delete-all-tables-stored-procedures-views-udf%e2%80%99s/</guid>
		<description><![CDATA[Understanding sys.objects:
Sys.objects is a system VIEW in SQL Server 2005, for each SQL database there is a separate sys.object view which gets stored within databse itself.
Using Sys.objects returns list of all database objects and its types, type can be either of given below:
DB OBJECT TYPES

F     FOREIGN_KEY_CONSTRAINT
IT    INTERNAL_TABLE
PK    PRIMARY_KEY_CONSTRAINT
S     SYSTEM_TABLE
SQ    SERVICE_QUEUE
U     USER_TABLE
V     VIEW
How to DELETE all User Tables , [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Understanding <span style="text-decoration: underline;">s</span><em><span style="text-decoration: underline;">ys.objects</span></em></strong>:</p>
<p><strong><em>Sys.objects</em></strong> is a system VIEW in SQL Server 2005, for each SQL database there is a separate <strong>sys.object </strong>view which gets stored within databse itself.</p>
<p>Using <strong><em>Sys.objects</em></strong> returns list of all database objects and its types, type can be either of given below:</p>
<p><span style="text-decoration: underline;"><strong>DB OBJECT TYPES<br />
</strong></span></p>
<p>F     FOREIGN_KEY_CONSTRAINT</p>
<p>IT    INTERNAL_TABLE</p>
<p>PK    PRIMARY_KEY_CONSTRAINT</p>
<p>S     SYSTEM_TABLE</p>
<p>SQ    SERVICE_QUEUE</p>
<p>U     USER_TABLE</p>
<p>V     VIEW</p>
<p><span style="text-decoration: underline;"><strong><em>How to DELETE all User Tables , stored procedures , UDF&#8217;s and Views using cursor<br />
</em></strong></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">Use</span> [database name]<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">declare</span> @q <span style="color: blue;">as</span><br />
<span style="color: blue;">nvarchar</span><span style="color: gray;">(</span><span style="color: fuchsia;">max</span><span style="color: gray;">)<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">declare</span> @name <span style="color: blue;">nvarchar</span><span style="color: gray;">(</span><span style="color: fuchsia;">max</span><span style="color: gray;">);<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">declare</span> @type <span style="color: blue;">nvarchar</span><span style="color: gray;">(</span><span style="color: fuchsia;">max</span><span style="color: gray;">);<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">declare</span> cur <span style="color: blue;">cursor</span><br />
<span style="color: blue;">for<span style="color: #000000;"> </span>select name <span style="color: #000000;"><span style="color: gray;">,</span><span style="color: blue;">type from <span style="color: #008000;">sys.objects <span style="color: #0000ff;">where type <span style="color: #000000;"><span style="color: gray;">in(</span><span style="color: red;">&#8216;p&#8217;</span><span style="color: gray;">,</span><span style="color: red;">&#8216;fn&#8217;</span><span style="color: gray;">,</span><span style="color: red;">&#8216;v&#8217;</span><span style="color: gray;">,</span><span style="color: red;">&#8216;u&#8217;</span><span style="color: gray;">);</span></span></span></span></span></span></span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">open</span> cur<span style="color: gray;">;<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">fetch</span> next <span style="color: blue;">from</span> cur <span style="color: blue;">into</span> @name<span style="color: gray;">,</span>@type </span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: #0000ff;">while <span style="color: #ff00ff;">@@fetch_status <span style="color: #000000;"><span style="color: gray;">=</span> 0</span></span></span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: #0000ff;"><span style="color: #ff00ff;"><span style="color: #000000;"><span style="color: #0000ff;">begin</span></span></span></span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">if</span><span style="color: gray;">(</span>@type<span style="color: gray;">=</span><span style="color: red;">&#8216;p&#8217;</span><span style="color: gray;">)<br />
</span></span></p>
<p><span style="color: blue; font-family: Courier New; font-size: 10pt;">begin<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">set</span> @q<span style="color: gray;">=</span>N<span style="color: red;">&#8216;drop procedure &#8216;</span><span style="color: red;"> </span><span style="color: gray;">+</span> @name<span style="color: gray;">;<br />
</span></span></p>
<p><span style="color: blue; font-family: Courier New; font-size: 10pt;">end<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">if</span><span style="color: gray;">(</span>@type<span style="color: gray;">=</span><span style="color: red;">&#8216;fn&#8217;</span><span style="color: gray;">)<br />
</span></span></p>
<p><span style="color: blue; font-family: Courier New; font-size: 10pt;">begin</span></p>
<p><span style="color: blue; font-family: Courier New; font-size: 10pt;"><span style="color: #000000;"><span style="color: blue;">set</span> @q<span style="color: gray;">=</span>N<span style="color: red;">&#8216;drop function &#8216; <span style="color: #000000;"><span style="color: gray;">+</span> @name<span style="color: gray;">;</span></span></span></span></span></p>
<p><span style="color: blue; font-family: Courier New; font-size: 10pt;">end<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">if</span><span style="color: gray;">(</span>@type<span style="color: gray;">=</span><span style="color: red;">&#8216;v&#8217;</span><span style="color: gray;">)<br />
</span></span></p>
<p><span style="color: blue; font-family: Courier New; font-size: 10pt;">begin<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">set</span> @q<span style="color: gray;">=</span>N<span style="color: red;">&#8216;drop view &#8216;</span><span style="color: red;"> </span><span style="color: gray;">+</span> @name<span style="color: gray;">;<br />
</span></span></p>
<p><span style="color: blue; font-family: Courier New; font-size: 10pt;">end<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">if</span><span style="color: gray;">(</span>@type<span style="color: gray;">=</span><span style="color: red;">&#8216;u&#8217;</span><span style="color: gray;">)<br />
</span></span></p>
<p><span style="color: blue; font-family: Courier New; font-size: 10pt;">begin<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">set</span> @q<span style="color: gray;">=</span>N<span style="color: red;">&#8216;drop table &#8216;</span><span style="color: red;"> </span><span style="color: gray;">+</span> @name<span style="color: gray;">;<br />
</span></span></p>
<p><span style="color: blue; font-family: Courier New; font-size: 10pt;">end<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">exec</span><span style="color: blue;"> </span><span style="color: maroon;">sp_executesql</span> @q<span style="color: gray;">;<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">fetch</span> next <span style="color: blue;">from</span> cur <span style="color: blue;">into</span> @name<span style="color: gray;">,</span>@type<br />
</span></p>
<p><span style="color: blue; font-family: Courier New; font-size: 10pt;">end<br />
</span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">close</span> cur<span style="color: gray;">;<br />
</span></span></p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">deallocate</span> cur<span style="color: gray;">;</span></span></p>
<p><span style="font-family: Calibri; font-size: 15px; color: #ff0000;">NOTE<span style="mso-spacerun: yes;"> </span>:</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span lang="EN-IN"><span style="font-size: 11pt; font-family: Calibri;">If you are in need of any </span><a href="http://dhanashree.com/web-development-services/asp-php-web-development" target="_blank"><span style="font-size: 11pt; font-family: Calibri;">Web Development</span></a><span style="font-size: 11pt; font-family: Calibri;"> feel free to <span style="text-decoration: underline;"><a href="http://dhanashree.com/contact-web-designing-company" target="_blank">Inquire us</a></span> .<span style="mso-spacerun: yes;"> </span><span style="text-decoration: underline;"><a href="http://dhanashree.com/" target="_blank">Dhanashree Inc</a></span>. Expertise in <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/asp-php-web-development/dot-net-web-designing" target="_blank">Asp.net Development</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/asp-php-web-development/lamp-development-php-web-designing" target="_blank">Php Development</a></span>,<span style="mso-spacerun: yes;"> </span><span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/website-designing" target="_blank">Website designing</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/open-source-wordpress-joomla-oscommerce-customisation" target="_blank">Open Source customisation</a></span>. <span style="text-decoration: underline;"><a href="http://dhanashree.com/" target="_blank">Dhanashree Inc</a> </span>can be our <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/offshore-website-designing-company" target="_blank">offshore development company</a></span> / </span><a href="http://dhanashree.com/web-designing-outsource-advantages" target="_blank"><span style="font-size: 11pt; font-family: Calibri;">outsourcing</span></a><span style="font-size: 11pt; font-family: Calibri;"> <span style="text-decoration: underline;"><a href="http://dhanashree.com/dhanashree-web-development-profile" target="_blank">web development company</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/dedicated-php-dotnet-developer" target="_blank">hire dedicated web programmers</a></span>.</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span lang="EN-IN"><span style="font-size: 11pt; font-family: Calibri;">Above information is for knowledge sharing<span style="mso-spacerun: yes;"> </span>if you have problem / issue / suggestion please intimate us with details for proper and prompt action.</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://techinsight.dhanashree.com/how-to-make-sql-server-2005-database-empty-using-cursor-sys-objects-delete-all-tables-stored-procedures-views-udf%e2%80%99s/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to take Outlook 2007 data file backup</title>
		<link>http://techinsight.dhanashree.com/how-to-take-outlook-2007-data-file-backup/</link>
		<comments>http://techinsight.dhanashree.com/how-to-take-outlook-2007-data-file-backup/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 10:00:21 +0000</pubDate>
		<dc:creator>kiran</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Outlook 2007]]></category>
		<category><![CDATA[Tools & Technology]]></category>
		<category><![CDATA[Outlook]]></category>

		<guid isPermaLink="false">http://techinsight.dhanashree.com/how-to-take-outlook-2007-data-file-backup/</guid>
		<description><![CDATA[Step 1:

Open outlook 2007, Go to menu and chose…

Tools &#62; account settings &#62; data files

You will find the screen like shown below:



Now select the 1from the listing which shows default (your active email account data file). As I have marked as round in above screen.

After selecting the file from list, now click on the &#8220;Open [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #333333; font-family: Verdana; font-size: 9pt;"><strong>Step 1:</strong><br />
</span></p>
<p><span style="color: #333333; font-family: Verdana; font-size: 9pt;">Open outlook 2007, Go to menu and chose…<br />
</span></p>
<p><span style="color: #333333; font-family: Verdana; font-size: 9pt;">Tools &gt; account settings &gt; data files<br />
</span></p>
<p><span style="color: #333333; font-family: Verdana; font-size: 9pt;">You will find the screen like shown below:<br />
</span></p>
<p style="text-align: center;"><img class="aligncenter" src="http://techinsight.dhanashree.com/article-images/022010_0959_HowtotakeOu1.png" alt="" width="434" height="352" /><span style="color: #333333; font-family: Verdana; font-size: 9pt;"><br />
</span></p>
<p><span style="color: #333333; font-family: Verdana; font-size: 9pt;">Now select the 1from the listing which shows default (your active email account data file). As I have marked as round in above screen.<br />
</span></p>
<p><span style="color: #333333; font-family: Verdana; font-size: 9pt;">After selecting the file from list, now click on the &#8220;Open folder&#8221; as shown in above screen.<br />
</span></p>
<p><span style="color: #333333; font-family: Verdana; font-size: 9pt;"><strong>Step 2:</strong><br />
</span></p>
<p><span style="color: #333333; font-family: Verdana; font-size: 9pt;">Clicking on <strong>Open folder</strong> will take you to the folder where your outlook data file is located,<br />
</span></p>
<p><span style="color: #333333; font-family: Verdana; font-size: 9pt;">And you will find that file selected in the folder,<br />
</span></p>
<p style="text-align: center;"><img class="aligncenter" src="http://techinsight.dhanashree.com/article-images/022010_0959_HowtotakeOu2.png" alt="" width="493" height="377" /><span style="color: #333333; font-family: Verdana; font-size: 9pt;"><br />
</span></p>
<p><span style="color: #333333; font-family: Verdana; font-size: 9pt;">Now all you have to do is just Copy the data file from this folder and save wherever you want to keep as backup.<br />
</span></p>
<p><span style="font-family: Calibri; font-size: 15px; color: #ff0000;">NOTE<span style="mso-spacerun: yes;"> </span>:</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span lang="EN-IN"><span style="font-size: 11pt; font-family: Calibri;">If you are in need of any </span><a href="http://dhanashree.com/web-development-services/asp-php-web-development" target="_blank"><span style="font-size: 11pt; font-family: Calibri;">Web Development</span></a><span style="font-size: 11pt; font-family: Calibri;"> feel free to <span style="text-decoration: underline;"><a href="http://dhanashree.com/contact-web-designing-company" target="_blank">Inquire us</a></span> .<span style="mso-spacerun: yes;"> </span><span style="text-decoration: underline;"><a href="http://dhanashree.com/" target="_blank">Dhanashree Inc</a></span>. Expertise in <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/asp-php-web-development/dot-net-web-designing" target="_blank">Asp.net Development</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/asp-php-web-development/lamp-development-php-web-designing" target="_blank">Php Development</a></span>,<span style="mso-spacerun: yes;"> </span><span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/website-designing" target="_blank">Website designing</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/open-source-wordpress-joomla-oscommerce-customisation" target="_blank">Open Source customisation</a></span>. <span style="text-decoration: underline;"><a href="http://dhanashree.com/" target="_blank">Dhanashree Inc</a> </span>can be our <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/offshore-website-designing-company" target="_blank">offshore development company</a></span> / </span><a href="http://dhanashree.com/web-designing-outsource-advantages" target="_blank"><span style="font-size: 11pt; font-family: Calibri;">outsourcing</span></a><span style="font-size: 11pt; font-family: Calibri;"> <span style="text-decoration: underline;"><a href="http://dhanashree.com/dhanashree-web-development-profile" target="_blank">web development company</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/dedicated-php-dotnet-developer" target="_blank">hire dedicated web programmers</a></span>.</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span lang="EN-IN"><span style="font-size: 11pt; font-family: Calibri;">Above information is for knowledge sharing<span style="mso-spacerun: yes;"> </span>if you have problem / issue / suggestion please intimate us with details for proper and prompt action.</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://techinsight.dhanashree.com/how-to-take-outlook-2007-data-file-backup/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Quick DBMS reference: Single line definitions of important SQL Server terms</title>
		<link>http://techinsight.dhanashree.com/quick-dbms-reference-single-line-definitions-of-important-sql-server-terms-2/</link>
		<comments>http://techinsight.dhanashree.com/quick-dbms-reference-single-line-definitions-of-important-sql-server-terms-2/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 09:36:40 +0000</pubDate>
		<dc:creator>kiran</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[SQL server 2005]]></category>
		<category><![CDATA[DBMS]]></category>

		<guid isPermaLink="false">http://techinsight.dhanashree.com/?p=188</guid>
		<description><![CDATA[Normalization: is a process of organizing data and minimizing redundancy 
De-normalization: is a technique to move from higher to lower normal forms of database modeling in order to speed up database access.
Stored Procedure: is a named group of T-SQL statements which can be created and stored in Database as an object.
Primary Key: is a unique [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Normalization: </strong>is a process of organizing data and minimizing redundancy<strong> </strong></p>
<p><strong>De-normalization: </strong>is a technique to move from higher to lower normal forms of database modeling in order to speed up database access.</p>
<p><strong>Stored Procedure: </strong>is a named group of T-SQL statements which can be created and stored in Database as an object.</p>
<p><strong>Primary Key: </strong>is a unique identifier of a row in a DB table, [it can’t be NULL]</p>
<p><strong>Unique key: </strong>forces uniqueness to a respective table column, [it can be NULL]</p>
<p><strong>Foreign Key: </strong>a foreign key in 1 table refers to the primary key in other table, Used to force referential integrity.</p>
<p><strong>Inner join: </strong>exists in both tables</p>
<p><strong>Left Outer join: </strong>all records from left side table + matched rows from right side table (totals number of rows will be same as left table)</p>
<p><strong>Right Outer join: </strong>all records from right side table + matched rows from left side table (totals number of rows will be same as right table), it’s a mirror image of left outer join</p>
<p><strong>Full Outer join: </strong>all records from left side table + all records from right side table, weather matched or not</p>
<p><strong>Cross join: </strong>returns [left table rows * right table rows], a Cartesian product of both tables</p>
<p><strong>Self join: </strong>when table joins to itself using diff aliases to avoid confusion</p>
<p><strong>Union: </strong>selects only distinct records from both tables</p>
<p><strong>Union all: </strong>selects all records from both tables</p>
<p><strong>View: </strong>is a subset of a table, can be used to retrieve data, insert or Update data. Can contain multiple select statements inside</p>
<p><strong>Trigger: </strong>A trigger is a SQL procedure that initiates an action when an event (INSERT, DELETE or UPDATE) occurs.</p>
<p><strong>Cursor: </strong>is a database object used to loop trough records on row by row bases.</p>
<p><strong>Index: </strong>pointers to data records, represents structure of how data get stored physically in a table</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="319" valign="top"><strong>Clustered index</strong></td>
<td width="319" valign="top"><strong>Non clustered index</strong></td>
</tr>
<tr>
<td width="319" valign="top">Reorders physical data stored in table</td>
<td width="319" valign="top">It contains pointers to data rows</td>
</tr>
<tr>
<td width="319" valign="top">A table can have Only 1 clustered index</td>
<td width="319" valign="top">A table can have one OR many    non-clustered index</td>
</tr>
<tr>
<td width="319" valign="top">Leaf nodes contains data</td>
<td width="319" valign="top">Leaf nodes contains reference to data</td>
</tr>
</tbody>
</table>
<p><strong> </strong></p>
<p><strong>Linked server: </strong>is a concept of adding other remote server to a group to query DB’s of both servers together</p>
<p><strong>Collation: set of rules that determines how data stores &amp; compares in database</strong><strong> </strong></p>
<p><strong>Collation types: case sensitive, accent sensitive, kana sensitive, width sensitive</strong></p>
<p><strong>Data ware housing: </strong></p>
<ol>
<li>Record should Never delete from DB</li>
<li>All records must be linked</li>
<li>Once committed records should be read-only</li>
<li>All changes made must be tracked with time</li>
</ol>
<p><strong>User defined function (UDF): </strong>is a bunch of T-SQL statements which accepts 0 or more parameters and returns a scalar data value or table.</p>
<p><strong>DDL:</strong> data definition language – e.g. <strong>TRUNCATE</strong> command is a DDL command</p>
<p><strong>DML:</strong> data manipulation language – e.g. <strong>INSERT</strong>, <strong>UPDATE</strong> &amp; <strong>DELETE</strong> are DML commands</p>
<p><span style="font-family: Calibri; font-size: 15px; color: #ff0000;">NOTE<span style="mso-spacerun: yes;"> </span>:</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span lang="EN-IN"><span style="font-size: 11pt; font-family: Calibri;">If you are in need of any </span><a href="http://dhanashree.com/web-development-services/asp-php-web-development" target="_blank"><span style="font-size: 11pt; font-family: Calibri;">Web Development</span></a><span style="font-size: 11pt; font-family: Calibri;"> feel free to <span style="text-decoration: underline;"><a href="http://dhanashree.com/contact-web-designing-company" target="_blank">Inquire us</a></span> .<span style="mso-spacerun: yes;"> </span><span style="text-decoration: underline;"><a href="http://dhanashree.com/" target="_blank">Dhanashree Inc</a></span>. Expertise in <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/asp-php-web-development/dot-net-web-designing" target="_blank">Asp.net Development</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/asp-php-web-development/lamp-development-php-web-designing" target="_blank">Php Development</a></span>,<span style="mso-spacerun: yes;"> </span><span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/website-designing" target="_blank">Website designing</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/open-source-wordpress-joomla-oscommerce-customisation" target="_blank">Open Source customisation</a></span>. <span style="text-decoration: underline;"><a href="http://dhanashree.com/" target="_blank">Dhanashree Inc</a> </span>can be our <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/offshore-website-designing-company" target="_blank">offshore development company</a></span> / </span><a href="http://dhanashree.com/web-designing-outsource-advantages" target="_blank"><span style="font-size: 11pt; font-family: Calibri;">outsourcing</span></a><span style="font-size: 11pt; font-family: Calibri;"> <span style="text-decoration: underline;"><a href="http://dhanashree.com/dhanashree-web-development-profile" target="_blank">web development company</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/dedicated-php-dotnet-developer" target="_blank">hire dedicated web programmers</a></span>.</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span lang="EN-IN"><span style="font-size: 11pt; font-family: Calibri;">Above information is for knowledge sharing<span style="mso-spacerun: yes;"> </span>if you have problem / issue / suggestion please intimate us with details for proper and prompt action.</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://techinsight.dhanashree.com/quick-dbms-reference-single-line-definitions-of-important-sql-server-terms-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Understanding asp.net MVC (Model View Controller) architecture</title>
		<link>http://techinsight.dhanashree.com/understanding-asp-net-mvc-model-view-controller-architecture/</link>
		<comments>http://techinsight.dhanashree.com/understanding-asp-net-mvc-model-view-controller-architecture/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 06:21:38 +0000</pubDate>
		<dc:creator>kiran</dc:creator>
				<category><![CDATA[.net 3.5]]></category>
		<category><![CDATA[.net framework]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Web Developement]]></category>
		<category><![CDATA[.net developement]]></category>

		<guid isPermaLink="false">http://techinsight.dhanashree.com/understanding-asp-net-mvc-model-view-controller-architecture/</guid>
		<description><![CDATA[This article is intended to provide basic concept and fundamentals of asp.net MVC (Model View Controller) architecture workflow for beginners.
Introduction:

&#8220;M&#8221;  &#8220;V&#8221;   &#8220;C&#8221;  stands for &#8220;MODEL&#8221;  &#8220;VIEW&#8221; &#8220;CONTROLLER&#8221; , asp.net MVC is an architecture to develop asp.net web applications in a different manner than the traditional asp.net web development , web [...]]]></description>
			<content:encoded><![CDATA[<p>This article is intended to provide basic concept and fundamentals of asp.net MVC (Model View Controller) architecture workflow for beginners.</p>
<p><span style="text-decoration: underline;">Introduction:<br />
</span></p>
<p>&#8220;M&#8221;  &#8220;V&#8221;   &#8220;C&#8221;  stands for &#8220;MODEL&#8221;  &#8220;VIEW&#8221; &#8220;CONTROLLER&#8221; , asp.net MVC is an architecture to develop asp.net web applications in a different manner than the traditional asp.net web development , web applications developed with asp.net MVC is even more SEO (Search Engine Friendly ) friendly.</p>
<p>Developing asp.net MVC application requires Microsoft .net framework 3.5 or higher.</p>
<p><span style="text-decoration: underline;">MVC interaction with browser:<br />
</span></p>
<p>Like a normal web server interaction, MVC application also accept request and respond web browser same way.</p>
<p><img src="http://techinsight.dhanashree.com/article-images/020510_0621_Understandi1.png" alt="" /></p>
<p><span style="text-decoration: underline;">Inside MVC architecture:<br />
</span></p>
<p>Whole asp.net MVC architecture is based on Microsoft .net framework 3.5 and in addition uses LINQ to SQL Server.</p>
<p><strong>What is a Model? </strong></p>
<ol>
<li>MVC <strong>model</strong> is basically a C# or VB.net class</li>
<li>A <strong>model</strong> is accessible by both <strong>controller</strong> and <strong>view</strong></li>
<li>A <strong>model</strong> can be used to pass data from <strong>Controller</strong> to <strong>view</strong>.</li>
<li>A <strong>view</strong> can use model to display data in page.</li>
</ol>
<p><strong>What is a View?<br />
</strong></p>
<ol>
<li>View is an ASPX page without having a code behind file</li>
<li>All page specific HTML generation and formatting can be done inside view</li>
<li>One can use Inline code (server tags ) to develop dynamic pages</li>
<li>A request to <strong>view</strong> (ASPX page) can be made only from a controller&#8217;s action method</li>
</ol>
<p><strong>What is a Controller?<br />
</strong></p>
<ol>
<li><strong>Controller</strong> is basically a C# or VB.net class which inherits <strong>system.mvc.controller</strong></li>
<li><strong>Controller</strong> is a heart of whole MVC architecture</li>
<li>Inside<strong> Controller&#8217;s class </strong>action methods can be implemented which is responsible for responding to browser OR calling view&#8217;s.<strong><br />
</strong></li>
<li><strong>Controller</strong> can access and use <strong>model</strong> class to pass data to <strong>view&#8217;s<br />
</strong></li>
<li><strong>Controller </strong>uses <strong>ViewData </strong>to pass any data to <strong>view</strong></li>
</ol>
<p><img src="http://techinsight.dhanashree.com/article-images/020510_0621_Understandi2.png" alt="" /></p>
<h3><span style="text-decoration: underline;"><span style="font-weight: normal;">MVC file structure &amp; file naming standards</span><br />
</span></h3>
<p>MVC uses a standard directory structure and file naming standards which is very important part of MVC application development.</p>
<p>Inside the ROOT directory of the application there must be 3 directories each for model, view and Controller.</p>
<p>Apart from 3 directories there must have a <strong>Global.asax </strong>file in root folder. And a web.config like a traditional asp.net application.</p>
<ul>
<li>
<div><strong>Root </strong>[directory]<strong><br />
</strong></div>
<ul>
<li>
<div><strong>Controller</strong> [directory]</div>
<ul>
<li>Controller CS files</li>
</ul>
</li>
<li>
<div><strong>Models</strong> [directory]</div>
<ul>
<li>Model CS files</li>
</ul>
</li>
<li>
<div><strong>Views </strong>[directory]<strong><br />
</strong></div>
<ul>
<li>View CS files<strong><br />
</strong></li>
</ul>
</li>
<li>Global.asax</li>
<li>Web.config</li>
</ul>
</li>
</ul>
<p><span style="text-decoration: underline;">Asp.net MVC Execution life cycle<br />
</span></p>
<p>Here is how MVC architecture executes the requests to browser and objects interactions with each other.</p>
<p>A step by step process is explained below:  <strong>[Refer figure as given below]</strong></p>
<p><img src="http://techinsight.dhanashree.com/article-images/020510_0621_Understandi3.png" alt="" /></p>
<p><span style="color: #0070c0;"><strong>Step 1: </strong><br />
<strong>Browser request</strong><br />
</span></p>
<p>Browser request happens with a specific URL. Let&#8217;s assume that user entering URL like: [xyz.com]/home/index/</p>
<p><span style="color: #0070c0;"><strong>Step 2:  Job of Global.asax &#8211; MVC routing<br />
</strong></span></p>
<p>The specified URL will first get parsed via application_start() method inside Global.asax file. From the requested URL it will parse the <strong>Controller, Action and ID.<br />
</strong></p>
<p>So for [xyz.com]/home/index/:</p>
<p>Controller = home</p>
<p>Action = index()</p>
<p>ID = empty  &#8212; we have not specified ID in [xyz.com]/home/index/, so it will consider as empty string</p>
<p><span style="color: #0070c0;"><strong>Step 3:  Controller and Action methods<br />
</strong></span></p>
<p>MVC now find the <strong>home controller</strong> class in controller directory.  A controller class contains different action methods,</p>
<p>There can be more than one action method, but MVC will only invokes the action method which is been parsed from the URL, its index() in our case.</p>
<p>So something like: <strong>homeController.index() </strong>will happen inside MVC controller class.</p>
<p>Invoking action method can return plain text string OR rendered HTML by using view.</p>
<p><span style="color: #0070c0;"><strong>Step 4:  Call to View (ASPX page)<br />
</strong></span></p>
<p>Invoking view will return <strong>view()</strong> . a call to view will access the particular ASPX page inside the view directory and generate the rendered HTML from the ASPX and will respond back to the browser.</p>
<p>In our case controller was <strong>home </strong>and action was <strong>index().</strong> So calling view() will return a rendered HTML from the ASPX page located at <strong>/views/home/index.aspx.<br />
</strong></p>
<p><strong>This is it, the whole process ends here. So this is how MVC architecture works.</strong></p>
<p><span style="font-family: Calibri; font-size: 15px; color: #ff0000;">NOTE<span style="mso-spacerun: yes;"> </span>:</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span lang="EN-IN"><span style="font-size: 11pt; font-family: Calibri;">If you are in need of any </span><a href="http://dhanashree.com/web-development-services/asp-php-web-development" target="_blank"><span style="font-size: 11pt; font-family: Calibri;">Web Development</span></a><span style="font-size: 11pt; font-family: Calibri;"> feel free to <span style="text-decoration: underline;"><a href="http://dhanashree.com/contact-web-designing-company" target="_blank">Inquire us</a></span> .<span style="mso-spacerun: yes;"> </span><span style="text-decoration: underline;"><a href="http://dhanashree.com/" target="_blank">Dhanashree Inc</a></span>. Expertise in <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/asp-php-web-development/dot-net-web-designing" target="_blank">Asp.net Development</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/asp-php-web-development/lamp-development-php-web-designing" target="_blank">Php Development</a></span>,<span style="mso-spacerun: yes;"> </span><span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/website-designing" target="_blank">Website designing</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/open-source-wordpress-joomla-oscommerce-customisation" target="_blank">Open Source customisation</a></span>. <span style="text-decoration: underline;"><a href="http://dhanashree.com/" target="_blank">Dhanashree Inc</a> </span>can be our <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/offshore-website-designing-company" target="_blank">offshore development company</a></span> / </span><a href="http://dhanashree.com/web-designing-outsource-advantages" target="_blank"><span style="font-size: 11pt; font-family: Calibri;">outsourcing</span></a><span style="font-size: 11pt; font-family: Calibri;"> <span style="text-decoration: underline;"><a href="http://dhanashree.com/dhanashree-web-development-profile" target="_blank">web development company</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/dedicated-php-dotnet-developer" target="_blank">hire dedicated web programmers</a></span>.</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span lang="EN-IN"><span style="font-size: 11pt; font-family: Calibri;">Above information is for knowledge sharing<span style="mso-spacerun: yes;"> </span>if you have problem / issue / suggestion please intimate us with details for proper and prompt action.</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://techinsight.dhanashree.com/understanding-asp-net-mvc-model-view-controller-architecture/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Dot Net framework 3.5, C#, VB.Net Language Improvements: Automatic Properties, Object initializers, Collection Initializers, Lambda expression, Anonymous type</title>
		<link>http://techinsight.dhanashree.com/dot-net-framework-3-5-c-vb-net-language-improvements-automatic-properties-object-initializers-collection-initializers-lambda-expression-anonymous-type/</link>
		<comments>http://techinsight.dhanashree.com/dot-net-framework-3-5-c-vb-net-language-improvements-automatic-properties-object-initializers-collection-initializers-lambda-expression-anonymous-type/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 11:15:52 +0000</pubDate>
		<dc:creator>kiran</dc:creator>
				<category><![CDATA[.net 3.5]]></category>
		<category><![CDATA[.net framework]]></category>
		<category><![CDATA[Tools & Technology]]></category>
		<category><![CDATA[.net developement]]></category>

		<guid isPermaLink="false">http://techinsight.dhanashree.com/?p=167</guid>
		<description><![CDATA[The new .net 3.5 has significant improved features. This feature makes the .net programming concept more sophisticated. You will now be able to write less code and build more dynamic application using those.
From all of them what the most I like is the LINQ, which allow you to query over variety of objects.
LINQ is all [...]]]></description>
			<content:encoded><![CDATA[<p>The new .net 3.5 has significant improved features. This feature makes the .net programming concept more sophisticated. You will now be able to write less code and build more dynamic application using those.</p>
<p>From all of them what the most I like is the LINQ, which allow you to query over variety of objects.</p>
<p>LINQ is all about queries, they returns a set of matching objects, a single object, or a subset of fields from an object or set of objects. In LINQ, this returned set of objects is called a <em>sequence</em>.</p>
<p>Basically LINQ comes in variety of flavors’ like following:</p>
<ul>
<li>LINQ to Objects</li>
<li>LINQ to XML</li>
<li>LINQ to Dataset</li>
<li>LINQ to SQL</li>
<li>LINQ to Entities</li>
</ul>
<p>Well there is a detailed discussion on LINQ further in this article. Let me first make you guys introduce to the language improvements in .net 3.5. In fact I believe that these new improvements are essential to learn before we actually get dig into the LINQ J.</p>
<p>To summarize quickly, here are the list of new language feature that are shipped with .Net 3.5.</p>
<ul>
<li>Automatic properties</li>
<li>Object initializers, Collection initializers</li>
<li>Anonymous types</li>
<li>Extension methods</li>
<li>Query Expression</li>
</ul>
<p>Well if you are the C# developer, I believe you will really love to have such significant improvement. Because these features puts extra wing on your programming skill.</p>
<p>The important is not that you learn the latest technology of .Net 3.5 like WCF, WPF, Silverlight etc. These are the core part of basic programming. Its like you should be knowing the if syntax of C programming language before you actually write your first “Hello word” program J</p>
<p>So let’s go through each of them step by step and try to understand what they are and how it can help the developer to create rich internet/desktop application.</p>
<ul>
<li><strong>Automatic Property</strong></li>
</ul>
<p>Before I explain you the concept of “automatic property in .net 3.5, can you guys first please try to go through the following code?</p>
<p>public class MShoppingCart</p>
<p>{</p>
<p>private int _cartId;</p>
<p>public int CartId</p>
<p>{</p>
<p>get { return _cartId; }</p>
<p>set { _cartId = value; }</p>
<p>}</p>
<p>private int _customerid;</p>
<p>public int Customerid</p>
<p>{</p>
<p>get { return _customerid; }</p>
<p>set { _customerid = value; }</p>
<p>}</p>
<p>private int _billingaddressid;</p>
<p>public int Billingaddressid</p>
<p>{</p>
<p>get { return _billingaddressid; }</p>
<p>set { _billingaddressid = value; }</p>
<p>}</p>
<p>private int _shippingaddressid;</p>
<p>public int Shippingaddressid</p>
<p>{</p>
<p>get { return _shippingaddressid; }</p>
<p>set { _shippingaddressid = value; }</p>
<p>}</p>
<p>private MShippingCartItem _cartitem;</p>
<p>public MShippingCartItem Cartitem</p>
<p>{</p>
<p>get { return _cartitem; }</p>
<p>set { _cartitem = value; }</p>
<p>}</p>
<p>}</p>
<p>Most of the time we are used to write such model classes. This are the most basic and popular mechanism in returning a wrapper classes. The basic purpose of writing such getter/setter property is to hide the actual private member of our classes. It has been the standard pattern to access the private method of any classes. Well you may arise with a question that why do we actually need to write such getter/setter properties. Can’t we simply expose the private member? Well the answer is YES, but I would request you to remember the fundamental of object oriented programming. J</p>
<p>Anyway there are basically two reason of not doing so. Following are this:</p>
<ol>
<li>You won’t be easily able to bind those private variable to controls</li>
<li>You will not be able to modify them into property later on.</li>
</ol>
<p>The first point is quite understandable, what do you mean by the second one? Well, say for e.g. if you need to add any business logic or validation logic when assigning value to any private variable then? You will not be able to do that.</p>
<p>So what if we need not to write even the private variables? Exited, yes the new version of .Net 3.5 allows you have such facility. The concept is called automatic property. All you have to do is to write the getter/setter property. You need not to worry about the private member of that property. The compiler will decide and prepare base private member for you on the fly.</p>
<p>See the example in the following.</p>
<p>public class MShoppingCart</p>
<p>{</p>
<p>public int CartId</p>
<p>{</p>
<p>get;</p>
<p>set;</p>
<p>}</p>
<p>public int Customerid</p>
<p>{</p>
<p>get;</p>
<p>set;</p>
<p>}</p>
<p>public int Billingaddressid</p>
<p>{</p>
<p>get;</p>
<p>set;</p>
<p>}</p>
<p>public int Shippingaddressid</p>
<p>{</p>
<p>get;</p>
<p>set;</p>
<p>}</p>
<p>private MShippingCartItem _cartitem;</p>
<p>public MShippingCartItem Cartitem</p>
<p>{</p>
<p>get;</p>
<p>set;</p>
<p>}</p>
<p>}</p>
<p>Now it this case when the compiler will encounter this properties while compiling your code, it will automatically expose the private variable for each of property with its associated type. For e.g. compiler automatically assume and expose the <em>_cartid</em> private variable of integer type. Using advantage of this is we need not to worry about the underlying private variable. In future we can add any sort of validation logic in this property.</p>
<ul>
<li><strong>Object initialization, collection initialization</strong></li>
</ul>
<p>I would like to explain this concept by taking the example of automatic property so that I maintain the continuity for you to understand. Say for e.g. when we want to use the “shopping cart” class that we created earlier. What we do is write following code.</p>
<p>MShoppingCart cart = new MShoppingCart();</p>
<p>cart.CartId = 1;</p>
<p>cart.Customerid = 1001111;</p>
<p>cart.Shippingaddressid = 2333;</p>
<p>cart.Billingaddressid = 2232;</p>
<p>With the feature supported by the .net framework 3.5, you can take advantage of what is called “syntactic sugar”, and that is object initializers.</p>
<p>Using object initializers, you can write the same code given above, in following way.</p>
<p>MShoppingCart cart = new MShoppingCart {CartId =1, Customerid=1001111, Billingaddressid=2232, Shippingaddressid =23333  };</p>
<p>So it allows you to pass the value of all property at the time of initializing the object.</p>
<p>In fact it not only allow to initialize object’s property in this way, you can also have nested initialization of object within any object.</p>
<p>To demonstrate you, see the following example.</p>
<p>MShoppingCart cart = new MShoppingCart { CartId = 1, Customerid = 1001111, Billingaddressid = 2232, Shippingaddressid = 23333, <strong><span style="text-decoration: underline;">Cartitem = new MShippingCartItem { }</span></strong> };</p>
<p>If you see in the highlighted (underlined) part of above code, you can clearly see that the child object can also be initialized in the same way.</p>
<p>As if the new object initialization enhancements were not enough, someone at Microsoft must have said, “What about collections?” Collection initialization allows you to specify the initialization values for a collection, just like you would do for an object, as long as the collection implements the</p>
<p>System.Collections.Generic.ICollection&lt;T&gt; interface.</p>
<p>List&lt;string&gt; presidents = new List&lt;string&gt; { &#8220;Name 1&#8243;, &#8220;Name 2&#8243;, &#8220;Name 3&#8243; };</p>
<p>foreach (string president in presidents)</p>
<p>{</p>
<p>Console.WriteLine(president);</p>
<p>}</p>
<ul>
<li><strong>Anonymous types</strong></li>
</ul>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p>What is anonymous type?</p>
<p>Well, we have been familiar till date with different types. They are either custom classes or any of .net’s build in type. So what is actually the anonymous type is. The answer is that the “Anonymous type” has no type defined to it. It has no type name. Though there should be at least one type name associated in .Net. In anonymous type, the type name is specified by the developer doing the programming. It is the compiler which will identify the type to associate with the declaration of any anonymous type.</p>
<p>There is also another significant different in anonymous type is that it is called <em>immutable</em>. The definition of immutable type is that the one that is declared and initialized once. It can’t be altered later on. So anonymous type has the same characteristic. Once you declared and initialized, you can’t alter the anonymous type afterward.</p>
<p>This is also why anonymous types have been introduced. They allow us to create a type on the fly and therefore return only certain values of a given named type. This is very handy when only a subset of properties is needed, properties are joined together or even objects are joined together.</p>
<p>class Program</p>
<p>{</p>
<p>static void Main(string[] args)</p>
<p>{</p>
<p>// create a list of carts with dummy data.</p>
<p>List&lt;MShoppingCart&gt; carts = new List&lt;MShoppingCart&gt;();</p>
<p>carts.Add(new MShoppingCart { CartId=101, Customerid=1001, Billingaddressid=20, Shippingaddressid =30});</p>
<p>carts.Add(new MShoppingCart { CartId = 102, Customerid = 1002, Billingaddressid = 22, Shippingaddressid = 33 });</p>
<p>carts.Add(new MShoppingCart { CartId=103, Customerid=1003, Billingaddressid=23, Shippingaddressid =34});</p>
<p>// query the cart collection to collect cart with id of 101</p>
<p>var result = from c in carts</p>
<p>where c.CartId &gt;= 101</p>
<p>// put the result in a anonymous type</p>
<p>select new { c.Billingaddressid  };</p>
<p>// loop over the result.</p>
<p>foreach (var item in result)</p>
<p>{</p>
<p>// print out the name of the item.</p>
<p>Console.WriteLine(item.Billingaddressid );</p>
<p>}</p>
<p>}</p>
<p>}</p>
<p>Anonymous type are mostly used when working with the LINQ. It is utilized highly while querying to your data in LINQ. It is irrespective which flavor of LINQ you are using.</p>
<p>Although the anonymous type can be used in your own code also. It is especially useful when we want to combine different variables into one.</p>
<p>Se for e.g. following example:</p>
<p>// create an anonymous type instance with a name.</p>
<p>var anonymousType = new</p>
<p>{</p>
<p>Name = name,</p>
<p>Age = age,</p>
<p>Nationality = nationality</p>
<p>};</p>
<p>// print the name to the console.</p>
<p>Console.WriteLine(anonymousType.Name);</p>
<p>Though the real time use of anonymous type Is when you use it with the LINQ. I need to write a separate article to demonstrate you actual usage LINQ. J</p>
<ul>
<li><strong>Extension methods</strong></li>
</ul>
<p><strong> </strong></p>
<p>An extension method is a static method of a static class that you can call as though it were an instance method of a different class.</p>
<p>To make you understand the extension method, let me first re cape the class level methods (static methods) and instance methods. The primary different between these two is that the instance method can also be access by initializing object of any class. It can’t be invoked by using class name only. The exact opposite of that is class method. You can only call static class method using the name of class only. You can’t access them using the instance of same class.</p>
<p>I am not gonna give you any example for the above explanation as I expect from you guys that you are familiar with the different I explained.</p>
<p>Extension method is a way of extending existing classes for whatever additional functionality. Let me demonstrate you that by example.</p>
<p>namespace ExtensionMethods</p>
<p>{</p>
<p>public static class StringExtensionMethods</p>
<p>{</p>
<p>public static bool IsNumeric(this string str)</p>
<p>{</p>
<p>try</p>
<p>{</p>
<p>int i = int.Parse(str);</p>
<p>return true;</p>
<p>}</p>
<p>catch</p>
<p>{</p>
<p>}</p>
<p>return false;</p>
<p>}</p>
<p>}</p>
<p>}</p>
<p>In the above given example, almost everything seems to be similar what we are used to in normal programming. But, the difference is clearly seen. You should be able to notice that in the “IsNumeric” static method parameter are passed using <em>this </em>keyword. This keyword tells the compiler what you are going to extend for particular given type. So in this example it tells you that it extends the existing string class.</p>
<p>See for e.g. how to use the extension method.</p>
<p>string s = &#8220;someValue&#8221;;</p>
<p>bool bs = s.IsNumeric();</p>
<p>// bs is false;</p>
<p>string i = &#8220;7&#8243;;</p>
<p>bool bi = i.IsNumeric();</p>
<p>// bi is true;</p>
<ul>
<li><strong>Query Expression</strong></li>
</ul>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p>One of the conveniences that the C# language provides is the foreach statement. When you use foreach, the compiler translates it into a loop with calls to and MoveNext. The simplicity the foreach statement provides for enumerating through arrays and collections has made it very popular and often used.</p>
<p>One of the features of LINQ that seems to attract developers is the SQL-like syntax available for LINQ queries. The first few LINQ examples in the first chapter of this book use this syntax. This syntax is provided via the new C# 3.0 language enhancement known as query expressions. Query expressions allow LINQ queries to be expressed in nearly SQL form. To perform a LINQ query, it is not required to use query expressions. The alternative is to use standard C# dot notation, calling methods on objects and classes.</p>
<p>Although it is occupy a dedicated book for detail understanding of query expression with LINQ. Just to summarize you, here is the example that shows you what actually query expression does.</p>
<p>For e.g.</p>
<p>string[] names = {</p>
<p>&#8220;Adams&#8221;, &#8220;Arthur&#8221;, &#8220;Buchanan&#8221;, &#8220;Bush&#8221;, &#8220;Carter&#8221;, &#8220;Cleveland&#8221;,</p>
<p>&#8220;Clinton&#8221;, &#8220;Coolidge&#8221;, &#8220;Eisenhower&#8221;, &#8220;Fillmore&#8221;, &#8220;Ford&#8221;, &#8220;Garfield&#8221;,</p>
<p>&#8220;Grant&#8221;, &#8220;Harding&#8221;, &#8220;Harrison&#8221;, &#8220;Hayes&#8221;, &#8220;Hoover&#8221;, &#8220;Jackson&#8221;,</p>
<p>&#8220;Jefferson&#8221;, &#8220;Johnson&#8221;, &#8220;Kennedy&#8221;, &#8220;Lincoln&#8221;, &#8220;Madison&#8221;, &#8220;McKinley&#8221;,</p>
<p>&#8220;Monroe&#8221;, &#8220;Nixon&#8221;, &#8220;Pierce&#8221;, &#8220;Polk&#8221;, &#8220;Reagan&#8221;, &#8220;Roosevelt&#8221;, &#8220;Taft&#8221;,</p>
<p>&#8220;Taylor&#8221;, &#8220;Truman&#8221;, &#8220;Tyler&#8221;, &#8220;Van Buren&#8221;, &#8220;Washington&#8221;, &#8220;Wilson&#8221;};</p>
<p>IEnumerable&lt;string&gt; sequence = from n in names</p>
<p>where n.Length &lt; 6</p>
<p>select n;</p>
<p>foreach (string name in sequence)</p>
<p>{</p>
<p>Console.WriteLine(&#8220;{0}&#8221;, name);</p>
<p>}</p>
<p>Though query expression can be used by two different way. 1) is using dot notation and 2) is using expression syntax.</p>
<p>Hope I could make you understand what are the new improvements in the newer version of .net 3.5.</p>
<p>Once you are aware and familiar with this feature, you are ready to get dig into dip into the word of .net 3.5 for all new existing experience in developing rich internet/enterprise application.</p>
<p>Best luck</p>
<p><span style="font-family: Calibri; font-size: 15px; color: #ff0000;">NOTE<span style="mso-spacerun: yes;"> </span>:</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span lang="EN-IN"><span style="font-size: 11pt; font-family: Calibri;">If you are in need of any </span><a href="http://dhanashree.com/web-development-services/asp-php-web-development" target="_blank"><span style="font-size: 11pt; font-family: Calibri;">Web Development</span></a><span style="font-size: 11pt; font-family: Calibri;"> feel free to <span style="text-decoration: underline;"><a href="http://dhanashree.com/contact-web-designing-company" target="_blank">Inquire us</a></span> .<span style="mso-spacerun: yes;"> </span><span style="text-decoration: underline;"><a href="http://dhanashree.com/" target="_blank">Dhanashree Inc</a></span>. Expertise in <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/asp-php-web-development/dot-net-web-designing" target="_blank">Asp.net Development</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/asp-php-web-development/lamp-development-php-web-designing" target="_blank">Php Development</a></span>,<span style="mso-spacerun: yes;"> </span><span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/website-designing" target="_blank">Website designing</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/open-source-wordpress-joomla-oscommerce-customisation" target="_blank">Open Source customisation</a></span>. <span style="text-decoration: underline;"><a href="http://dhanashree.com/" target="_blank">Dhanashree Inc</a> </span>can be our <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/offshore-website-designing-company" target="_blank">offshore development company</a></span> / </span><a href="http://dhanashree.com/web-designing-outsource-advantages" target="_blank"><span style="font-size: 11pt; font-family: Calibri;">outsourcing</span></a><span style="font-size: 11pt; font-family: Calibri;"> <span style="text-decoration: underline;"><a href="http://dhanashree.com/dhanashree-web-development-profile" target="_blank">web development company</a></span>, <span style="text-decoration: underline;"><a href="http://dhanashree.com/web-development-services/dedicated-php-dotnet-developer" target="_blank">hire dedicated web programmers</a></span>.</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span lang="EN-IN"><span style="font-size: 11pt; font-family: Calibri;">Above information is for knowledge sharing<span style="mso-spacerun: yes;"> </span>if you have problem / issue / suggestion please intimate us with details for proper and prompt action.</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://techinsight.dhanashree.com/dot-net-framework-3-5-c-vb-net-language-improvements-automatic-properties-object-initializers-collection-initializers-lambda-expression-anonymous-type/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
