<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0' version='2.0'><channel><atom:id>tag:blogger.com,1999:blog-814396016109370747</atom:id><lastBuildDate>Sat, 31 Mar 2012 13:53:58 +0000</lastBuildDate><title>Tech Geek- Amit Kumar Shinde</title><description>Knowledge become power only when we put it into use</description><link>http://amitshinde14.blogspot.com/</link><managingEditor>noreply@blogger.com (Amit Kumar Shinde)</managingEditor><generator>Blogger</generator><openSearch:totalResults>112</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-814396016109370747.post-2819601829434664277</guid><pubDate>Fri, 30 Mar 2012 04:52:00 +0000</pubDate><atom:updated>2012-03-29T21:52:39.251-07:00</atom:updated><title>Folder structure for a .NET application</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I usually stick to the same base folder structure for my .NET  applications. This one works well for both my open source projects and  enterprise projects at work:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;table border="0" class="padded-table" style="width: 708px;"&gt;&lt;tbody&gt;&lt;tr&gt;       &lt;td valign="top" width="202"&gt;&lt;br /&gt;&lt;li&gt;Branch name (usually ‘trunk’) &lt;/li&gt;&lt;br /&gt;&lt;/td&gt;        &lt;td valign="top" width="504"&gt;This root folder contains the solution file.&lt;/td&gt;     &lt;/tr&gt;&lt;tr&gt;       &lt;td valign="top" width="203"&gt;&lt;ul&gt;&lt;li&gt;Application &lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;        &lt;td valign="top" width="503"&gt;All the projects of the application goes here. Each project in it’s own subfolder. &lt;/td&gt;     &lt;/tr&gt;&lt;tr&gt;       &lt;td valign="top" width="204"&gt;&lt;ul&gt;&lt;li&gt;Build &lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;        &lt;td valign="top" width="502"&gt;I keep all build related stuff here, like:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The signing key for the application &lt;/li&gt;&lt;li&gt;A C# project holding the main MSBuild script file and any custom MSBuild tasks              &lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;     &lt;/tr&gt;&lt;tr&gt;       &lt;td valign="top" width="205"&gt;&lt;ul&gt;&lt;li&gt;Common &lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;        &lt;td valign="top" width="501"&gt;Usually not much here, except always a SolutionInfo.cs file.          &lt;br /&gt;&lt;/td&gt;     &lt;/tr&gt;&lt;tr&gt;       &lt;td valign="top" width="206"&gt;&lt;ul&gt;&lt;li&gt;Documentation &lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;        &lt;td valign="top" width="501"&gt;All developer-related  documents of the project are kept here. This way a developer can easily  get the latest version of a document without leaving Visual Studio.           &lt;br /&gt;If the project contains auto-generated documentation (for instance using &lt;a href="http://www.codeplex.com/Sandcastle" target="_blank"&gt;Sandcastle&lt;/a&gt;), these generator-projects are kept here as well.           &lt;br /&gt;&lt;/td&gt;     &lt;/tr&gt;&lt;tr&gt;       &lt;td valign="top" width="207"&gt;&lt;ul&gt;&lt;li&gt;Installers &lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;        &lt;td valign="top" width="500"&gt;All installer projects are kept here (Setup projects, &lt;a href="http://wix.sourceforge.net/" target="_blank"&gt;WIX&lt;/a&gt; projects). Each project in it’s own subfolder.           &lt;br /&gt;&lt;/td&gt;     &lt;/tr&gt;&lt;tr&gt;       &lt;td valign="top" width="207"&gt;&lt;ul&gt;&lt;li&gt;Lib &lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;        &lt;td valign="top" width="500"&gt;This folder contains all the external assemblies used by the project.          &lt;br /&gt;All Visual Studio projects reference the needed dll’s directly from this folder.           &lt;br /&gt;&lt;/td&gt;     &lt;/tr&gt;&lt;tr&gt;       &lt;td valign="top" width="207"&gt;&lt;ul&gt;&lt;li&gt;Tests &lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;        &lt;td valign="top" width="500"&gt;Contains all test projects,  usually divided in unit tests, integration tests and test helpers. Each  project in it’s own subfolder.          &lt;br /&gt;&lt;/td&gt;     &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Note that the above is the physical folder structure. I always make sure  that the version control has the excact same folder structure. Never  try to build this folder structure from within Visual Studio. Instead  build it by hand and add it to source control by hand.&lt;br /&gt;&lt;br /&gt;In the main Visual Studio solution file however, I alter the structure  slightly by putting the contents of the Application folder directly in  the solution root, and mimic the rest of the folders using solution  folders:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Solution root      &lt;ul&gt;&lt;li&gt;All projects of the Application folder &lt;/li&gt;&lt;li&gt;Build &lt;/li&gt;&lt;li&gt;Common &lt;/li&gt;&lt;li&gt;Documentation &lt;/li&gt;&lt;li&gt;Installers &lt;/li&gt;&lt;li&gt;Lib &lt;/li&gt;&lt;li&gt;Tests &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Now, with everything being nicely structured, it’s time to do some coding.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/814396016109370747-2819601829434664277?l=amitshinde14.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://amitshinde14.blogspot.com/2012/03/folder-structure-for-net-application.html</link><author>noreply@blogger.com (Amit Kumar Shinde)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-814396016109370747.post-2630564781958331334</guid><pubDate>Fri, 30 Mar 2012 03:28:00 +0000</pubDate><atom:updated>2012-03-29T20:28:57.117-07:00</atom:updated><title>What is volatile keyword in C#</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;span id="header1"&gt;&lt;span id="Article1"&gt;&lt;span class="serif"&gt;&lt;span class="heading"&gt;  &lt;b&gt;volatile&lt;/b&gt;&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;span class="bodytext"&gt; The keyword &lt;b&gt;volatile&lt;/b&gt; means that a field can be modified in the  program by thinks along the lines of say the operating system, hardware  or even a thread executing concurrently.  General syntax of &lt;b&gt;volatile&lt;/b&gt; is: &lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="cs"&gt;&lt;/span&gt;&lt;table cellspacing="0" id="Table1"&gt;&lt;tbody&gt;&lt;br /&gt;&lt;tr&gt;&lt;td class="codebg"&gt;&lt;pre&gt;&lt;span class="cs"&gt;&lt;/span&gt;&lt;b&gt;volatile&lt;/b&gt; &lt;i&gt;declaration&lt;/i&gt;&lt;br /&gt;&lt;span class="cs"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/pre&gt;where: &lt;br /&gt;&lt;br /&gt;&lt;i&gt;declaration&lt;/i&gt; is of a field. &lt;br /&gt;&lt;br /&gt;Key Points: &lt;br /&gt;&lt;br /&gt;Whenever a &lt;b&gt;volatile&lt;/b&gt; is requested, the system returns the current  value at the time of the request.  All assignments are written to the  object immediately. &lt;br /&gt;&lt;br /&gt;Common usage of the &lt;b&gt;volatile&lt;/b&gt; modifier is when a particular field is accessed by many threads without using the &lt;i&gt;lock&lt;/i&gt; statement to serialize access.  So in essence the &lt;b&gt;volatile&lt;/b&gt;  modifier guarantees that a thread will retrieve the most recent value  written by another thread (even if it was modified by the previous  instruction from you call). &lt;br /&gt;&lt;br /&gt;You are not allowed to use &lt;b&gt;volatile&lt;/b&gt; on just any time.  The following is a list of types you can implement this modifier on: &lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;   Any reference type.   &lt;/li&gt;&lt;li&gt;   Any pointer type in a unsafe context   &lt;/li&gt;&lt;li&gt;   sbyte, byte, short, ushort, int, uint, char, float, bool.   &lt;/li&gt;&lt;li&gt;    An enum type with an enum base type of the following: byte, sbyte, short,     ushort, int, uint.&lt;/li&gt;&lt;/ul&gt;Example: &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="cs"&gt;&lt;/span&gt;&lt;table cellspacing="0" id="Table2"&gt;&lt;tbody&gt;&lt;br /&gt;&lt;tr&gt;&lt;td class="codebg"&gt;&lt;pre&gt;&lt;span class="cs"&gt;public &lt;/span&gt;volatile &lt;span class="cs"&gt;int&lt;/span&gt; iAge;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/814396016109370747-2630564781958331334?l=amitshinde14.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://amitshinde14.blogspot.com/2012/03/what-is-volatile-keyword-in-c.html</link><author>noreply@blogger.com (Amit Kumar Shinde)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-814396016109370747.post-5748748073618036147</guid><pubDate>Thu, 29 Mar 2012 07:32:00 +0000</pubDate><atom:updated>2012-03-29T00:32:15.326-07:00</atom:updated><title>C# How To Encode or Decode a String to Base64 UTF-8</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;This example uses the .NET Framework 4 Encoding Class to Base64 Encode  and Decode a supplied sting in your C# Application. The example syntax  can be used in any ASP.Net or Win32 program.In addition to the UTF-8  example I've supplied below, the framework also supports methods for  encoding/decoding ASCIIEncoding, UnicodeEncoding, UTF32Encoding,  UTF7Encoding and UTF8Encoding.&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="" name="more"&gt;&lt;/a&gt;&lt;b&gt;Assumptions:&lt;/b&gt; Your project contains these 3 controls (Label1, TextBox1, Button1)&lt;br /&gt;&lt;br /&gt;&lt;div class="my_code_snippet"&gt;&lt;span class="my_dark_blue"&gt;protected void&lt;/span&gt; Button1_Click(&lt;span class="my_dark_blue"&gt;object&lt;/span&gt; sender, &lt;span class="my_teal"&gt;EventArgs&lt;/span&gt; e)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Label1.Text = EncodeTo64UTF8(TextBox1.Text.ToString());&lt;br /&gt;}&lt;/div&gt;&lt;br /&gt;&lt;b&gt;C# Base64 Encoding Method:&lt;/b&gt;&lt;br /&gt;&lt;div class="my_code_snippet"&gt;&lt;span class="my_gray"&gt;/// &lt;summary&gt;&lt;br /&gt;/// This method creates a Base64 encoded string from an input &lt;br /&gt;/// parameter string.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;/// &lt;param name="m_enc" /&gt;The String containing the characters &lt;br /&gt;/// to be encoded.&lt;br /&gt;/// &lt;returns&gt;The Base64 encoded string.&lt;/returns&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="my_dark_blue"&gt;public static string&lt;/span&gt; EncodeTo64UTF8(&lt;span class="my_dark_blue"&gt;string&lt;/span&gt; m_enc)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="my_dark_blue"&gt;&amp;nbsp;byte[]&lt;/span&gt; toEncodeAsBytes =&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.Text.&lt;span class="my_teal"&gt;Encoding&lt;/span&gt;.UTF8.GetBytes(m_enc);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="my_dark_blue"&gt;string&lt;/span&gt; returnValue =&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.&lt;span class="my_teal"&gt;Convert&lt;/span&gt;.ToBase64String(toEncodeAsBytes);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="my_dark_blue"&gt;return&lt;/span&gt; returnValue;&lt;br /&gt;}&lt;/div&gt;&lt;br /&gt;&lt;b&gt;C# Base64 Decoding Method:&lt;/b&gt;&lt;br /&gt;&lt;div class="my_code_snippet"&gt;&lt;span class="my_gray"&gt;/// &lt;summary&gt;&lt;br /&gt;/// This method will Decode a Base64 string.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;/// &lt;param name="m_enc" /&gt;The String containing the characters &lt;br /&gt;/// to be decoded.&lt;br /&gt;/// &lt;returns&gt;A String containing the results of decoding the&lt;br /&gt;/// specified sequence of bytes.&lt;/returns&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="my_dark_blue"&gt;public static string&lt;/span&gt; DecodeFrom64(&lt;span class="my_dark_blue"&gt;string&lt;/span&gt; m_enc)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="my_dark_blue"&gt;byte[]&lt;/span&gt; encodedDataAsBytes =&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.&lt;span class="my_teal"&gt;Convert&lt;/span&gt;.FromBase64String(m_enc);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="my_dark_blue"&gt;string&lt;/span&gt; returnValue =&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.Text.&lt;span class="my_teal"&gt;Encoding&lt;/span&gt;.UTF8.GetString(encodedDataAsBytes);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="my_dark_blue"&gt;return&lt;/span&gt; returnValue;&lt;br /&gt;}&lt;/div&gt;Reference: &lt;a href="http://msdn.microsoft.com/en-us/library/system.text.encoding.aspx" target="_blank"&gt;http://msdn.microsoft.com/en-us/library/system.text.encoding.aspx&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/814396016109370747-5748748073618036147?l=amitshinde14.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://amitshinde14.blogspot.com/2012/03/c-how-to-encode-or-decode-string-to.html</link><author>noreply@blogger.com (Amit Kumar Shinde)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-814396016109370747.post-2742823068051044539</guid><pubDate>Fri, 23 Mar 2012 15:30:00 +0000</pubDate><atom:updated>2012-03-23T08:30:11.546-07:00</atom:updated><title>What is New in ASP.NET 4.0, Visual Studio 2010 IDE</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div id="contentdiv"&gt;            &lt;h2&gt;Introduction&lt;/h2&gt;&lt;br /&gt;This article is an introduction to some of the &lt;span class="search-highlight"&gt;new&lt;/span&gt; &lt;span class="search-highlight"&gt;features&lt;/span&gt; in &lt;span class="search-highlight"&gt;ASP.NET&lt;/span&gt; 4.0 and Visual Studio 2010 IDE.&lt;br /&gt;&lt;h2&gt;Code Snippets&lt;/h2&gt;&lt;br /&gt;Code snippets are pre-developed code templates which can save time  spent on thinking about the syntax. There are already a lot of built-in  code snippets in VS2005 and VS2008. However, those are only available  for the code-behind. Code snippets in VS2010 are introduced for JScript,  HTML, and &lt;span class="search-highlight"&gt;ASP.NET&lt;/span&gt; markup as well. In the screenshots below, we can see different snippet context menus for JScript and HTML.&lt;br /&gt;Inside the &lt;code&gt;script&lt;/code&gt; tag, it would be&lt;br /&gt;&lt;img height="151" src="http://www.codeproject.com/KB/aspnet/Whatis_New_ASP_Net_4/1.JPG" width="327" /&gt;&lt;br /&gt;And inside the HTML:&lt;br /&gt;&lt;img height="145" src="http://www.codeproject.com/KB/aspnet/Whatis_New_ASP_Net_4/2.JPG" width="330" /&gt;&lt;br /&gt;&lt;h2&gt;&lt;span class="search-highlight"&gt;New&lt;/span&gt; Profiles&lt;/h2&gt;&lt;br /&gt;We have seen different development profiles in previous versions of  .NET. Like VB, C#, Web Development, and General Development. We select a  profile based on our priorities. These are selected after the first  installation of Visual Studio or from the Import Export option.&lt;br /&gt;&lt;img height="181" src="http://www.codeproject.com/KB/aspnet/Whatis_New_ASP_Net_4/3.JPG" width="308" /&gt;&lt;br /&gt;In VS2010, two more profiles are introduced and both support HTML developers. Those are:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Web Development &lt;/li&gt;&lt;li&gt;Web Development (Code Optimized) &lt;/li&gt;&lt;/ol&gt;&lt;img height="174" src="http://www.codeproject.com/KB/aspnet/Whatis_New_ASP_Net_4/4.JPG" width="288" /&gt;&lt;br /&gt;The &lt;strong&gt;Web Development&lt;/strong&gt; profile hides the client objects and events bar on top in HTML mode.&lt;br /&gt;&lt;img height="452" src="http://www.codeproject.com/KB/aspnet/Whatis_New_ASP_Net_4/5.JPG" width="500" /&gt;&lt;br /&gt;In &lt;strong&gt;Code Optimized&lt;/strong&gt;, you will find the HTML editor  without code, and the designer tabs. So, it provides a more bigger area  on the screen to play with HTML.&lt;br /&gt;&lt;img height="501" src="http://www.codeproject.com/KB/aspnet/Whatis_New_ASP_Net_4/6.JPG" width="491" /&gt;&lt;br /&gt;You can choose a profile after installation of Visual Studio on first  use. You can also change the existing working profile from the Tools  &amp;gt; Import &amp;amp; Export Settings &amp;gt; Reset all settings option. You  will have to open and close Visual Studio if it does not show the  changes in the IDE.&lt;br /&gt;&lt;h2&gt;Generate From Usage&lt;/h2&gt;&lt;br /&gt;In previous versions of &lt;span class="search-highlight"&gt;ASP.NET&lt;/span&gt;, Microsoft introduced code refactoring to generate methods and identifiers from existing code. In &lt;span class="search-highlight"&gt;ASP.NET&lt;/span&gt; 4.0, there is a &lt;span class="search-highlight"&gt;new&lt;/span&gt; concept of Generate From Usage - generates properties, methods, classes, and other types based on existing code.&lt;br /&gt;Write some code, select it and right click on the left most  character, and you will get options to change it to a property or method  etc. This option is shown only if you do not define an identifier. For  example, in the following example intellisense, it will not show the  options to extract a property if you right click on the variable &lt;code&gt;i&lt;/code&gt;.&lt;br /&gt;&lt;img height="96" src="http://www.codeproject.com/KB/aspnet/Whatis_New_ASP_Net_4/7.JPG" width="305" /&gt;&lt;br /&gt;&lt;h2&gt;Multi-Targeting&lt;/h2&gt;&lt;br /&gt;In VS2008, it is possible to create a project in version 2.0 or 3.0,  rather than developing in default 3.5. Also, there is an option to  change a developed project's target framework version.&lt;br /&gt;The same option is available in VS2010, but with one improvement. In  the previous versions, if you create a project in framework 2.0,  intellisense will still show you the types and members of 3.5 version as  well, so there are more chances of error if you cannot identify the  member of the chosen framework. But in VS2010, the intellisense will  show you options for the appropriate framework only.&lt;br /&gt;&lt;h2&gt;Multi-Monitor&lt;/h2&gt;&lt;br /&gt;Visual Studio 2010 provides us facility to move windows of the IDE  outside of the Visual Studio IDE and place them on the desktop area. It  also supports having different IDE windows on multiple monitors. If we  close Visual Studio and open it again, we will find all the windows on  the same places where we finished them last time.&lt;br /&gt;&lt;img height="380" src="http://www.codeproject.com/KB/aspnet/Whatis_New_ASP_Net_4/8.JPG" width="529" /&gt;&lt;br /&gt;&lt;h2&gt;Code Navigation in Class Files&lt;/h2&gt;&lt;br /&gt;&lt;h4&gt;Code Navigation&lt;/h4&gt;A &lt;span class="search-highlight"&gt;new&lt;/span&gt; &lt;strong&gt;Navigate To&lt;/strong&gt;  option gives us facility to search a term in a file more quickly. It  searches the text as you type, but it works for class files only, i.e.,  it doesn't work for HTML or code-behind files. In the following example,  it shows the function name as I type it in the Navigate To window; on  selection of any, it will navigate to the function definition.&lt;br /&gt;&lt;img height="315" src="http://www.codeproject.com/KB/aspnet/Whatis_New_ASP_Net_4/9.JPG" width="541" /&gt;&lt;br /&gt;&lt;h4&gt;View Call Hierarchy&lt;/h4&gt;This featrure helps to see the use of a function and its properties.  For example, if you right click on a function name, it will show you the  hierarchical list of function usage.&lt;br /&gt;&lt;img height="316" src="http://www.codeproject.com/KB/aspnet/Whatis_New_ASP_Net_4/10.JPG" width="478" /&gt;&lt;br /&gt;If you click View Call Hierarchy, it will show you a window with the details of the function calls:&lt;br /&gt;&lt;img height="211" src="http://www.codeproject.com/KB/aspnet/Whatis_New_ASP_Net_4/11.JPG" width="446" /&gt;&lt;br /&gt;On selection of the function call in the hierarchy window, it will  show the details of the parameters and the location of the function  call.&lt;br /&gt;&lt;img height="122" src="http://www.codeproject.com/KB/aspnet/Whatis_New_ASP_Net_4/12.JPG" width="389" /&gt;&lt;br /&gt;&lt;h4&gt;Code Identifier Highlighting&lt;/h4&gt;On selection of an identifier, the IDE will highlight the places for you where it is utilized. For example, I selected variable &lt;code&gt;i&lt;/code&gt; and it highlights the different places it is used.&lt;br /&gt;&lt;img height="111" src="http://www.codeproject.com/KB/aspnet/Whatis_New_ASP_Net_4/13.JPG" width="102" /&gt;&lt;br /&gt;&lt;h2&gt;Intellisense Improvements&lt;/h2&gt;&lt;br /&gt;In VS2008, on selecting properties for an object, intellisense will  show you the properties based on the alphabetical order as you type.&lt;br /&gt;In VS2010, it shows you the properties based on groups. For example, if you type &lt;em&gt;text&lt;/em&gt; for a text box, it will show you the members based on the word &lt;em&gt;text&lt;/em&gt;, like &lt;code&gt;Text&lt;/code&gt;, &lt;code&gt;TextChanged&lt;/code&gt;, &lt;code&gt;TextMode&lt;/code&gt;. It also supports Pascal case intellisense. For example, if you type TC, it will navigate to the &lt;code&gt;TextChanged&lt;/code&gt; member.&lt;br /&gt;&lt;img height="239" src="http://www.codeproject.com/KB/aspnet/Whatis_New_ASP_Net_4/14.JPG" width="340" /&gt;&lt;br /&gt;In the picture below, you can see the &lt;code&gt;ClientIDMode&lt;/code&gt;  property in version 4, and if we change its target version from project  properties, it will not show this attribute for the textbox.&lt;br /&gt;&lt;img height="246" src="http://www.codeproject.com/KB/aspnet/Whatis_New_ASP_Net_4/15.JPG" width="216" /&gt;&lt;br /&gt;&lt;h2&gt;EnablePersistedSelection&lt;/h2&gt;&lt;br /&gt;On selecting a row in controls like &lt;code&gt;DataList&lt;/code&gt; or &lt;code&gt;GridView&lt;/code&gt;, if we move to another page index, it selects the same numbered row on the &lt;span class="search-highlight"&gt;new&lt;/span&gt;ly selected page, although we selected it only on the first page.&lt;br /&gt;To avoid this, &lt;span class="search-highlight"&gt;ASP.NET&lt;/span&gt; 4.0 has introduced a &lt;span class="search-highlight"&gt;new&lt;/span&gt; property for these controls, called &lt;code&gt;EnablePersistedSelection&lt;/code&gt;. If you set it to &lt;code lang="cs"&gt;true&lt;/code&gt;,  it will not select the same numbered row on other pages, and on  navigation to the original page, for example, the first page, it will  show the initially selected row as selected.&lt;br /&gt;&lt;h2&gt;Web.Config Transformation&lt;/h2&gt;&lt;br /&gt;Normally, we set some values in &lt;em&gt;web.config&lt;/em&gt; for the development environment, and then we change those values manually at the time of deployment or testing.&lt;br /&gt;For example, if we have a connection string or any key value combination in the &lt;em&gt;web.config&lt;/em&gt; file, and we want to replace those at the time of project publishing or deployment, then we can use the &lt;span class="search-highlight"&gt;new&lt;/span&gt; &lt;strong&gt;&lt;em&gt;web.config&lt;/em&gt; transformation&lt;/strong&gt;. It is an automatic way to perform this operation.&lt;br /&gt;&lt;em&gt;Web.config&lt;/em&gt; settings can be overridden by other config files like &lt;em&gt;web.release.config&lt;/em&gt;, &lt;em&gt;web.debug.config&lt;/em&gt; etc., at the time of debug, release. These values are not overridden in the original &lt;em&gt;web.config&lt;/em&gt; but in the published &lt;em&gt;web.config&lt;/em&gt;.&lt;br /&gt;With the help of transformation, we can replace, remove, or delete a  node, and for a node itself, we can remove or set attributes. For  example:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Create a config file from Configuration Manager &amp;gt; &lt;span class="search-highlight"&gt;New&lt;/span&gt;:  &lt;img height="158" src="http://www.codeproject.com/KB/aspnet/Whatis_New_ASP_Net_4/16.JPG" width="490" /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Name it TransformWebConfig. Select Release from the &lt;em&gt;Copy settings from&lt;/em&gt; option:  &lt;img height="296" src="http://www.codeproject.com/KB/aspnet/Whatis_New_ASP_Net_4/17.JPG" width="472" /&gt;&lt;br /&gt;This will create &lt;em&gt;TransformWebConfig.config&lt;/em&gt;.&lt;br /&gt;&lt;img height="150" src="http://www.codeproject.com/KB/aspnet/Whatis_New_ASP_Net_4/18.JPG" width="238" /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Right click on &lt;em&gt;web.config&lt;/em&gt; and select the &lt;em&gt;Add config transfroms&lt;/em&gt; option. Open the &lt;em&gt;web.config&lt;/em&gt; and add a test key and the value to be changed.  &lt;div class="pre-action-link" id="premain0" style="display: block;" width="100%"&gt;&lt;img height="9" id="preimg0" src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" width="9" /&gt;&lt;span id="precollapse0" style="cursor: pointer; margin-bottom: 0pt;"&gt; Collapse&lt;/span&gt;&lt;span&gt; | &lt;/span&gt;&lt;a href="http://www.codeproject.com/Articles/49938/What-is-New-in-ASP-NET-4-0-Visual-Studio-2010-IDE#"&gt;Copy Code&lt;/a&gt;&lt;/div&gt;&lt;pre id="pre0" lang="xml" style="margin-top: 0pt;"&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;appSettings&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt; &lt;br /&gt;  &lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;add&lt;/span&gt; &lt;span class="code-attribute"&gt;key&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;KeyOne"&lt;/span&gt; &lt;span class="code-attribute"&gt;value&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;A value"&lt;/span&gt;&lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt; &lt;br /&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;appSettings&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Open &lt;em&gt;TransformWebConfig.config&lt;/em&gt; and add the following line to it:  &lt;div class="pre-action-link" id="premain1" style="display: block;" width="100%"&gt;&lt;img height="9" id="preimg1" src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" width="9" /&gt;&lt;span id="precollapse1" style="cursor: pointer; margin-bottom: 0pt;"&gt; Collapse&lt;/span&gt;&lt;span&gt; | &lt;/span&gt;&lt;a href="http://www.codeproject.com/Articles/49938/What-is-New-in-ASP-NET-4-0-Visual-Studio-2010-IDE#"&gt;Copy Code&lt;/a&gt;&lt;/div&gt;&lt;pre id="pre1" lang="xml" style="margin-top: 0pt;"&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;appSettings&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt; &lt;br /&gt;  &lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;add&lt;/span&gt; &lt;span class="code-attribute"&gt;key&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;KeyOne"&lt;/span&gt; &lt;br /&gt;    &lt;span class="code-attribute"&gt;value&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;TestOnConfigurationConfig"&lt;/span&gt; &lt;br /&gt;    &lt;span class="code-attribute"&gt;xdt:Transform&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;Replace"&lt;/span&gt;&lt;br /&gt;    &lt;span class="code-attribute"&gt;xdt:Locator&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;Match(key)"&lt;/span&gt; &lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt; &lt;br /&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;appSettings&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;Set the &lt;code&gt;xdt:Transform&lt;/code&gt; attribute to &lt;code&gt;Replace&lt;/code&gt;.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Right click on the project and select &lt;em&gt;Create Package&lt;/em&gt;. VS will get the values from the &lt;em&gt;TransformWebConfig.config&lt;/em&gt; file, and it will change the value in the published &lt;em&gt;web.config&lt;/em&gt; file for us. &lt;/li&gt;&lt;/ol&gt;On successful build, go to the &lt;em&gt;obj&lt;/em&gt; folder and check the &lt;em&gt;web.config&lt;/em&gt; file under the &lt;em&gt;TransformWebConfig&lt;/em&gt; folder; you will see the value &lt;code&gt;TestOnConfigurationConfig&lt;/code&gt; for the key &lt;code&gt;KeyOne&lt;/code&gt;.&lt;br /&gt;&lt;h2&gt;URL Routing&lt;/h2&gt;&lt;br /&gt;Nowadays, we see that website URLs are more SEO specific and do not  show any descriptive information. For example, rather than showing a URL  like: &lt;a href="http://mywebsite.com/userprofiles.aspx?userid=1"&gt;http://mywebsite.com/userprofiles.aspx?userid=1&lt;/a&gt;, developers would prefer to show the URL as: &lt;a href="http://mywebsite.com/mydetails"&gt;http://mywebsite.com/mydetails&lt;/a&gt;.&lt;br /&gt;URL mapping in &lt;span class="search-highlight"&gt;ASP.NET&lt;/span&gt; 2.0  provides us an option to achieve this functionality up to some extent.  We can mention exact URLs to navigate and URLs to show to the user. But  in the case of postback, this option starts showing the actual URL in  the browser.&lt;br /&gt;URL routing was introduced in &lt;span class="search-highlight"&gt;ASP.NET&lt;/span&gt;  3.5. Developers had to create different route handler classes depending  on the number of URL routings for a website. The postback issue was  solved with this URL routing option.&lt;br /&gt;In &lt;span class="search-highlight"&gt;ASP.NET&lt;/span&gt; 4.0, you do not need to define separate handler classes for each routing. There is a built-in helper function &lt;code&gt;MapPageRoute&lt;/code&gt; which helps you to implement routing more quickly. These routes are registered on &lt;code&gt;Application_Start&lt;/code&gt;. For example, in this example, in &lt;em&gt;global.asax&lt;/em&gt;, the &lt;code&gt;SetRouting&lt;/code&gt;  method sets routing, the first parameter is the router's friendly name,  the second parameter is to check for the URL pattern to match, and the  third is the ASPX page where this functionality would be implemented for  the users.&lt;br /&gt;&lt;em&gt;Global.asax&lt;/em&gt; would be:&lt;br /&gt;&lt;div class="pre-action-link" id="premain2" style="display: block;" width="100%"&gt;&lt;img height="9" id="preimg2" src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" width="9" /&gt;&lt;span id="precollapse2" style="cursor: pointer; margin-bottom: 0pt;"&gt; Collapse&lt;/span&gt;&lt;span&gt; | &lt;/span&gt;&lt;a href="http://www.codeproject.com/Articles/49938/What-is-New-in-ASP-NET-4-0-Visual-Studio-2010-IDE#"&gt;Copy Code&lt;/a&gt;&lt;/div&gt;&lt;pre id="pre2" lang="cs" style="margin-top: 0pt;"&gt;&lt;span class="code-keyword"&gt;protected&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; Application_Start(&lt;span class="code-keyword"&gt;object&lt;/span&gt; sender, EventArgs e) &lt;br /&gt;{ &lt;br /&gt;    SetRouting(System.Web.Routing.RouteTable.Routes); &lt;br /&gt;} &lt;br /&gt;&lt;span class="code-keyword"&gt;private&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; SetRouting(System.Web.Routing.RouteCollection routeCollection) &lt;br /&gt;{ &lt;br /&gt;    routeCollection.MapPageRoute(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;RouteFriendlyName"&lt;/span&gt;, &lt;br /&gt;        &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;MyWebsite/RequestParameterName"&lt;/span&gt;,&lt;br /&gt;        &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;~/Book.aspx"&lt;/span&gt;); &lt;br /&gt;    &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; you can add other page routes with different names and combinations here &lt;/span&gt;}&lt;/pre&gt;Now, &lt;em&gt;Book.aspx&lt;/em&gt; would use the following code to proceed further:&lt;br /&gt;&lt;div class="pre-action-link" id="premain3" style="display: block;" width="100%"&gt;&lt;img height="9" id="preimg3" src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" width="9" /&gt;&lt;span id="precollapse3" style="cursor: pointer; margin-bottom: 0pt;"&gt; Collapse&lt;/span&gt;&lt;span&gt; | &lt;/span&gt;&lt;a href="http://www.codeproject.com/Articles/49938/What-is-New-in-ASP-NET-4-0-Visual-Studio-2010-IDE#"&gt;Copy Code&lt;/a&gt;&lt;/div&gt;&lt;pre id="pre3" lang="cs" style="margin-top: 0pt;"&gt;&lt;span class="code-keyword"&gt;string&lt;/span&gt; Parameter = Page.RouteData.Values[&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;RequestParameterName"&lt;/span&gt;].ToString(); &lt;br /&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;if&lt;/span&gt; (Parameter==&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Chemistry"&lt;/span&gt;){....} &lt;br /&gt;&lt;span class="code-keyword"&gt;else&lt;/span&gt; &lt;span class="code-keyword"&gt;if&lt;/span&gt; (Parameter==&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Physics"&lt;/span&gt;){....}&lt;/pre&gt;Now, if we navigate to &lt;em&gt;localhost/MyWebsite/Chemistry&lt;/em&gt;, it will go to the first &lt;code lang="cs"&gt;if&lt;/code&gt; condition.&lt;br /&gt;&lt;h2&gt;Add Reference Dialog&lt;/h2&gt;&lt;br /&gt;In previous versions of Visual Studio, on opening the Add Reference  dialog box, it will take some time to load .NET assembly files initially  till the time it loads all the references from the GAC. In VS2010, on  opening Add Reference, it opens the Projects tab by default.&lt;br /&gt;&lt;img height="291" src="http://www.codeproject.com/KB/aspnet/Whatis_New_ASP_Net_4/19.JPG" width="362" /&gt;&lt;br /&gt;If you click on the .NET or COM tab by mistake, you still have an  option of canceling it before it loads all the assemblies. So, the VS  IDE does not freeze like before.&lt;br /&gt;&lt;h2&gt;Compressing Session Values&lt;/h2&gt;&lt;br /&gt;&lt;span class="search-highlight"&gt;ASP.NET&lt;/span&gt; session out-of-process  state values are saved in a database or on the server. These are saved  in a serialized format. Bigger session values consume more resources to  be sent to the server. Now, those can be compressed with a &lt;span class="search-highlight"&gt;new&lt;/span&gt; built-in property &lt;code&gt;&lt;strong&gt;compressionEnabled&lt;/strong&gt;&lt;/code&gt;. This attribute for the &lt;code&gt;sessionState&lt;/code&gt; element can be mentioned in the &lt;em&gt;web.config&lt;/em&gt;, like this:&lt;br /&gt;&lt;div class="pre-action-link" id="premain4" style="display: block;" width="100%"&gt;&lt;img height="9" id="preimg4" src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" width="9" /&gt;&lt;span id="precollapse4" style="cursor: pointer; margin-bottom: 0pt;"&gt; Collapse&lt;/span&gt;&lt;span&gt; | &lt;/span&gt;&lt;a href="http://www.codeproject.com/Articles/49938/What-is-New-in-ASP-NET-4-0-Visual-Studio-2010-IDE#"&gt;Copy Code&lt;/a&gt;&lt;/div&gt;&lt;pre id="pre4" lang="xml" style="margin-top: 0pt;"&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;sessionState&lt;/span&gt;&lt;br /&gt;  &lt;span class="code-attribute"&gt;mode&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;SQLServer"&lt;/span&gt; &lt;br /&gt;  &lt;span class="code-attribute"&gt;stateConnectionString&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;connectionstring goes here"&lt;/span&gt; &lt;br /&gt;  &lt;span class="code-attribute"&gt;&lt;strong&gt;compressionEnabled&lt;/strong&gt;&lt;/span&gt;&lt;span class="code-keyword"&gt;&lt;strong&gt;="&lt;/strong&gt;&lt;/span&gt;&lt;span class="code-keyword"&gt;&lt;strong&gt;true"&lt;/strong&gt;&lt;/span&gt;&lt;span class="code-attribute"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;This option would be available for out-of-process sessions.&lt;br /&gt;&lt;h2&gt;Improvements in C# 4.0&lt;/h2&gt;&lt;br /&gt;C# in .NET Framework 4.0 has some more things to offer. These are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Dynamic lookup &lt;/li&gt;&lt;li&gt;Named &lt;/li&gt;&lt;li&gt;Optional parameters &lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Dynamic Lookup&lt;/h4&gt;There is a &lt;span class="search-highlight"&gt;new&lt;/span&gt; static type named &lt;code lang="cs"&gt;&lt;strong&gt;dynamic&lt;/strong&gt;&lt;/code&gt;. We can use it as object of any type. If there is any error on its usage, we would get it on runtime only. For example:&lt;br /&gt;&lt;div class="pre-action-link" id="premain5" style="display: block;" width="100%"&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/Articles/49938/What-is-New-in-ASP-NET-4-0-Visual-Studio-2010-IDE#"&gt;&lt;/a&gt;&lt;/div&gt;&lt;pre id="pre5" lang="cs" style="margin-top: 0pt;"&gt;&lt;span class="code-keyword"&gt;dynamic&lt;/span&gt; integerValue = &lt;span class="code-digit"&gt;1&lt;/span&gt;; &lt;br /&gt;&lt;span class="code-keyword"&gt;dynamic&lt;/span&gt; stringValue = &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt; a string"&lt;/span&gt;; &lt;br /&gt;&lt;span class="code-keyword"&gt;dynamic&lt;/span&gt; Result = integerValue + stringValue;&lt;/pre&gt;Output of this would be: &lt;em&gt;1 a string&lt;/em&gt;.&lt;br /&gt;But, if you change the last line to:&lt;br /&gt;&lt;div class="pre-action-link" id="premain6" style="display: block;" width="100%"&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/Articles/49938/What-is-New-in-ASP-NET-4-0-Visual-Studio-2010-IDE#"&gt;&lt;/a&gt;&lt;/div&gt;&lt;pre id="pre6" lang="cs" style="margin-top: 0pt;"&gt;&lt;span class="code-keyword"&gt;dynamic&lt;/span&gt; Result = integerValue &amp;amp; stringValue;&lt;/pre&gt;You will not get any compilation error, but the following error on runtime:&lt;br /&gt;&lt;div class="pre-action-link" id="premain7" style="display: block;" width="100%"&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/Articles/49938/What-is-New-in-ASP-NET-4-0-Visual-Studio-2010-IDE#"&gt;&lt;/a&gt;&lt;/div&gt;&lt;pre id="pre7" lang="text" style="margin-top: 0pt;"&gt;Operator '&amp;amp;' cannot be applied to operands of type 'int' and 'string'&lt;/pre&gt;&lt;h4&gt;Optional Parameters&lt;/h4&gt;To implement optional parameters, we used to create overloaded functions before &lt;span class="search-highlight"&gt;ASP.NET&lt;/span&gt;  4, but now, optional parameters are no more a restriction in C#. Like  VB, optional parameters must be mentioned last. For example:&lt;br /&gt;&lt;div class="pre-action-link" id="premain8" style="display: block;" width="100%"&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/Articles/49938/What-is-New-in-ASP-NET-4-0-Visual-Studio-2010-IDE#"&gt;&lt;/a&gt;&lt;/div&gt;&lt;pre id="pre8" lang="cs" style="margin-top: 0pt;"&gt;&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; FunctionOptionalParam(&lt;span class="code-keyword"&gt;string&lt;/span&gt; Name, &lt;span class="code-keyword"&gt;int&lt;/span&gt; Age, &lt;span class="code-keyword"&gt;string&lt;/span&gt; Country = &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;"&lt;/span&gt;) &lt;/pre&gt;and we can call them without mentioning the value for the optional parameter.&lt;br /&gt;&lt;div class="pre-action-link" id="premain9" style="display: block;" width="100%"&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/Articles/49938/What-is-New-in-ASP-NET-4-0-Visual-Studio-2010-IDE#"&gt;&lt;/a&gt;&lt;/div&gt;&lt;pre id="pre9" lang="cs" style="margin-top: 0pt;"&gt;FunctionOptionalParam(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;My Full Name"&lt;/span&gt;,&lt;span class="code-digit"&gt;20&lt;/span&gt;);&lt;/pre&gt;&lt;h4&gt;Named Parameters&lt;/h4&gt;Named parameters allow you to ignore the parameter order and mention parameters with names in a different order. For example:&lt;br /&gt;&lt;div class="pre-action-link" id="premain10" style="display: block;" width="100%"&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/Articles/49938/What-is-New-in-ASP-NET-4-0-Visual-Studio-2010-IDE#"&gt;&lt;/a&gt;&lt;/div&gt;&lt;pre id="pre10" lang="cs" style="margin-top: 0pt;"&gt;&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; FunctionNamedParam(&lt;span class="code-keyword"&gt;int&lt;/span&gt; x, &lt;span class="code-keyword"&gt;int&lt;/span&gt; y , &lt;span class="code-keyword"&gt;int&lt;/span&gt; z)&lt;/pre&gt;On function call, it would be:&lt;br /&gt;&lt;div class="pre-action-link" id="premain11" style="display: block;" width="100%"&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/Articles/49938/What-is-New-in-ASP-NET-4-0-Visual-Studio-2010-IDE#"&gt;&lt;/a&gt;&lt;/div&gt;&lt;pre id="pre11" lang="cs" style="margin-top: 0pt;"&gt;FunctionNamedParam(x:&lt;span class="code-digit"&gt;1&lt;/span&gt;, z:&lt;span class="code-digit"&gt;3&lt;/span&gt;, y:&lt;span class="code-digit"&gt;2&lt;/span&gt;);&lt;/pre&gt;Although we are sending a value for the parameter &lt;code&gt;z&lt;/code&gt; before its order in the function declaration, but these would be equal to x=1, y=2, z=3.&lt;br /&gt;&lt;h2&gt;Meta Tags&lt;/h2&gt;&lt;br /&gt;The &lt;code&gt;HtmlMeta&lt;/code&gt; class can be used to add HTML meta tags dynamically. &lt;code&gt;HTMLMeta&lt;/code&gt;'s &lt;code&gt;Name&lt;/code&gt;, &lt;code&gt;Content&lt;/code&gt; properties can be used to add any meta tag name and its values dynamically on runtime.&lt;br /&gt;In &lt;span class="search-highlight"&gt;ASP.NET&lt;/span&gt; 4.0, the &lt;code&gt;Page&lt;/code&gt; class has two more properties: &lt;code&gt;MetaDescription&lt;/code&gt; and &lt;code&gt;MetaKeywords&lt;/code&gt;. These can be used to add meta values in HTML on runtime for the &lt;code&gt;description&lt;/code&gt; and &lt;code&gt;keyword&lt;/code&gt; elements. These can be mentioned as page attributes in HTML, or in this way:&lt;br /&gt;&lt;div class="pre-action-link" id="premain12" style="display: block;" width="100%"&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/Articles/49938/What-is-New-in-ASP-NET-4-0-Visual-Studio-2010-IDE#"&gt;&lt;/a&gt;&lt;/div&gt;&lt;pre id="pre12" lang="cs" style="margin-top: 0pt;"&gt;Page.MetaDescription = &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;this is meta description"&lt;/span&gt;;&lt;br /&gt;Page.MetaKeywords = &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;this is a meta keyword"&lt;/span&gt;;&lt;/pre&gt;If we see the HTML generated for this, it would be:&lt;br /&gt;&lt;div class="pre-action-link" id="premain13" style="display: block;" width="100%"&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/Articles/49938/What-is-New-in-ASP-NET-4-0-Visual-Studio-2010-IDE#"&gt;&lt;/a&gt;&lt;/div&gt;&lt;pre id="pre13" lang="html" style="margin-top: 0pt;"&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;head&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;meta&lt;/span&gt; &lt;span class="code-attribute"&gt;name&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;description"&lt;/span&gt; &lt;span class="code-attribute"&gt;content&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;this is meta description "&lt;/span&gt; &lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;meta&lt;/span&gt; &lt;span class="code-attribute"&gt;name&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;keywords"&lt;/span&gt; &lt;span class="code-attribute"&gt;content&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;this is a meta keyword"&lt;/span&gt; &lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;head&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;h2&gt;Generating Client IDs&lt;/h2&gt;&lt;br /&gt;Client IDs for web controls are generated dynamically based on their  parent controls. So if we use a textbox inside a web user control in a  WebForm, we have to see what ID is generated for it and use it in the  client script accordingly.&lt;br /&gt;Sometimes, these are dynamic, or in the case of changing the user  control name, it changes the ID for the child control as well. In &lt;span class="search-highlight"&gt;ASP.NET&lt;/span&gt; 4.0, this problem is solved by the &lt;code&gt;ClientIDMode&lt;/code&gt; attribute for the page. It has the following possible values: &lt;code&gt;AutoID&lt;/code&gt;, &lt;code&gt;Static&lt;/code&gt;, &lt;code&gt;Predictable&lt;/code&gt;, and &lt;code&gt;Inherit&lt;/code&gt;.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;AutoID&lt;/code&gt;: It is the default setting for a webpage, and works like in the previous versions of &lt;span class="search-highlight"&gt;ASP.NET&lt;/span&gt;. &lt;/li&gt;&lt;li&gt;&lt;code&gt;Static&lt;/code&gt;: It sets the static IDs for the web control, so  we do not have to worry about the parent control ID and so on if we are  referencing it in JavaScript.  For example, a &lt;code&gt;TextBox&lt;/code&gt; inside a user control and one outside it with &lt;code&gt;ClientIDMode&lt;/code&gt; set to &lt;code lang="text"&gt;Static&lt;/code&gt;:&lt;br /&gt;&lt;div class="pre-action-link" id="premain14" style="display: block;" width="100%"&gt;&lt;img height="9" id="preimg14" src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" width="9" /&gt;&lt;span id="precollapse14" style="cursor: pointer; margin-bottom: 0pt;"&gt; Collapse&lt;/span&gt;&lt;span&gt; | &lt;/span&gt;&lt;a href="http://www.codeproject.com/Articles/49938/What-is-New-in-ASP-NET-4-0-Visual-Studio-2010-IDE#"&gt;Copy Code&lt;/a&gt;&lt;/div&gt;&lt;pre id="pre14" lang="aspnet" style="margin-top: 0pt;"&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;asp:TextBox&lt;/span&gt; &lt;span class="code-attribute"&gt;ID&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;textbox1"&lt;/span&gt; &lt;br /&gt;     &lt;span class="code-attribute"&gt;runat&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;server"&lt;/span&gt; &lt;span class="code-attribute"&gt;clientIDMode&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;Static"&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;asp:TextBox&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;uc1:WebUserControl&lt;/span&gt; &lt;span class="code-attribute"&gt;ID&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;WebUserControl1"&lt;/span&gt; &lt;span class="code-attribute"&gt;runat&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;server"&lt;/span&gt; &lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;And this user control is the container for &lt;code&gt;TextBox2&lt;/code&gt;:&lt;br /&gt;&lt;div class="pre-action-link" id="premain15" style="display: block;" width="100%"&gt;&lt;img height="9" id="preimg15" src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" width="9" /&gt;&lt;span id="precollapse15" style="cursor: pointer; margin-bottom: 0pt;"&gt; Collapse&lt;/span&gt;&lt;span&gt; | &lt;/span&gt;&lt;a href="http://www.codeproject.com/Articles/49938/What-is-New-in-ASP-NET-4-0-Visual-Studio-2010-IDE#"&gt;Copy Code&lt;/a&gt;&lt;/div&gt;&lt;pre id="pre15" lang="aspnet" style="margin-top: 0pt;"&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;asp:TextBox&lt;/span&gt; &lt;span class="code-attribute"&gt;ID&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;TextBox2"&lt;/span&gt; &lt;br /&gt;   &lt;span class="code-attribute"&gt;ClientIDMode&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;Static"&lt;/span&gt; &lt;span class="code-attribute"&gt;runat&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;server"&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;asp:TextBox&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;This code will generate the following HTML:&lt;br /&gt;&lt;div class="pre-action-link" id="premain16" style="display: block;" width="100%"&gt;&lt;img height="9" id="preimg16" src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" width="9" /&gt;&lt;span id="precollapse16" style="cursor: pointer; margin-bottom: 0pt;"&gt; Collapse&lt;/span&gt;&lt;span&gt; | &lt;/span&gt;&lt;a href="http://www.codeproject.com/Articles/49938/What-is-New-in-ASP-NET-4-0-Visual-Studio-2010-IDE#"&gt;Copy Code&lt;/a&gt;&lt;/div&gt;&lt;pre id="pre16" lang="aspnet" style="margin-top: 0pt;"&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;input&lt;/span&gt; &lt;span class="code-attribute"&gt;name&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;ctl00$MainContent$textbox1"&lt;/span&gt; &lt;br /&gt;  &lt;span class="code-attribute"&gt;type&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;text"&lt;/span&gt; &lt;span class="code-attribute"&gt;id&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;&lt;strong&gt;textbox1&lt;/strong&gt;"&lt;/span&gt; &lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt; &lt;br /&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;input&lt;/span&gt; &lt;span class="code-attribute"&gt;name&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;ctl00$MainContent$WebUserControl1$TextBox2"&lt;/span&gt; &lt;br /&gt;  &lt;span class="code-attribute"&gt;type&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;text"&lt;/span&gt; &lt;span class="code-attribute"&gt;id&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;&lt;strong&gt;TextBox2&lt;/strong&gt;"&lt;/span&gt; &lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;If we remove the &lt;code&gt;ClientIDMode&lt;/code&gt; set to static, the output would be like this:&lt;br /&gt;&lt;div class="pre-action-link" id="premain17" style="display: block;" width="100%"&gt;&lt;img height="9" id="preimg17" src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" width="9" /&gt;&lt;span id="precollapse17" style="cursor: pointer; margin-bottom: 0pt;"&gt; Collapse&lt;/span&gt;&lt;span&gt; | &lt;/span&gt;&lt;a href="http://www.codeproject.com/Articles/49938/What-is-New-in-ASP-NET-4-0-Visual-Studio-2010-IDE#"&gt;Copy Code&lt;/a&gt;&lt;/div&gt;&lt;pre id="pre17" lang="aspnet" style="margin-top: 0pt;"&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;input&lt;/span&gt; &lt;span class="code-attribute"&gt;name&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;ctl00$MainContent$textbox1"&lt;/span&gt; &lt;br /&gt;  &lt;span class="code-attribute"&gt;type&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;text"&lt;/span&gt; &lt;span class="code-attribute"&gt;id&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;MainContent_textbox1"&lt;/span&gt; &lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;It will generate the ID for &lt;code&gt;TextBox&lt;/code&gt; as it does in previous versions of &lt;span class="search-highlight"&gt;ASP.NET&lt;/span&gt;.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;Predictable&lt;/code&gt;: If we use &lt;code&gt;Predictable&lt;/code&gt; as &lt;code&gt;ClientIDMode&lt;/code&gt; for web controls inside a &lt;code&gt;GridView&lt;/code&gt; or &lt;code&gt;ListView&lt;/code&gt;, then it will concatenate the &lt;code&gt;GridView&lt;/code&gt; ID with the control ID and the value of the column mentioned in the &lt;code&gt;ClientIDRowSuffiex&lt;/code&gt; attribute:  &lt;div class="pre-action-link" id="premain18" style="display: block;" width="100%"&gt;&lt;img height="9" id="preimg18" src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" width="9" /&gt;&lt;span id="precollapse18" style="cursor: pointer; margin-bottom: 0pt;"&gt; Collapse&lt;/span&gt;&lt;span&gt; | &lt;/span&gt;&lt;a href="http://www.codeproject.com/Articles/49938/What-is-New-in-ASP-NET-4-0-Visual-Studio-2010-IDE#"&gt;Copy Code&lt;/a&gt;&lt;/div&gt;&lt;pre id="pre18" lang="cs" style="margin-top: 0pt;"&gt;Gridview ID =&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;GridView1"&lt;/span&gt;&lt;br /&gt;ClientIDMode=&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Predictable"&lt;/span&gt;&lt;br /&gt;ClientIDRowSuffix=&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;ItemID"&lt;/span&gt;&lt;/pre&gt;If there is a &lt;code&gt;Label&lt;/code&gt; in the &lt;code&gt;GridView&lt;/code&gt; template column having the ID &lt;code&gt;Label1&lt;/code&gt; and it is bound with the &lt;code&gt;ItemID&lt;/code&gt; column, it will generate an ID, &lt;code&gt;GridView1_Label1_200&lt;/code&gt;.&lt;br /&gt;If we use the &lt;code&gt;ClientIDMode&lt;/code&gt; value of &lt;code&gt;Predictable&lt;/code&gt; for web controls outside databound controls:&lt;br /&gt;&lt;div class="pre-action-link" id="premain19" style="display: block;" width="100%"&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/Articles/49938/What-is-New-in-ASP-NET-4-0-Visual-Studio-2010-IDE#"&gt;&lt;/a&gt;&lt;/div&gt;&lt;pre id="pre19" lang="aspnet" style="margin-top: 0pt;"&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;asp:TextBox&lt;/span&gt; &lt;span class="code-attribute"&gt;ID&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;TextBox1"&lt;/span&gt; &lt;span class="code-attribute"&gt;runat&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;server"&lt;/span&gt; &lt;br /&gt;  &lt;span class="code-attribute"&gt;ClientIDMode&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;Predictable"&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;asp:TextBox&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;asp:Panel&lt;/span&gt; &lt;span class="code-attribute"&gt;ID&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;panel1"&lt;/span&gt; &lt;span class="code-attribute"&gt;runat&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;server"&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;asp:TextBox&lt;/span&gt; &lt;span class="code-attribute"&gt;ID&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;TextBox2"&lt;/span&gt; &lt;span class="code-attribute"&gt;runat&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;server"&lt;/span&gt; &lt;br /&gt;  &lt;span class="code-attribute"&gt;ClientIDMode&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;Predictable"&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;asp:TextBox&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;asp:Panel&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;You can see the output of the web controls in the panel and outside the panel.&lt;br /&gt;&lt;div class="pre-action-link" id="premain20" style="display: block;" width="100%"&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/Articles/49938/What-is-New-in-ASP-NET-4-0-Visual-Studio-2010-IDE#"&gt;&lt;/a&gt;&lt;/div&gt;&lt;pre id="pre20" lang="aspnet" style="margin-top: 0pt;"&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;input&lt;/span&gt; &lt;span class="code-attribute"&gt;name&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;ctl00$MainContent$TextBox1"&lt;/span&gt; &lt;br /&gt;  &lt;span class="code-attribute"&gt;type&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;text"&lt;/span&gt; &lt;span class="code-attribute"&gt;id&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;MainContent_TextBox1"&lt;/span&gt; &lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;div&lt;/span&gt; &lt;span class="code-attribute"&gt;id&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;MainContent_panel1"&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;input&lt;/span&gt; &lt;span class="code-attribute"&gt;name&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;ctl00$MainContent$TextBox1"&lt;/span&gt; &lt;br /&gt;  &lt;span class="code-attribute"&gt;type&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;text"&lt;/span&gt; &lt;span class="code-attribute"&gt;id&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;MainContent_TextBox1"&lt;/span&gt; &lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;div&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;It will generate the ID for all the web controls concatenated with the ID of the content panel of the child page.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;Inherit&lt;/code&gt;: Web controls, by default, inherit from the  parent container ID. Controls can override this attribute of the parent  as well if we set a different value for &lt;code&gt;ClientModeID&lt;/code&gt;. &lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Permanent Redirect&lt;/h2&gt;&lt;br /&gt;In a situation where we want to redirect users to a &lt;span class="search-highlight"&gt;new&lt;/span&gt;ly developed page if current page is obsolete, we can use &lt;code&gt;Response.Redirect&lt;/code&gt; to shift the page to a &lt;span class="search-highlight"&gt;new&lt;/span&gt;  page. But in this case, search engines keep the old information of the  page in their indexes for search. Also, if a user navigates to this  page, he would be redirected to this page and then to a &lt;span class="search-highlight"&gt;new&lt;/span&gt; page with the help of &lt;code&gt;Response.Redriect&lt;/code&gt;.&lt;br /&gt;But in &lt;span class="search-highlight"&gt;ASP.NET&lt;/span&gt; 4.0, a &lt;span class="search-highlight"&gt;new&lt;/span&gt; command &lt;code&gt;Response.RedirectPermanent&lt;/code&gt;  can be used to change the header information for the page on the  server. So, if a user goes for a page, he is directly redirected to &lt;span class="search-highlight"&gt;new&lt;/span&gt; page and it saves a double trip for him.&lt;br /&gt;Similarly, search engines, on re-indexing of that website and page,  finds the updated header and updates the information in their index and  shows the updated information on search.&lt;br /&gt;&lt;h2&gt;&lt;span class="search-highlight"&gt;New&lt;/span&gt; Browser Definitions&lt;/h2&gt;&lt;br /&gt;During the last few years of &lt;span class="search-highlight"&gt;ASP.NET&lt;/span&gt; 3.5, a few browsers have been introduced including Google Chrome and those which support Blackberry SmartPhones as well. &lt;span class="search-highlight"&gt;ASP.NET&lt;/span&gt; 4.0's &lt;code&gt;HTTPBrowserCapabilities&lt;/code&gt; class is updated with the support for &lt;span class="search-highlight"&gt;new&lt;/span&gt; browsers.&lt;br /&gt;&lt;h2&gt;Publishing a Project&lt;/h2&gt;&lt;br /&gt;In VS2010, if you click the Properties link in Solution Explorer, you will find three &lt;span class="search-highlight"&gt;new&lt;/span&gt; tabs:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Package/Publish &lt;/li&gt;&lt;li&gt;Deploy SQL &lt;/li&gt;&lt;li&gt;Silverlight Applications &lt;/li&gt;&lt;/ol&gt;I will discuss about the first two options.&lt;br /&gt;&lt;h4&gt;Package/Publish&lt;/h4&gt;&lt;img height="421" src="http://www.codeproject.com/KB/aspnet/Whatis_New_ASP_Net_4/20.JPG" width="531" /&gt;&lt;br /&gt;Package, Publish options provide you settings for the publish and  package commands. The configuration option for Debug, Release provides  options to set these values on compilation and build like in previous  versions.&lt;br /&gt;If the hosting server does not have SQL Express, or if you do not  want to include those in the published files, then select Exclude files  from the &lt;em&gt;App_Data&lt;/em&gt; folder. If you select the option &lt;em&gt;Create a web package as a ZIP file&lt;/em&gt;, it will create a zip file to be deployed. Otherwise, it would be an unzipped folder by default.&lt;br /&gt;The default package folder is created under the &lt;em&gt;obj&lt;/em&gt; folder of the application. It is not be shown by default in the Solution Explorer until you select the &lt;em&gt;Show all files&lt;/em&gt; option. We can also set the web application name on the server and the destination server physical path as well.&lt;br /&gt;&lt;h4&gt;Deploy SQL &lt;/h4&gt;&lt;img height="371" src="http://www.codeproject.com/KB/aspnet/Whatis_New_ASP_Net_4/21.JPG" width="532" /&gt;&lt;br /&gt;The Deploy SQL option allows you to set the connection string as part  of the deployed package. You can add the connection strings manually  with different names and values, or import from the &lt;em&gt;web.config&lt;/em&gt; by clicking the Import button. You can choose the script for &lt;em&gt;Schema Only&lt;/em&gt;  or the database option as well. On selection of a connection string, it  shows the source settings and we can set the values for the destination  server.&lt;br /&gt;&lt;img height="208" src="http://www.codeproject.com/KB/aspnet/Whatis_New_ASP_Net_4/22.JPG" width="538" /&gt;&lt;br /&gt;You can also add database script files manually by clicking the Add  button. You can also change the order of SQL files to run on server.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/814396016109370747-2742823068051044539?l=amitshinde14.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://amitshinde14.blogspot.com/2012/03/what-is-new-in-aspnet-40-visual-studio.html</link><author>noreply@blogger.com (Amit Kumar Shinde)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-814396016109370747.post-7859636749534913402</guid><pubDate>Thu, 22 Mar 2012 03:31:00 +0000</pubDate><atom:updated>2012-03-21T20:31:04.327-07:00</atom:updated><title>Inversion of Control : A beginner Guide</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;strong&gt;What is Problem?&lt;br /&gt;&lt;/strong&gt;Let, there is a class called Kids.cs. Purpose of this class is to maintain name and age of kids of a particular person. &lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;u&gt;Kids.cs&lt;/u&gt;&lt;/em&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Linq;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Text;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; IOC&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Kids&lt;/span&gt;&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;int&lt;/span&gt; age;&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; name;&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; Kids(&lt;span style="color: blue;"&gt;int&lt;/span&gt; age, &lt;span style="color: blue;"&gt;string&lt;/span&gt; name)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;this&lt;/span&gt;.age = age;&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;this&lt;/span&gt;.name = name; &lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; ToString()&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;span style="color: green;"&gt;//return base.ToString();&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;string&lt;/span&gt; m = &lt;span style="color: blue;"&gt;this&lt;/span&gt;.age.ToString();&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #a31515;"&gt;"KIDs Age "&lt;/span&gt; + m + &lt;span style="color: #a31515;"&gt;" Kids Name "&lt;/span&gt; + name; &lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;Now  requirement is like each person has Kids. So at time of creation of a  Person, associated Kids should also get created. So this may achieve by  following code&lt;br /&gt;&lt;em&gt;&lt;u&gt;Person.cs&lt;/u&gt;&lt;/em&gt; &lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Linq;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Text;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; IOC&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Person&lt;/span&gt;&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;int&lt;/span&gt; age;&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; name;&lt;br /&gt;&amp;nbsp; &lt;span style="background-color: yellow; color: blue;"&gt;private&lt;/span&gt;&lt;span style="background-color: yellow;"&gt; &lt;span style="color: #2b91af;"&gt;Kids&lt;/span&gt; obj;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; Person(&lt;span style="color: blue;"&gt;int&lt;/span&gt; personAge,&lt;span style="color: blue;"&gt;string&lt;/span&gt; personName, &lt;span style="color: blue;"&gt;int&lt;/span&gt; kidsAge, &lt;span style="color: blue;"&gt;string&lt;/span&gt; kidsName)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;span style="background-color: yellow;"&gt;obj = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Kids&lt;/span&gt;(kidsAge, kidsName);&lt;/span&gt;&lt;br /&gt;&amp;nbsp; age = personAge;&lt;br /&gt;&amp;nbsp; name = personName;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; ToString()&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;span style="color: green;"&gt;//return base.ToString();&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;string&lt;/span&gt; s= age.ToString();&lt;br /&gt;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;.Write(obj);&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #a31515;"&gt;"ParentAge"&lt;/span&gt; + s + &lt;span style="color: #a31515;"&gt;" ParentName"&lt;/span&gt; + name; &lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;em&gt;&lt;u&gt;Main.cs&lt;/u&gt;&lt;/em&gt; &lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Linq;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Text;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; IOC&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Program&lt;/span&gt;&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Main(&lt;span style="color: blue;"&gt;string&lt;/span&gt;[] args)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Person&lt;/span&gt; p = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Person&lt;/span&gt;(35, &lt;span style="color: #a31515;"&gt;"Dev"&lt;/span&gt;, 6, &lt;span style="color: #a31515;"&gt;"Len"&lt;/span&gt;);&lt;br /&gt;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;.WriteLine(p);&lt;br /&gt;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;.Read();&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;Output&lt;br /&gt;&lt;img align="bottom" alt="" hspace="0" src="http://www.dotnetspark.com/kbPicture/dhananjay25_633960259289933830_image1.gif" /&gt;&lt;br /&gt;&lt;br /&gt;The above code is a typical example of COMPOSITION &lt;a class="kLink" href="http://www.dotnetspark.com/kb/1222-inversion-control--beginner-guide.aspx#" id="KonaLink1" style="font-family: inherit !important; font-size: inherit !important; font-weight: inherit !important; position: static; text-decoration: underline !important;"&gt;&lt;span style="color: #000096; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static;"&gt;&lt;span class="kLink" style="background-color: transparent; border-bottom: 1px solid rgb(0, 0, 150); color: rgb(0, 0, 150) ! important; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static;"&gt;design &lt;/span&gt;&lt;span class="kLink" style="background-color: transparent; border-bottom: 1px solid rgb(0, 0, 150); color: rgb(0, 0, 150) ! important; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static;"&gt;pattern&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; or Object Dependency. &lt;br /&gt;&lt;strong&gt;&lt;u&gt;Note&lt;/u&gt;&lt;/strong&gt;: What is Object Dependency?&lt;br /&gt;&lt;br /&gt;When one objects needs other object for its working then it is called one object is dependent on other object. &lt;br /&gt;&lt;br /&gt;Let there are three classes Man, Woman and Children &lt;br /&gt;If Man-&amp;gt; Woman &lt;br /&gt;And Woman -&amp;gt; Children &lt;br /&gt;So Man -&amp;gt; Children &lt;br /&gt;This is called Transitive Object Dependency.&lt;br /&gt;Object Coupling and Object Dependency are same term.&lt;br /&gt;A Good Design should contain loose object coupling or object dependency.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Problems in above approach&lt;/strong&gt; &lt;br /&gt;&lt;ol&gt;&lt;li&gt;It is using Part of Relationship.&amp;nbsp;  &lt;/li&gt;&lt;li&gt;Here object of Kids has been created inside constructor of Person class. So here coupling is very high or tight.  &lt;/li&gt;&lt;li&gt;If due to any reason object creation of Kids is failed. Then  Person class also cannot be instantiated in its constructor itself.&amp;nbsp;  &lt;/li&gt;&lt;li&gt;If object of Person class is killed then by default object of Kids class is also getting killed.&amp;nbsp;  &lt;/li&gt;&lt;li&gt;If a new type of Kids has been created or a new property is  being added in Kids class then it need code modification in Person class  also.&amp;nbsp;  &lt;/li&gt;&lt;li&gt;This also raises chances of Dangling Reference.  &lt;/li&gt;&lt;li&gt;Person class cannot work for Default constructor.&amp;nbsp;  &lt;/li&gt;&lt;li&gt;Kidsâ?T class cannot work for Default constructor. &lt;/li&gt;&lt;/ol&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Linq;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Text;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; IOC&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Person&lt;/span&gt;&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;int&lt;/span&gt; age;&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; name;&lt;br /&gt;&amp;nbsp; &lt;span style="background-color: yellow; color: blue;"&gt;private&lt;/span&gt;&lt;span style="background-color: yellow;"&gt; &lt;span style="color: #2b91af;"&gt;Kids&lt;/span&gt; obj;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &lt;b&gt;&lt;span style="color: red;"&gt;(Refrence)&lt;/span&gt;&lt;/b&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; Person(&lt;span style="color: blue;"&gt;int&lt;/span&gt; personAge,&lt;span style="color: blue;"&gt;string&lt;/span&gt; personName, &lt;span style="color: blue;"&gt;int&lt;/span&gt; kidsAge, &lt;span style="color: blue;"&gt;string&lt;/span&gt; kidsName)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;span style="background-color: yellow;"&gt;obj = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Kids&lt;/span&gt;(kidsAge, kidsName);&lt;/span&gt;&amp;nbsp; &lt;b&gt;&lt;span style="color: red;"&gt;(known Concrete class)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&amp;nbsp; age = personAge;&lt;br /&gt;&amp;nbsp; name = personName;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; ToString()&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;span style="color: green;"&gt;//return base.ToString();&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;string&lt;/span&gt; s= age.ToString();&lt;br /&gt;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;.Write(obj);&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #a31515;"&gt;"ParentAge"&lt;/span&gt; + s + &lt;span style="color: #a31515;"&gt;" ParentName"&lt;/span&gt; + name; &lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;How to solve above problem?&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Assign task of object creation (Kids class) to some other entity, like other class, another function.&amp;nbsp;  &lt;/li&gt;&lt;li&gt;Assign task of object creation to third party. &lt;/li&gt;&lt;/ol&gt;So, assigning task of object creation to Third Party is somehow INVERTING CONTROL to third party. And this is called &lt;strong&gt;"I&lt;em&gt;NVERSION OF CONTROL"&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;In other words IOC could be defined as&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;strong&gt;&lt;em&gt;"Delegating  task of object creation to third party,&amp;nbsp; to achieve low coupling  between objects and to minimize dependency between objects is called  Inversion of Control design pattern ".&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;img align="bottom" alt="" hspace="0" src="http://www.dotnetspark.com/kbPicture/dhananjay25_633960259344152580_image2.gif" /&gt;&lt;br /&gt;So IOC says, &lt;br /&gt;&lt;ol&gt;&lt;li&gt;Main class (Pesron.cs) which is composing other class, should not  directly depends on implementation of other class (Kids.cs) .&amp;nbsp;  &lt;/li&gt;&lt;li&gt;There should be an abstraction between classes and classes should fully depend upon that abstraction.&amp;nbsp;  &lt;/li&gt;&lt;li&gt;Abstraction could be either an interface or and abstract class.&lt;/li&gt;&lt;/ol&gt;&lt;strong&gt;Dependency Injection&lt;/strong&gt; &lt;br /&gt;This is the way to implement IOC.&amp;nbsp; &lt;a class="kLink" href="http://www.dotnetspark.com/kb/1222-inversion-control--beginner-guide.aspx#" id="KonaLink2" style="font-family: inherit !important; font-size: inherit !important; font-weight: inherit !important; position: static; text-decoration: underline !important;"&gt;&lt;span style="color: #000096; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static;"&gt;&lt;span class="kLink" style="background-color: transparent; border-bottom: 1px solid rgb(0, 0, 150); color: rgb(0, 0, 150) ! important; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static;"&gt;Dependency &lt;/span&gt;&lt;span class="kLink" style="background-color: transparent; border-bottom: 1px solid rgb(0, 0, 150); color: rgb(0, 0, 150) ! important; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static;"&gt;Injection&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; &lt;br /&gt;&lt;ol&gt;&lt;li&gt;Eliminates tight coupling between objects.&amp;nbsp;  &lt;/li&gt;&lt;li&gt;Make object and application more flexible.&amp;nbsp;  &lt;/li&gt;&lt;li&gt;It facilitates creation of more loosely coupled objects and their dependencies. &lt;/li&gt;&lt;/ol&gt;"Dependency Injection isolates implementation of object from the construction of object on which it depends". &lt;br /&gt;&lt;br /&gt;&lt;img align="bottom" alt="" hspace="0" src="http://www.dotnetspark.com/kbPicture/dhananjay25_633960259391027580_image3.gif" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Constructor Injection&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Here  object reference would get pass to constructor of business class  Person.&amp;nbsp; In this case, since Person class depends on Kids class.&amp;nbsp; So  reference of Kids class will pass to constructor of Person class. So at  the time of object creation of Person class, Kids class will get  instantiated. &lt;br /&gt;Steps to implement constructor Injection &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Step 1&lt;/u&gt;:&lt;/strong&gt;&amp;nbsp; Create an interface &lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;u&gt;IBuisnessLogic.cs&lt;/u&gt;&lt;/em&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Linq;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Text;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; IOC&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;interface&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;IBuisnessLogic&lt;/span&gt;&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;ol&gt;&lt;li&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;Only methods of interface will be exposed to business logic class (Person) &lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;&lt;u&gt;Step 2&lt;/u&gt;:&lt;/strong&gt;&amp;nbsp; Implement interface to Kids class.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;u&gt;Kids.cs&lt;/u&gt;&lt;/em&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Linq;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Text;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; IOC&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Kids&lt;/span&gt; :&lt;span style="color: #2b91af;"&gt;IBuisnessLogic&lt;/span&gt; &lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;int&lt;/span&gt; age;&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; name;&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; Kids(&lt;span style="color: blue;"&gt;int&lt;/span&gt; age, &lt;span style="color: blue;"&gt;string&lt;/span&gt; name)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;this&lt;/span&gt;.age = age;&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;this&lt;/span&gt;.name = name; &lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; ToString()&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;string&lt;/span&gt; m = &lt;span style="color: blue;"&gt;this&lt;/span&gt;.age.ToString();&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #a31515;"&gt;"KIDs Age "&lt;/span&gt; + m + &lt;span style="color: #a31515;"&gt;" Kids Name "&lt;/span&gt; + name; &lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Object of Kids class is going to be referenced by Person class. So this class needs to implement interface.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Step 3&lt;/u&gt;:&lt;/strong&gt;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;Make reference of interface in Person class. &lt;br /&gt;&lt;em&gt;&lt;u&gt;&lt;br /&gt;Person.cs&lt;/u&gt;&lt;/em&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Linq;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Text;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; IOC&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Person&lt;/span&gt;&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;int&lt;/span&gt; age;&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; name;&lt;br /&gt;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;IBuisnessLogic&lt;/span&gt; refKids;&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; Person(&lt;span style="color: blue;"&gt;int&lt;/span&gt; personAge,&lt;span style="color: blue;"&gt;string&lt;/span&gt; personName,&lt;span style="color: #2b91af;"&gt;IBuisnessLogic&lt;/span&gt; obj)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; age = personAge;&lt;br /&gt;&amp;nbsp; name = personName;&lt;br /&gt;&amp;nbsp; refKids = obj;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; ToString()&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;string&lt;/span&gt; s= age.ToString();&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #a31515;"&gt;"ParentAge"&lt;/span&gt; + s + &lt;span style="color: #a31515;"&gt;" ParentName"&lt;/span&gt; + name; &lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Step 4&lt;/u&gt;:&lt;/strong&gt;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;Now to create a third party class, where task of, creation of object will be done. &lt;br /&gt;&lt;em&gt;&lt;u&gt;&lt;br /&gt;IOCClass.cs&lt;/u&gt;&lt;/em&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Linq;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Text;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; IOC&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;IOCClass&lt;/span&gt;&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;IBuisnessLogic&lt;/span&gt; objKid = &lt;span style="color: blue;"&gt;null&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Person&lt;/span&gt; p;&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; factoryMethod()&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; objKid = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Kids&lt;/span&gt;(12,&lt;span style="color: #a31515;"&gt;"Ren"&lt;/span&gt;);&lt;br /&gt;&amp;nbsp; p= &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Person&lt;/span&gt; (42,&lt;span style="color: #a31515;"&gt;"David"&lt;/span&gt;,objKid);&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; ToString()&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;span style="color: green;"&gt;//return base.ToString();&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;.WriteLine(p);&lt;br /&gt;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;.WriteLine(objKid);&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #a31515;"&gt;"Displaying using Constructor Injection"&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;In above code inside a factorymethod (), object is getting created. &lt;br /&gt;&lt;strong&gt;&lt;u&gt;&lt;br /&gt;Step 5&lt;/u&gt;:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;Now using third party class at client side &lt;br /&gt;&lt;em&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;em&gt;&lt;u&gt;Program.cs&lt;/u&gt;&lt;/em&gt; &lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Linq;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Text;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; IOC&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Program&lt;/span&gt;&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Main(&lt;span style="color: blue;"&gt;string&lt;/span&gt;[] args)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;IOCClass&lt;/span&gt; obj = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;IOCClass&lt;/span&gt;();&lt;br /&gt;&amp;nbsp; obj.factoryMethod();&lt;br /&gt;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;.WriteLine(obj);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;.Read();&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Disadvantage&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;In constructor Injection, business logic class cannot have default constructor. &lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;Once the class is instantiated, objectâ?Ts dependency cannot be changed then.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;Setter Injection&lt;/strong&gt;&lt;br /&gt;This  uses the Properties to inject the dependency.&amp;nbsp; Here rather than  creating reference and assigning them in constructor, it has been done  in Properties.&amp;nbsp; By this way, Person class could have default constructor  also. &lt;br /&gt;&lt;strong&gt;&lt;br /&gt;Advantage:&lt;/strong&gt;&lt;/span&gt; &lt;ol&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;It is more flexible than constructor injection.&amp;nbsp; &lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;Here dependency of object can be changed without creating any instance.&amp;nbsp; &lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;Here dependency of objet can be changed without changing the constructors.&amp;nbsp; &lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;Setters has constructive and self descriptive meaningful name that simplify understanding and usning them . &lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;Implementation:&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;&lt;br /&gt;Step 1&lt;/u&gt;:&lt;/strong&gt; same as Constructor Injection. &lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;&lt;u&gt;Step 2&lt;/u&gt;:&lt;/strong&gt; Same as Constructor Injection.&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;&lt;u&gt;Step 3&lt;/u&gt;:&lt;/strong&gt;&amp;nbsp; Pesron.cs&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Linq;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Text;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; IOC&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Person&lt;/span&gt;&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;int&lt;/span&gt; age;&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; name;&lt;br /&gt;&amp;nbsp; &lt;span style="color: green;"&gt;//private Kids obj;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;IBuisnessLogic&lt;/span&gt; refKids;&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; Person(&lt;span style="color: blue;"&gt;int&lt;/span&gt; personAge,&lt;span style="color: blue;"&gt;string&lt;/span&gt; personName)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; age = personAge;&lt;br /&gt;&amp;nbsp; name = personName;&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;IBuisnessLogic&lt;/span&gt; REFKIDS&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;set&lt;/span&gt;&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; refKids = &lt;span style="color: blue;"&gt;value&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;get&lt;/span&gt;&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; refKids;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; ToString()&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;string&lt;/span&gt; s= age.ToString();&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #a31515;"&gt;"ParentAge"&lt;/span&gt; + s + &lt;span style="color: #a31515;"&gt;" ParentName"&lt;/span&gt; + name; &lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;In Person class, there is Property REFKIDS, which is setting and getting value of reference of interface.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Step 4&lt;/u&gt;:&lt;/strong&gt;&lt;br /&gt;There are some changes in third party class.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;u&gt;IOC.cs&lt;/u&gt;&lt;/em&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Linq;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Text;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; IOC&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;IOCClass&lt;/span&gt;&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;IBuisnessLogic&lt;/span&gt; objKid = &lt;span style="color: blue;"&gt;null&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Person&lt;/span&gt; p;&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; factoryMethod()&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; objKid = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Kids&lt;/span&gt;(12,&lt;span style="color: #a31515;"&gt;"Ren"&lt;/span&gt;);&lt;br /&gt;&amp;nbsp; p= &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Person&lt;/span&gt; (42,&lt;span style="color: #a31515;"&gt;"David"&lt;/span&gt;);&lt;br /&gt;&amp;nbsp; p.REFKIDS = objKid;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; ToString()&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &lt;span style="color: green;"&gt;//return base.ToString();&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;.WriteLine(p);&lt;br /&gt;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;.WriteLine(objKid);&lt;br /&gt;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #a31515;"&gt;"Displaying using Setter Injection"&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Step 5&lt;/u&gt;:&lt;/strong&gt;&lt;br /&gt;Same as constructor injection.&lt;br /&gt;&lt;br /&gt;This interface would be implemented by Business Logic class.&amp;nbsp; Here Kids is a business logic class.&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/814396016109370747-7859636749534913402?l=amitshinde14.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://amitshinde14.blogspot.com/2012/03/inversion-of-control-beginner-guide.html</link><author>noreply@blogger.com (Amit Kumar Shinde)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-814396016109370747.post-2666451784018627486</guid><pubDate>Wed, 21 Mar 2012 12:55:00 +0000</pubDate><atom:updated>2012-03-21T05:55:57.750-07:00</atom:updated><title>IoC Pattern</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;strong&gt;Introduction:&lt;/strong&gt;&lt;br /&gt;&lt;blockquote&gt;IoC (inversion of control) is a design pattern used to uncouple classes to avoid strong dependencies between them.&lt;br /&gt;As a matter of fact every system does not make assumptions about what  other systems do or should do, so no side effect when replacing a system  by another one.&lt;/blockquote&gt;Let’s have a first example showing classes having strong dependencies  between them. Here we have a main class Singer, which let us know the  song style and what formation it is.&lt;br /&gt;&lt;div class="syntaxhighlighter  " id="highlighter_809596"&gt;&lt;div class="lines"&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="keyword"&gt;public&lt;/code&gt; &lt;code class="keyword"&gt;class&lt;/code&gt; &lt;code class="plain"&gt;Song&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="keyword"&gt;public&lt;/code&gt; &lt;code class="keyword"&gt;string&lt;/code&gt; &lt;code class="plain"&gt;GetStyle()&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="plain"&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="keyword"&gt;return&lt;/code&gt; &lt;code class="string"&gt;"Rock n Roll !"&lt;/code&gt;&lt;code class="plain"&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="plain"&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="keyword"&gt;public&lt;/code&gt; &lt;code class="keyword"&gt;class&lt;/code&gt; &lt;code class="plain"&gt;LineUp&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="keyword"&gt;public&lt;/code&gt; &lt;code class="keyword"&gt;string&lt;/code&gt; &lt;code class="plain"&gt;GetFormation()&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="plain"&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="keyword"&gt;return&lt;/code&gt; &lt;code class="string"&gt;"Trio"&lt;/code&gt;&lt;code class="plain"&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;14&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="plain"&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;15&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;16&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;17&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="keyword"&gt;public&lt;/code&gt; &lt;code class="keyword"&gt;class&lt;/code&gt; &lt;code class="plain"&gt;Singer&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;18&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;19&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="plain"&gt;Song song;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;20&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="plain"&gt;LineUp lineUp;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;21&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;22&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="keyword"&gt;public&lt;/code&gt; &lt;code class="plain"&gt;Singer()&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;23&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="plain"&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;24&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="plain"&gt;song = &lt;/code&gt;&lt;code class="keyword"&gt;new&lt;/code&gt; &lt;code class="plain"&gt;Song();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;25&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="plain"&gt;lineUp = &lt;/code&gt;&lt;code class="keyword"&gt;new&lt;/code&gt; &lt;code class="plain"&gt;LineUp();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;26&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="plain"&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;27&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;28&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="keyword"&gt;public&lt;/code&gt; &lt;code class="keyword"&gt;string&lt;/code&gt; &lt;code class="plain"&gt;Sing()&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;29&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="plain"&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;30&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="keyword"&gt;return&lt;/code&gt; &lt;code class="string"&gt;"Singer sings "&lt;/code&gt; &lt;code class="plain"&gt;+ song.GetStyle() + &lt;/code&gt;&lt;code class="string"&gt;" and it is a "&lt;/code&gt; &lt;code class="plain"&gt;+&amp;nbsp; lineUp.GetFormation();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;31&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="plain"&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;32&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;here’s the Main method :&lt;br /&gt;&lt;div class="syntaxhighlighter  " id="highlighter_740411"&gt;&lt;div class="lines"&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;Singer singer = &lt;/code&gt;&lt;code class="keyword"&gt;new&lt;/code&gt; &lt;code class="plain"&gt;Singer();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;Console.WriteLine(singer.Sing());&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;As result we have : singer sings Rock n Roll ! and it is a Trio&lt;br /&gt;But what would we do if we want to hear another song?? Hearing the same one is good but at the end it could break your tears!!&lt;br /&gt;Implementation of interfaces to replaces instanciate classes (Song,  LineUp), and by this way uncoupling main class Singer with the others.&lt;br /&gt;&lt;div class="syntaxhighlighter  " id="highlighter_801012"&gt;&lt;div class="lines"&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="keyword"&gt;public&lt;/code&gt; &lt;code class="keyword"&gt;interface&lt;/code&gt; &lt;code class="plain"&gt;ISong&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="keyword"&gt;public&lt;/code&gt; &lt;code class="keyword"&gt;string&lt;/code&gt; &lt;code class="plain"&gt;GetStyle();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="keyword"&gt;public&lt;/code&gt; &lt;code class="keyword"&gt;interface&lt;/code&gt; &lt;code class="plain"&gt;ILineUp&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="keyword"&gt;public&lt;/code&gt; &lt;code class="keyword"&gt;string&lt;/code&gt; &lt;code class="plain"&gt;GetFormation();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="keyword"&gt;public&lt;/code&gt; &lt;code class="keyword"&gt;class&lt;/code&gt; &lt;code class="plain"&gt;Song : ISong&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="keyword"&gt;public&lt;/code&gt; &lt;code class="keyword"&gt;string&lt;/code&gt; &lt;code class="plain"&gt;ISong.GetStyle()&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;14&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="plain"&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;15&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="keyword"&gt;return&lt;/code&gt; &lt;code class="string"&gt;"Hip Hop !"&lt;/code&gt;&lt;code class="plain"&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;16&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="plain"&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;17&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;18&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;19&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="keyword"&gt;public&lt;/code&gt; &lt;code class="keyword"&gt;class&lt;/code&gt; &lt;code class="plain"&gt;LineUp : ILineUp&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;20&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;21&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="keyword"&gt;public&lt;/code&gt; &lt;code class="keyword"&gt;string&lt;/code&gt; &lt;code class="plain"&gt;ILineUp.GetFormation()&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;22&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="plain"&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;23&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="keyword"&gt;return&lt;/code&gt; &lt;code class="string"&gt;"Solo"&lt;/code&gt;&lt;code class="plain"&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;24&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="plain"&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;25&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;26&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;27&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="keyword"&gt;public&lt;/code&gt; &lt;code class="keyword"&gt;class&lt;/code&gt; &lt;code class="plain"&gt;Singer&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;28&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;29&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="plain"&gt;ISong _isong;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;30&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="plain"&gt;ILineUp _ilineup;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;31&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;32&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="keyword"&gt;public&lt;/code&gt; &lt;code class="keyword"&gt;string&lt;/code&gt; &lt;code class="plain"&gt;Singer(ISong &lt;/code&gt;&lt;code class="keyword"&gt;is&lt;/code&gt;&lt;code class="plain"&gt;, ILineUp il)&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;33&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="plain"&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;34&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="plain"&gt;_isong = &lt;/code&gt;&lt;code class="keyword"&gt;is&lt;/code&gt;&lt;code class="plain"&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;35&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="plain"&gt;_ilineup = il;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;36&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="plain"&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;37&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;38&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="keyword"&gt;public&lt;/code&gt; &lt;code class="keyword"&gt;string&lt;/code&gt; &lt;code class="plain"&gt;Sing()&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;39&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="plain"&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;40&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="keyword"&gt;return&lt;/code&gt; &lt;code class="plain"&gt;Singer sings &lt;/code&gt;&lt;code class="string"&gt;" + _isong.GetStyle() + "&lt;/code&gt;&lt;code class="plain"&gt;it &lt;/code&gt;&lt;code class="keyword"&gt;is&lt;/code&gt; &lt;code class="plain"&gt;a " +&amp;nbsp; _ilineup.GetFormation();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;41&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="spaces"&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="plain"&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;42&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;here’s the Main method : Now if we want to here another artist, we just have to&lt;br /&gt;instanciate so many class that we want&lt;br /&gt;&lt;div class="syntaxhighlighter  " id="highlighter_42433"&gt;&lt;div class="lines"&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="comments"&gt;//Creating dependencies&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;Song oldsong = &lt;/code&gt;&lt;code class="keyword"&gt;new&lt;/code&gt; &lt;code class="plain"&gt;Song();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;LineUp oldlineUp = &lt;/code&gt;&lt;code class="keyword"&gt;new&lt;/code&gt; &lt;code class="plain"&gt;LineUp();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="comments"&gt;//Injection of dependencies&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;Singer singer = &lt;/code&gt;&lt;code class="keyword"&gt;new&lt;/code&gt; &lt;code class="plain"&gt;Singer(oldsong,oldlineup);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;Console.WriteLine(singer.Sing());&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="comments"&gt;//Creating dependencies&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;Song newsong = &lt;/code&gt;&lt;code class="keyword"&gt;new&lt;/code&gt; &lt;code class="plain"&gt;Song();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;LineUp newlineUp = &lt;/code&gt;&lt;code class="keyword"&gt;new&lt;/code&gt; &lt;code class="plain"&gt;LineUp();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="comments"&gt;//Injection of dependencies&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;Singer singer = &lt;/code&gt;&lt;code class="keyword"&gt;new&lt;/code&gt; &lt;code class="plain"&gt;Singer(newsong,newlineup);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class="content"&gt;&lt;code class="plain"&gt;Console.WriteLine(singer.Sing());&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Thanks for reading !!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/814396016109370747-2666451784018627486?l=amitshinde14.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://amitshinde14.blogspot.com/2012/03/ioc-pattern.html</link><author>noreply@blogger.com (Amit Kumar Shinde)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-814396016109370747.post-5261184161432799535</guid><pubDate>Wed, 21 Mar 2012 12:31:00 +0000</pubDate><atom:updated>2012-03-21T05:31:32.029-07:00</atom:updated><title>A basic introduction to the Unity Application Block</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;h2&gt;Introduction&lt;/h2&gt;With its latest release, the Enterprise Library from Microsoft introduces a new component named &lt;strong&gt;Unity&lt;/strong&gt;. This application block provides an easy path to implement the IoC pattern, and consequently the Dependency Injection pattern.&lt;br /&gt;All the references for the Enterprise Library documentation can be found at the end of the article.&lt;br /&gt;&lt;h2&gt;Background&lt;/h2&gt;Inversion of Control and Dependency Injection are the key points to  understand how Unity works and the benefits of including it in our  projects. If you want a deep dive on these patterns: &lt;a href="http://martinfowler.com/articles/injection.html" title="patterns explained"&gt;http://martinfowler.com/articles/injection.html&lt;/a&gt;.&lt;br /&gt;The scope of this article is writing code that is loosely coupled. Let's examine the following &lt;code&gt;DummyLogger&lt;/code&gt; class:&lt;br /&gt;&lt;pre lang="cs"&gt;&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;class&lt;/span&gt; DummyLogger&lt;br /&gt;{&lt;br /&gt;    &lt;span class="code-keyword"&gt;private&lt;/span&gt; IWriter _selectedWriter;&lt;br /&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;public&lt;/span&gt; DummyLogger()&lt;br /&gt;    {&lt;br /&gt;        &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;The container class is in charge for the initialization of the interface. &lt;br /&gt;&lt;/span&gt;        &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;the result is a strong dependency between the two objects&lt;br /&gt;&lt;/span&gt;        _selectedWriter = &lt;span class="code-keyword"&gt;new&lt;/span&gt; ConsoleWriter();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; WriteOutput(&lt;span class="code-keyword"&gt;string&lt;/span&gt; msg)&lt;br /&gt;    {&lt;br /&gt;        _selectedWriter.Write(msg);&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;The first thing that comes to mind to break the relationship between  the two objects is to delegate the creation of the class member to  someone else:&lt;br /&gt;&lt;pre lang="cs"&gt;&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;class&lt;/span&gt; DummyLogger&lt;br /&gt;{&lt;br /&gt;    &lt;span class="code-keyword"&gt;private&lt;/span&gt; IWriter _selectedWriter;&lt;br /&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; SetWriter(IWriter writer)&lt;br /&gt;    {&lt;br /&gt;        _selectedWriter = writer;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; WriteOutput(&lt;span class="code-keyword"&gt;string&lt;/span&gt; msg)&lt;br /&gt;    {&lt;br /&gt;        _selectedWriter.Write(msg);&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;Nothing new until now. This can be interpreted as a trivial  implementation of the IoC pattern. The contained object is no more  controlled by its container class.&lt;br /&gt;But what if we don't care about the real implementation of the &lt;code&gt;IWriter&lt;/code&gt;  interface ? Here's where Unity and Dependency Injection comes. The  concrete implementation of the class member will be "injected" by Unity  depending on its configuration. The first thing we need to do is expose  the class/interface with its get/set methods and mark it with the &lt;code&gt;[Dependency]&lt;/code&gt; attribute to make it visible to the application block.&lt;br /&gt;&lt;pre lang="cs"&gt;&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;class&lt;/span&gt; DummyLogger&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;private&lt;/span&gt; IWriter _selectedWriter;&lt;br /&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; SetWriter(IWriter writer)&lt;br /&gt;    {&lt;br /&gt;        _selectedWriter = writer;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; WriteOutput(&lt;span class="code-keyword"&gt;string&lt;/span&gt; msg)&lt;br /&gt;    {&lt;br /&gt;        _selectedWriter.Write(msg);&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;Behind the scenes, each class/interface decorated with the &lt;code&gt;[Dependency]&lt;/code&gt; attribute will be created according to the Unity container's configuration. This can be done programmatically or via the &lt;em&gt;.config&lt;/em&gt; file.&lt;br /&gt;&lt;pre lang="xml"&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;type&lt;/span&gt; &lt;span class="code-attribute"&gt;type&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;George2giga.TestUnity.Library.IWriter,George2giga.TestUnity.Library"&lt;/span&gt; &lt;br /&gt;   &lt;span class="code-attribute"&gt;mapTo&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;George2giga.TestUnity.Library.ConsoleWriter,George2giga.TestUnity.Library"&lt;/span&gt; &lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;h2&gt;Using the code&lt;/h2&gt;Given below is a basic implementation of Unity. Here's the class diagram of our sample application:&lt;br /&gt;&lt;img height="372" hspace="0" src="http://www.codeproject.com/KB/architecture/Unity_Introduction/CropperCapture_11_.jpg" width="497" /&gt;&lt;br /&gt;&lt;code&gt;IWriter&lt;/code&gt;, the interface is shared between the logging providers:&lt;br /&gt;&lt;pre lang="cs"&gt;&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;interface&lt;/span&gt; IWriter&lt;br /&gt;{&lt;br /&gt;    &lt;span class="code-keyword"&gt;void&lt;/span&gt; Write(&lt;span class="code-keyword"&gt;string&lt;/span&gt; msg);&lt;br /&gt;}&lt;/pre&gt;Of the three logging providers, depending on the configuration, one of them will be "injected" to create the &lt;code&gt;IWriter&lt;/code&gt; instance:&lt;br /&gt;&lt;pre lang="cs"&gt;&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;class&lt;/span&gt; ConsoleWriter : IWriter&lt;br /&gt;{&lt;br /&gt;    &lt;span class="code-preprocessor"&gt;#region&lt;/span&gt; IWriter Members&lt;br /&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; Write(&lt;span class="code-keyword"&gt;string&lt;/span&gt; msg)&lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine(msg);&lt;br /&gt;        Console.ReadLine();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span class="code-preprocessor"&gt;#endregion&lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;class&lt;/span&gt; FileWriter : IWriter&lt;br /&gt;{&lt;br /&gt;    &lt;span class="code-preprocessor"&gt;#region&lt;/span&gt; IWriter Members&lt;br /&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; Write(&lt;span class="code-keyword"&gt;string&lt;/span&gt; msg)&lt;br /&gt;    {&lt;br /&gt;        &lt;span class="code-keyword"&gt;using&lt;/span&gt; (StreamWriter streamWriter = &lt;br /&gt;               &lt;span class="code-keyword"&gt;new&lt;/span&gt; StreamWriter(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;c:\\TestUnity.txt"&lt;/span&gt;,&lt;span class="code-keyword"&gt;true&lt;/span&gt;))&lt;br /&gt;        {&lt;br /&gt;            streamWriter.WriteLine(msg);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="code-preprocessor"&gt;#endregion&lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;class&lt;/span&gt; EventViewerWriter : IWriter&lt;br /&gt;{&lt;br /&gt;    &lt;span class="code-preprocessor"&gt;#region&lt;/span&gt; IWriter Members&lt;br /&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; Write(&lt;span class="code-keyword"&gt;string&lt;/span&gt; msg)&lt;br /&gt;    {&lt;br /&gt;        EventLog.WriteEntry(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;TestUnity"&lt;/span&gt;, msg, &lt;br /&gt;                            EventLogEntryType.Information);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span class="code-preprocessor"&gt;#endregion&lt;/span&gt;&lt;br /&gt;}&lt;/pre&gt;The logging class contains the dependency property:&lt;br /&gt;&lt;pre lang="cs"&gt;&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;class&lt;/span&gt; DummyLogger&lt;br /&gt;{&lt;br /&gt;    &lt;span class="code-keyword"&gt;private&lt;/span&gt; IWriter selectedWriter;&lt;br /&gt;&lt;br /&gt;    [Dependency]&lt;br /&gt;    &lt;span class="code-keyword"&gt;public&lt;/span&gt; IWriter SelectedWriter&lt;br /&gt;    {&lt;br /&gt;        &lt;span class="code-keyword"&gt;get&lt;/span&gt; { &lt;span class="code-keyword"&gt;return&lt;/span&gt; selectedWriter; }&lt;br /&gt;        &lt;span class="code-keyword"&gt;set&lt;/span&gt; { selectedWriter = value; }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; WriteOutput(&lt;span class="code-keyword"&gt;string&lt;/span&gt; msg)&lt;br /&gt;    {&lt;br /&gt;        selectedWriter.Write(msg);&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;The entry point of the application is responsible for the initialization of the Unity container:&lt;br /&gt;&lt;pre lang="cs"&gt;&lt;span class="code-keyword"&gt;class&lt;/span&gt; Program&lt;br /&gt;{&lt;br /&gt;    &lt;span class="code-keyword"&gt;static&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; Main(&lt;span class="code-keyword"&gt;string&lt;/span&gt;[] args)&lt;br /&gt;    {&lt;br /&gt;        IUnityContainer container = &lt;span class="code-keyword"&gt;new&lt;/span&gt; UnityContainer();&lt;br /&gt;        UnityConfigurationSection section = &lt;br /&gt;          (UnityConfigurationSection)ConfigurationManager.GetSection(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;unity"&lt;/span&gt;);&lt;br /&gt;        section.Containers.Default.Configure(container);&lt;br /&gt;        DummyLogger dummyLogger = container.Resolve&lt;dummylogger&gt;();&lt;br /&gt;        dummyLogger.SelectedWriter.Write(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Hello"&lt;/span&gt;);}&lt;br /&gt;}&lt;/dummylogger&gt;&lt;/pre&gt;Here is the &lt;em&gt;App.config&lt;/em&gt;:&lt;br /&gt;&lt;pre lang="xml"&gt;&lt;span class="code-SummaryComment"&gt;&lt;!--?&lt;/span--&gt;&lt;span class="code-SummaryComment"&gt;xml&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;version&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;1.0"&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;encoding&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;utf-8"&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;?&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;configuration&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;configSections&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;section&lt;/span&gt; &lt;span class="code-attribute"&gt;name&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;unity"&lt;/span&gt; &lt;br /&gt;         &lt;span class="code-attribute"&gt;type&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, &lt;br /&gt;               Microsoft.Practices.Unity.Configuration"&lt;/span&gt; &lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;configSections&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;unity&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;containers&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;container&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;          &lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;types&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;type&lt;/span&gt; &lt;br /&gt;               &lt;span class="code-attribute"&gt;type&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;George2giga.TestUnity.Library.IWriter,George2giga.TestUnity.Library"&lt;/span&gt; &lt;br /&gt;               &lt;span class="code-attribute"&gt;mapTo&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;George2giga.TestUnity.Library.ConsoleWriter,&lt;br /&gt;                      George2giga.TestUnity.Library"&lt;/span&gt; &lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;          &lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;types&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;container&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;containers&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;unity&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;configuration&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;h2&gt;Points of interest&lt;/h2&gt;Design patterns are without doubt a very interesting argument. With  Unity, we are able to implement two of them in a very easy way.  Dependency Injection allows us to create code that is decoupled, where  we can create dependencies without hard-coding anything on our project.&lt;br /&gt;&lt;h2&gt;References&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Unity: &lt;a href="http://msdn.microsoft.com/en-us/library/cc440954.aspx"&gt;http://msdn.microsoft.com/en-us/library/cc440954.aspx&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/814396016109370747-5261184161432799535?l=amitshinde14.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://amitshinde14.blogspot.com/2012/03/basic-introduction-to-unity-application.html</link><author>noreply@blogger.com (Amit Kumar Shinde)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-814396016109370747.post-7022073746692810917</guid><pubDate>Wed, 21 Mar 2012 03:56:00 +0000</pubDate><atom:updated>2012-03-20T20:56:18.503-07:00</atom:updated><title>Encryption and Decryption using Cryptography Application block in Enterprise Library 5.0(part 1)</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;h2&gt; Introduction&lt;/h2&gt;&lt;div style="margin-bottom: 0in;"&gt;In the last article (&lt;a href="http://www.dotnetfunda.com/articles/article1325-how-to-use-logging-application-block-in-enterprise-library-50-.aspx" target="_blank" title="How to use logging application block in enterprise library 5.0"&gt;How to use logging application block in enterprise library 5.0&lt;/a&gt;) I have shown you how to configure the web.config for using enterprise library 5.0.&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2&gt;Let us learn how to use Cryptography Application Block&lt;/h2&gt;&lt;div style="margin-bottom: 0in;"&gt;For using the Cryptography Application  Block you have to select "Add Cryptography settings" by clicking the  Block menu of the web.config (in edit mode). This adds two empty columns  to the tool: one for Hash providers and other for Symmetric  Cryptography Providers.&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;img height="285" src="http://www.dotnetfunda.com/UserFiles/ArticlesFiles/Nithadeepak_8660_1.JPG" width="400" /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt; &lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;strong&gt;Configuring the application for using symmetric key cryptography provider&lt;/strong&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;1. Click the plus-sign icon in the  Symmetric Cryptography Providers column, point to Add Symmetric  Cryptography Providers, and click Add Symmetric Algorithm Provider. &lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;img height="268" src="http://www.dotnetfunda.com/UserFiles/ArticlesFiles/Nithadeepak_0008_2.JPG" width="400" /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt; &lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;2. A dialog is displayed, as shown in the  following screen shot. Expand the mscorlib item until you see a list of  algorithm providers. Select the RijndaelManaged type and then click OK.  (You can select any algorithm.Here I'm showing an example based on  RijndaelManaged algorithm.).&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;img src="http://www.dotnetfunda.com/UserFiles/ArticlesFiles/Nithadeepak_7821_3.JPG" /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt; &lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;3. The Cryptographic Key Wizard is  displayed (see below). In the first screen of the wizard, select the  Create a new key option, and then click the Next button. &lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;img src="http://www.dotnetfunda.com/UserFiles/ArticlesFiles/Nithadeepak_6121_4.JPG" /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt; &lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;The wizard will lead you through the process of creating and protecting a cryptographic key. &lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;img src="http://www.dotnetfunda.com/UserFiles/ArticlesFiles/Nithadeepak_2860_5.JPG" /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;img src="http://www.dotnetfunda.com/UserFiles/ArticlesFiles/Nithadeepak_3797_6.JPG" /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;4. Click the Generate button to generate a new key, and then click the Next button, as you see here.&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;5. Click the ellipsis (…) button and choose a key file location (here I choose Desktop) and then click the Next button. &lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;img src="http://www.dotnetfunda.com/UserFiles/ArticlesFiles/Nithadeepak_0145_7.JPG" /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&amp;nbsp; &lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;6. Select User mode and then click Finish, as you see here.&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;img src="http://www.dotnetfunda.com/UserFiles/ArticlesFiles/Nithadeepak_7860_8.JPG" /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt; &lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;After clicking finish button the tool will look like the below screen shot. You can change the name &lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;RijndaelManaged to any other name. I have changed the name to crp(not in the picture).&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt; &lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;img height="302" src="http://www.dotnetfunda.com/UserFiles/ArticlesFiles/Nithadeepak_7860_9.JPG" width="400" /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt; The xml&amp;nbsp; of web.cofig is shown below&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;img height="230" src="http://www.dotnetfunda.com/UserFiles/ArticlesFiles/Nithadeepak_9481_10.JPG" width="400" /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt; &lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;strong&gt;Now the code:&lt;/strong&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;First you have to add the below references to the project&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="ArtVarName"&gt;Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.dll&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="ArtVarName"&gt;Microsoft.Practices.EnterpriseLibrary.Common.dll&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;strong&gt;aspx page&lt;/strong&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&amp;lt;%&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;@&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;Page&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;Language&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;="C#"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;AutoEventWireup&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;="true"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;CodeFile&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;="Default.aspx.cs"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;Inherits&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;="_Default"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; %&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;div lang="" style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&lt;!--&lt;/span--&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;DOCTYPE&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;html&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;PUBLIC&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;"-//W3C//DTD XHTML 1.0 Transitional//EN"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="" style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;html&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;xmlns&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;="http://www.w3.org/1999/xhtml"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;head&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;="server"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;title&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&amp;gt;&lt;!--&lt;/span--&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;title&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&lt;!--&lt;/span--&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;head&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;body&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;form&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;id&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;="form1"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;="server"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;div&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;TextBox&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;="server"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;="txt1"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;/&amp;gt; //no validations are done here so &lt;br /&gt;you have to enter text before clicking button.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;Button&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;="server"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;="btn1"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;onclick&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;="btn1_Click"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;text&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;="submit"/&amp;gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;br&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;Encrypted Text : &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;Label&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;="server"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;="lbl1"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;br&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;Decrypted Text : &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;Label&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;="server"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;="lbl2"&amp;gt;&lt;!--&lt;/span--&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;Label&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&lt;!--&lt;/span--&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;div&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&lt;!--&lt;/span--&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;form&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&lt;!--&lt;/span--&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;body&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&lt;!--&lt;/span--&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;html&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style="font-size: x-small;"&gt; &lt;/span&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;strong&gt;aspx.cs&lt;/strong&gt;&lt;/div&gt;&lt;pre&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;using&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; System;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;using&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;br /&gt;Microsoft.Practices.EnterpriseLibrary.Security.Cryptography;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="" style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;public&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;partial&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;class&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;_Default&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; : System.Web.UI.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;Page&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="" style="margin-bottom: 0in;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;protected&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;void&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; Page_Load(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;object&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; sender, &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;EventArgs&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; e)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="" style="margin-bottom: 0in;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="" style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="" style="margin-bottom: 0in;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;protected&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;void&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; btn1_Click(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;object&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; sender, &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;EventArgs&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; e)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="" style="margin-bottom: 0in;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;string&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; encrypted;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;string&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; message = txt1.Text;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;encrypted = &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;Cryptographer&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;.EncryptSymmetric(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;"crp"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;, message);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="" style="margin-bottom: 0in;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;lbl1.Text &lt;br /&gt;= encrypted;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;string&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt; plainText;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;plainText = &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;Cryptographer&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;.DecryptSymmetric(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;"crp"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span lang=""&gt;, encrypted);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="" style="margin-bottom: 0in;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;lbl2.Text &lt;br /&gt;= plainText;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="" style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="" style="margin-bottom: 0in;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="" style="margin-bottom: 0in;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: x-small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/814396016109370747-7022073746692810917?l=amitshinde14.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://amitshinde14.blogspot.com/2012/03/encryption-and-decryption-using.html</link><author>noreply@blogger.com (Amit Kumar Shinde)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-814396016109370747.post-4303898743174512024</guid><pubDate>Wed, 21 Mar 2012 03:55:00 +0000</pubDate><atom:updated>2012-03-20T20:55:18.984-07:00</atom:updated><title>How to use Logging Application Block in Enterprise Library 5.0</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Here I'm writing about Logging Application  Block of Enterprise Library 5.0. For using application blocks first you  have to install Microsoft Patterns and Practices Enterprise Library 5.0.  After installing this you will get an edit mode while right clicking  the web.config from your application .  &lt;br /&gt;&lt;br /&gt;&lt;div&gt;Different application blocks available in Enterprise Library 5.0 are:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Caching Application Block&lt;/li&gt;&lt;li&gt;Data Access Application Block&lt;/li&gt;&lt;li&gt;Exception Handling Application Block&lt;/li&gt;&lt;li&gt;Logging Application Block&lt;/li&gt;&lt;li&gt;Policy Injection Application Block&lt;/li&gt;&lt;li&gt;Cryptography Application Block&lt;/li&gt;&lt;li&gt;Security Application Block&lt;/li&gt;&lt;li&gt;Validation Application Block&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;The edit mode of web.config looks like the below picture.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;img height="271" src="http://www.dotnetfunda.com/UserFiles/ArticlesFiles/Nithadeepak_9938_image1.JPG" width="400" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;By  clicking on the blocks menu you can add the desired blocks into your  application. So here I'm adding Logging Application Block into my  application. So the web.config &amp;nbsp;looks like below&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;img height="297" src="http://www.dotnetfunda.com/UserFiles/ArticlesFiles/Nithadeepak_0758_image2.JPG" width="400" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Use of Logging Application Block&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Logging Application Block is used to write information’s to variety of locations like:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;event log&lt;/li&gt;&lt;li&gt;an email&lt;/li&gt;&lt;li&gt;a database&lt;/li&gt;&lt;li&gt;a message queue&lt;/li&gt;&lt;li&gt;a text file&lt;/li&gt;&lt;li&gt;a WMI event&lt;/li&gt;&lt;li&gt;custom locations using application block extension points.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can log messages to any locations by editing web.config without changing the c# codes.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here I'm showing how to log information’s to an event log, an email and a text file.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;1.Logging messages to event log (Event Viewer)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First you have to configure the web.config. By default the messages are logged into the event log.&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://www.dotnetfunda.com/UserFiles/ArticlesFiles/Nithadeepak_8668_image3.JPG" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can edit the web.config &amp;nbsp;Give the source name as the name of your application.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://www.dotnetfunda.com/UserFiles/ArticlesFiles/Nithadeepak_3141_image4.JPG" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Below example shows how to log event viewer in a button click.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First you have to add the reference Enterprise Library Logging Application Block to the bin folder of your application.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;aspx page&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;pre&gt;&lt;span class="Apple-style-span" style="font-size: 13px; white-space: normal;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New';"&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;title&gt; Event Viewer&lt;/title&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;form id="form1" runat="server"&gt;&lt;/form&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;asp:button id="btn1" onclick="btn1_Click" runat="server" text="Submit"&gt;&lt;/asp:button&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;aspx.cs&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;pre&gt;&lt;span class="Apple-style-span" style="font-size: 13px; white-space: normal;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New';"&gt;&lt;div&gt;using System;&lt;/div&gt;&lt;div&gt;using Microsoft.Practices.EnterpriseLibrary.Logging;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;public partial class _Default : System.Web.UI.Page&amp;nbsp;&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;protected void Page_Load(object sender, EventArgs e)&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;protected void btn1_Click(object sender, EventArgs e)&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LogEntry logEntry = new LogEntry();&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logEntry.EventId = 100;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logEntry.Priority = 2;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logEntry.Message = "Informational message";&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Logger.Write(logEntry); &amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When  you click on the button the message will be logged into the event  viewer. Instead of using LogEntry class, you can &amp;nbsp;use only &amp;nbsp;the Write()  method of the Logger class as shown below.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;pre&gt;&lt;span class="Apple-style-span" style="font-size: 13px; white-space: normal;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New';"&gt;&lt;div&gt;using System;&lt;/div&gt;&lt;div&gt;using Microsoft.Practices.EnterpriseLibrary.Logging;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;public partial class _Default : System.Web.UI.Page&amp;nbsp;&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;protected void Page_Load(object sender, EventArgs e)&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;protected void btn1_Click(object sender, EventArgs e)&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Logger.Write("Informational message","EventLog",2,100);&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2.&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;Logging messages to an email&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There  is no need to change the c# code only configure the web.config. You  have to change the logging target listener from event log listener to  email trace listener. You can do this by clicking on the + sign on the  right of logging target listeners.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You have to give the From Address, Smtp port, Smtp Server, To Address in the web.config.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://www.dotnetfunda.com/UserFiles/ArticlesFiles/Nithadeepak_4196_image5.JPG" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;While clicking the button the message will be logged to the email.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3.&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;Logging messages to a text file&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;No  need to change the c# code. Configure the web.config. Select Flat file  trace listener as logging target listener. The web.config is shown  below.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://www.dotnetfunda.com/UserFiles/ArticlesFiles/Nithadeepak_2731_image6.JPG" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;While  clicking the button, a log file (here trace.log) will be created in  your application and the message will be logged into that file.&lt;/div&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;div class="MsoNormal"&gt;Logging  Application Block in the Enterprise Library is used to log messages to  different locations by configuring the web.config, without any changes  in the code.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/814396016109370747-4303898743174512024?l=amitshinde14.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://amitshinde14.blogspot.com/2012/03/how-to-use-logging-application-block-in.html</link><author>noreply@blogger.com (Amit Kumar Shinde)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-814396016109370747.post-1890112115843648508</guid><pubDate>Thu, 15 Mar 2012 12:25:00 +0000</pubDate><atom:updated>2012-03-15T05:25:07.554-07:00</atom:updated><title>Impersonation in ASP.NET</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Impersonation is used when we want our ASP.NET application to assume the identity of the local windows account instead of using custom authentication. In order to access any Windows resource on such systems, you have to configure your ASP.NET application to use impersonation. You can use these settings in web.config to turn on the impersonation:&lt;br /&gt;&lt;authentication mode="Windows"&gt;&lt;br /&gt;&lt;identity impersonate="true"&gt;&lt;br /&gt;&lt;br /&gt;By default ASP.NET runtime does not use impersonation (unless you enable it in web.config), and the code runs in an IIS 6/7 application pool by default (like on Windows 2003 and above). This IIS application pool runs under the NT AUTHORITY\Network Service identity. On an OS with IIS 5, the ASP.NET applications run in a worker process that uses the local ASPNET account identity.&lt;br /&gt;&lt;br /&gt;Impersonation can be implemented in two ways:&lt;br /&gt;&lt;br /&gt;1. Configured Impersonation: If you use &lt;impersonation="true"&gt; in web.config, you are using built-in impersonation capability in ASP.NET. This will let the user impersonate for the entire duration of the request.&lt;br /&gt;&lt;br /&gt;2. Programmatic Impersonation: You can write custom code using Windows API method calls in C#/VB.NET (as .NET does not have a managed wrapper for this) to impersonate a user for the entire duration of a request. If you want more control, such as the ability to impersonate a user for only part of the page request, you have to do the impersonation yourself in your code following this approach. Here you need to use WindowsIdentity.Impersonate() method as shown in this article: http://msdn.microsoft.com/en-us/library/ms998351.aspx&lt;br /&gt;&lt;br /&gt;For impersonating users across the domain, we need to use delegation: http://msdn.microsoft.com/en-us/library/ms998355.aspx&lt;br /&gt;&lt;br /&gt;Windows authentication and Impersonation are very useful when you are developing a web application for Intra-net systems.But it is less-flexible than using custom authentication.&lt;/impersonation="true"&gt;&lt;/identity&gt;&lt;/authentication&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/814396016109370747-1890112115843648508?l=amitshinde14.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://amitshinde14.blogspot.com/2012/03/impersonation-in-aspnet.html</link><author>noreply@blogger.com (Amit Kumar Shinde)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-814396016109370747.post-6528474551928779591</guid><pubDate>Thu, 08 Mar 2012 05:34:00 +0000</pubDate><atom:updated>2012-03-07T21:34:16.098-08:00</atom:updated><title>BillDesk Payment Gateway Integration  with Asp.Net</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif; font-size: medium;"&gt;Introduction:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;Now-a-days online shopping websites has become very popular, and to handle the secure Payment transactions, these are relying on popular third part Payment gateways like Billdesk, paypal etc.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;BillDesk is the Payment Transaction Interface which allows the secure payment through Credit card/Online&amp;nbsp; Banking transaction.&lt;/span&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=9026839171971923687" name="_Toc300758926" style="font-family: Calibri; font-size: 11pt;"&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 27pt;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif; font-size: medium;"&gt;&lt;b&gt;Step-by-step Transaction Process:&lt;/b&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri; font-size: 16pt; font-weight: bold;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: 11pt;"&gt;a.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Customer logs-in at the merchant website, chooses the product/service that he intends to purchase.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;b.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Customer then decides to make payment at merchant’s website.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;c.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Merchant website will log the order by generating a Unique Order Number; and establish a connection with the BillDesk Payment Gateway Interface [refer the section on Payment Request].&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;d.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;At the BillDesk Payment Gateway; the customer is displayed with various ‘payment options’ that the customer can use. These would include – Credit Card; Online Net Banking.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;e.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Customer chooses the payment option at BillDesk Payment Gateway, and is taken to the page of that specific bank [if Netbanking option is chosen]. Customer then enters the relevant authentication details [ie, User ID/ Card Number/ Password] at the bank’s website; and then is requested to confirm the payment amount. &lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;If the customer chooses to pay using Credit card then a payment page with the look and feel of the merchant is displayed for the user to make a payment.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;f.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Customer’s account is debited and the Customer is then directed back to the designated Return URL [RU] at Merchant website. &lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;g.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;The BillDesk Payment Gateway will provide the return response to the designated Merchant return URL received in the initial transaction request. Merchant can use this response to update its system and display to the customer that the payment process was successful.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;span lang="EN-GB"&gt;h.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&amp;nbsp;BillDesk payment gateway also generates a unique Transaction ID against each order number that is received – this could be displayed to the customer; and used for any queries relating to the transaction.&lt;/span&gt;&lt;span lang="EN-GB" style="font-family: Calibri; font-size: 11pt;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;b&gt;&lt;span style="font-size: 16pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;Payment Request:&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="text-indent: 0.5in;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;span lang="EN-GB" style="color: black;"&gt;After the customer clicks on PAY [within Merchant website], a request &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;span lang="EN-GB" style="color: black;"&gt;needs to be&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;generated by Merchant to following BillDesk URL for each&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;payment with the parameters indicated:&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in; text-indent: 0.5in;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;https://www.billdesk.com/pgidsk/pgijsp/MerchantPaymentoption.jsp&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in; text-indent: 0.5in;"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Verdana,sans-serif;"&gt;[&lt;i&gt;The above URL is for example purpose only. And will be unique for each Merchant.&lt;/i&gt;]&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="text-indent: 0.5in;"&gt;&lt;span lang="EN-GB" style="color: black;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;A brief explanation of these parameters is below:&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;/div&gt;&lt;table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none currentcolor; margin-left: 41.4pt;"&gt;&lt;tbody&gt;&lt;tr&gt;   &lt;td style="background: none repeat scroll 0% 0% rgb(230, 230, 230); border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;b&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Parameter Name&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="background: none repeat scroll 0% 0% rgb(230, 230, 230); border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;b&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="background: none repeat scroll 0% 0% rgb(230, 230, 230); border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;b&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Sample Value&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;txtCustomerID&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Order Number&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;1073234&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;txtTxnAmount&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Total value of Transaction   Rs.Ps.&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;2400.30&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;txtAdditionalInfo1&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Source&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Identity of Merchant website   with Billdesk&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;txtAdditionalInfo2&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Currency&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;INR or USD or GBP or EUR&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;txtAdditionalInfo3&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Homestays&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Kerela Backwaters&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;txtAdditionalInfo4&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Arrival Date&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;25-Sep-09&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;txtAdditionalInfo5&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Depature Date&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;28-Sep-09&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;txtAdditionalInfo6&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Guests&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;2&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;txtAdditionalInfo7&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Rooms&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;1&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;RU&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Return URL – this dynamic return   URL of the merchant where the online return response has to be received for   that transaction&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;a href="https://payment.merchant.com/"&gt;&lt;span style="color: black;"&gt;Https://payment.merchant.com&lt;/span&gt;&lt;/a&gt;   (sample)&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri; font-size: 11pt;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="MsoNormal"&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;b&gt;&lt;span lang="EN-GB" style="color: black; font-family: Verdana,sans-serif;"&gt;Note: Parameters are case sensitive.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;&lt;span lang="EN-GB" style="color: black;"&gt;Example&lt;/span&gt;&lt;/b&gt;&lt;span lang="EN-GB" style="color: black;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span lang="EN-GB" style="color: black; font-family: TTE21D73A0t00;"&gt;&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;form&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=’abc’&lt;/span&gt; &lt;span style="color: red;"&gt;method&lt;/span&gt;&lt;span style="color: blue;"&gt;='POST'&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;action&lt;/span&gt;&lt;span style="color: blue;"&gt;='https://www.billdesk.com/pgidsk/pgijsp/MerchantPaymentoption.jsp'&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;input&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;='hidden'&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;='txtCustomerID'&lt;/span&gt; &lt;span style="color: red;"&gt;value&lt;/span&gt;&lt;span style="color: blue;"&gt;='1073234'&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;input&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;='hidden'&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;='txtTxnAmount'&lt;/span&gt; &lt;span style="color: red;"&gt;value&lt;/span&gt;&lt;span style="color: blue;"&gt;='2400.30'&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;input&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;='hidden'&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=' txtAdditionalInfo1'&lt;/span&gt; &lt;span style="color: red;"&gt;value&lt;/span&gt;&lt;span style="color: blue;"&gt;=' &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Identity of Merchant website with Billdesk '&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;input&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;='hidden'&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=' txtAdditionalInfo2'&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;value&lt;/span&gt;&lt;span style="color: blue;"&gt;='USD'&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;input&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;='hidden'&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=' txtAdditionalInfo3'&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;value&lt;/span&gt;&lt;span style="color: blue;"&gt;='Kerala Backwaters'&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;input&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;='hidden'&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=' txtAdditionalInfo4'&lt;/span&gt; &lt;span style="color: red;"&gt;value&lt;/span&gt;&lt;span style="color: blue;"&gt;='25-&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Sep-08'&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;input&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;='hidden'&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=' txtAdditionalInfo5'&lt;/span&gt; &lt;span style="color: red;"&gt;value&lt;/span&gt;&lt;span style="color: blue;"&gt;='28-&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Sep-08'&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;input&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;='hidden'&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=' txtAdditionalInfo6'&lt;/span&gt; &lt;span style="color: red;"&gt;value&lt;/span&gt;&lt;span style="color: blue;"&gt;='2'&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;input&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;='hidden'&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=' txtAdditionalInfo7'&lt;/span&gt; &lt;span style="color: red;"&gt;value&lt;/span&gt;&lt;span style="color: blue;"&gt;='1'&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;input&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;='hidden'&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;='RU'&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;value&lt;/span&gt;&lt;span style="color: blue;"&gt;='https://payment.merchant.com'&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;form&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none currentcolor; margin-left: 0.5in;"&gt;&lt;tbody&gt;&lt;tr&gt;   &lt;td style="background: none repeat scroll 0% 0% rgb(230, 230, 230); border: 1pt solid windowtext; padding: 0in 5.4pt; width: 26.5pt;" valign="top" width="35"&gt;&lt;div class="NormalCalibri"&gt;&lt;b&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;No.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="background: none repeat scroll 0% 0% rgb(230, 230, 230); border: 1pt solid windowtext; padding: 0in 5.4pt; width: 135pt;" valign="top" width="180"&gt;&lt;div class="NormalCalibri"&gt;&lt;b&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Area&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="background: none repeat scroll 0% 0% rgb(230, 230, 230); border: 1pt solid windowtext; padding: 0in 5.4pt; width: 4.45in;" valign="top" width="427"&gt;&lt;div class="NormalCalibri"&gt;&lt;b&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 26.5pt;" valign="top" width="35"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;1&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 135pt;" valign="top" width="180"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Secure BillDesk URL&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 4.45in;" valign="top" width="427"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Always use “https” for the   BillDesk URL where the request will&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;be posted.&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 26.5pt;" valign="top" width="35"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;2&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 135pt;" valign="top" width="180"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;POST method&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 4.45in;" valign="top" width="427"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;* Always Use “POST” method&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;* Variables must be sent as   HIDDEN values&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 26.5pt;" valign="top" width="35"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;3&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 135pt;" valign="top" width="180"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Referral URL&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 4.45in;" valign="top" width="427"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Always call the BillDesk   production URL from the Referral URL&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;only; which needs be shared at   the time of integration.&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 26.5pt;" valign="top" width="35"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;4&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 135pt;" valign="top" width="180"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Length of parameters&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 4.45in;" valign="top" width="427"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Each parameter field should not   be more than 120 characters.&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;A ‘NULL’ value will not be   accepted for any parameter.&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 26.5pt;" valign="top" width="35"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;5&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 135pt;" valign="top" width="180"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Disallowed characters&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 4.45in;" valign="top" width="427"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Special characters are   disallowed in the parameters that are&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;sent to BillDesk. For example:&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;lt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;%&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;'&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;"&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;^&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;`&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span lang="EN-GB" style="color: black;"&gt;$&lt;/span&gt;&lt;span lang="EN-GB" style="color: black;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 26.5pt;" valign="top" width="35"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;6&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 135pt;" valign="top" width="180"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Transaction Amount&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 4.45in;" valign="top" width="427"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;During the test phase of the   integration, only Rs. 2 can be&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;used as a transaction amount.&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 26.5pt;" valign="top" width="35"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;7&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 135pt;" valign="top" width="180"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Parameter Name&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 4.45in;" valign="top" width="427"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;Parameter names (sent to   BillDesk) are case-sensitive&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri; font-size: 11pt;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;b&gt;&lt;span style="font-size: 16pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;Payment Response&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Verdana,sans-serif;"&gt;Once the Payment transaction is done in the Billdesk website, the payment response is sent to the Return URL [RU] specified dynamically by Merchant for each transaction.&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Verdana,sans-serif;"&gt;This response is the “Form submit” and can be retrieved by – Request.Form[“msg”]&lt;/span&gt;&lt;span lang="EN-GB" style="color: black; font-family: Calibri; font-size: 11pt;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;b&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;Response Message description:&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Courier;"&gt;MerchantID|CustomerID|TxnReferenceNo|BankReferenceNo|TxnAmount|BankID|BankMerchantID|TxnType|CurrencyName|ItemCode|SecurityType|SecurityID|SecurityPassword|TxnDate|AuthStatus|SettlementType|AdditionalInfo1|AdditionalInfo2|AdditionalInfo3|AdditionalInfo4|AdditionalInfo5|AdditionalInfo6|AdditionalInfo7|ErrorStatus|ErrorDescription|CheckSum&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Calibri; font-size: 11pt;"&gt;F&lt;/span&gt;&lt;span lang="EN-GB" style="color: black; font-family: Calibri;"&gt;or example, suppose the Response message for a particular transaction is as follows:&lt;/span&gt;&lt;span lang="EN-GB" style="color: black; font-family: Calibri; font-size: 11pt;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Courier;"&gt;MAHINDRAID|c7b9b0|MEPG9999999999|200911106652263|7800.00|EPG|NA|NA|INR|DIRECT|NA|NA|NA|10-11-2009 11:00:56|0300|NA|HOMESTAYS|INR|BBEstate-Coorg-Karnataka|17-Nov-09|20-Nov-09|3|1|NA|Transaction Successful|717696825&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Calibri;"&gt;Please note – MERCHANTID and the CHECKSUM KEY would be provided at the time of&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Calibri;"&gt;integration.&lt;span class="Apple-style-span" style="font-size: 11pt;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;b&gt;&lt;span style="font-size: 16pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;Payment updation process at Merchant end&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Verdana,sans-serif;"&gt;The following process should be followed at Merchant end for receiving and processing the&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Verdana,sans-serif;"&gt;payment response:&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.75in; text-indent: -0.75in;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;span lang="EN-GB" style="color: black;"&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;I.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-GB" style="color: black;"&gt;Receive and Read the Payment Response message – msg at the Return URL&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.75in; text-indent: -0.75in;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;span lang="EN-GB" style="color: black;"&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;II.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-GB" style="color: black;"&gt;Generate the ‘checksum value’ for the Payment Response and validate it with the&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;‘checksum value’ received in the Payment Response. If they match; proceed to step (c)&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;below; else display a Payment Rejection message to the customer.&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.75in; text-indent: -0.75in;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;span lang="EN-GB" style="color: black;"&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;III.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-GB" style="color: black;"&gt;Update the original record in the merchant system based on the ‘AuthStatus’ field&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;received in the Payment Response. Refer the table below for various values that are&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;received in the AuthStatus field, and the related Transaction Status. The updation to&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in; text-indent: 0.25in;"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Verdana,sans-serif;"&gt;the original record must be done as follows:&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in; text-indent: 0.25in;"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Verdana,sans-serif;"&gt;Successful transaction [AuthStatus – 0300]&lt;/span&gt;&lt;br /&gt;&lt;span lang="EN-GB" style="color: black; font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in; text-indent: 0.25in;"&gt;&lt;span lang="EN-GB" style="color: blue; font-family: Verdana,sans-serif;"&gt;Update &lt;record&gt; set STATUS = ‘SUCCESS’ where ORIGINALSTATUS=’PENDING’ and ORDERNUMBER=’&lt;/record&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in; text-indent: 0.25in;"&gt;&lt;span lang="EN-GB" style="color: blue; font-family: Verdana,sans-serif;"&gt;1073234’ and TRANSACTIONAMOUNT=’2400.30’&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in; text-indent: 0.25in;"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Verdana,sans-serif;"&gt;Failure transaction [AuthStatus – other than 0300]&lt;/span&gt;&lt;br /&gt;&lt;span lang="EN-GB" style="color: black; font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in; text-indent: 0.25in;"&gt;&lt;span lang="EN-GB" style="color: blue; font-family: Verdana,sans-serif;"&gt;Update &lt;record&gt; set STATUS = ‘FAILURE’ where ORIGINALSTATUS=’PENDING’ and ORDERNUMBER=’&lt;/record&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in; text-indent: 0.25in;"&gt;&lt;span lang="EN-GB" style="color: blue; font-family: Verdana,sans-serif;"&gt;1073234’ and TRANSACTIONAMOUNT=’2400.30’&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.75in; text-indent: -0.75in;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;span lang="EN-GB" style="color: black;"&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;IV.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-GB" style="color: black;"&gt;The above updation process ensures the following:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in; text-indent: 0.25in;"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Verdana,sans-serif;"&gt;i) &amp;nbsp; Only the original record is updated [through the Unique Order&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span lang="EN-GB" style="color: black; font-family: Verdana,sans-serif;"&gt;Number]&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in; text-indent: 0.25in;"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Verdana,sans-serif;"&gt;ii) &amp;nbsp;The record is updated only once [for original status=PENDING]&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in; text-indent: 0.25in;"&gt;&lt;span lang="EN-GB" style="color: black;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;iii) The record is updated for the same ‘Transaction Amount’ that was&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span lang="EN-GB" style="color: black;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;initiated by the merchant.&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri; font-size: 11pt;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;b&gt;&lt;span style="font-size: 16pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;Authorization status:&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none currentcolor; margin-left: 0.5in;"&gt;&lt;tbody&gt;&lt;tr&gt;   &lt;td style="background: none repeat scroll 0% 0% rgb(230, 230, 230); border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;b&gt;&lt;span lang="EN-GB" style="color: black; font-family: Calibri; font-size: 11pt;"&gt;A&lt;/span&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;uthStatus&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="background: none repeat scroll 0% 0% rgb(230, 230, 230); border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;b&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Status Reason&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="background: none repeat scroll 0% 0% rgb(230, 230, 230); border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;b&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Proposed Transaction Status&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;0300&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Success&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Successful Transaction&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;0399&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Invalid Authentication at Bank&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Cancel Transaction&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;NA&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Invalid Input in the Request   Message&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Cancel Transaction&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;0002&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Billdesk waiting for the   response from bank&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Cancel Transaction&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;0001&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Error at Billdesk&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;Cancel Transaction&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri; font-size: 11pt;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;span lang="EN-GB" style="color: black;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;For all AuthStatus that is not a Success, an ErrorDescription would be provided in the Payment Response.&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri; font-size: 11pt;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none currentcolor; margin-left: 0.5in;"&gt;&lt;tbody&gt;&lt;tr&gt;   &lt;td style="background: none repeat scroll 0% 0% rgb(230, 230, 230); border: 1pt solid windowtext; padding: 0in 5.4pt; width: 26.5pt;" valign="top" width="35"&gt;&lt;div class="NormalCalibri"&gt;&lt;b&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;No.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="background: none repeat scroll 0% 0% rgb(230, 230, 230); border: 1pt solid windowtext; padding: 0in 5.4pt; width: 135pt;" valign="top" width="180"&gt;&lt;div class="NormalCalibri"&gt;&lt;b&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Area&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="background: none repeat scroll 0% 0% rgb(230, 230, 230); border: 1pt solid windowtext; padding: 0in 5.4pt; width: 4.45in;" valign="top" width="427"&gt;&lt;div class="NormalCalibri"&gt;&lt;b&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 26.5pt;" valign="top" width="35"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;1&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 135pt;" valign="top" width="180"&gt;&lt;div class="NormalCalibri"&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span lang="EN-GB" style="color: black;"&gt;Checksum Validation&lt;/span&gt;&lt;span lang="EN-GB" style="color: black;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 4.45in;" valign="top" width="427"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Always validate the checksum   before updating the transaction&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span lang="EN-GB" style="color: black;"&gt;Response&lt;/span&gt;&lt;span lang="EN-GB" style="color: black;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 26.5pt;" valign="top" width="35"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;2&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 135pt;" valign="top" width="180"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Verify whether the&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;updation is as per the&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;process specified in&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;the interface&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;document&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 4.45in;" valign="top" width="427"&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;Only the original record is   updated [through the Unique Order Number]&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Arial,Helvetica,sans-serif;"&gt;The record is updated only once   [for original status=PENDING]&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt;&lt;span lang="EN-GB" style="color: black;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;The record is updated for the   same ‘Transaction Amount’ that was initiated by the merchant.&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri; font-size: 11pt;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;b&gt;&lt;span lang="EN-GB" style="color: black;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;Sample Code:&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri; font-size: x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Verdana,sans-serif;"&gt;In the Merchant website, the Page use the “Post method” to send the variables to the Billdesk website&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Calibri; font-size: 11pt;"&gt;&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;html&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;head&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;id&lt;/span&gt;&lt;span style="color: blue;"&gt;="Head1"&lt;/span&gt; &lt;span style="color: red;"&gt;runat&lt;/span&gt;&lt;span style="color: blue;"&gt;="server"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;title&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;Payment&lt;span style="color: blue;"&gt;&lt;span style="color: #a31515;"&gt;title&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;script&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="text/javascript"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;function&lt;/span&gt; myfunc () &lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;var&lt;/span&gt; frm = document.all(&lt;span style="color: #a31515;"&gt;"form2"&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; frm.submit();&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.onload = myfunc;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;script&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;head&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;body&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;form&lt;/span&gt; &lt;span style="color: red;"&gt;id&lt;/span&gt;&lt;span style="color: blue;"&gt;="form2"&lt;/span&gt; &lt;span style="color: red;"&gt;method&lt;/span&gt;&lt;span style="color: blue;"&gt;="post"&lt;/span&gt; &lt;span style="color: red;"&gt;action&lt;/span&gt;&lt;span style="color: blue;"&gt;="https://www.billdesk.com/ Paymentoption.jsp"&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="form2"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;input&lt;/span&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="hidden"&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="txtCustomerID"&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value&lt;/span&gt;&lt;span style="color: blue;"&gt;="&lt;/span&gt;&lt;span style="background-color: yellow;"&gt;&amp;lt;%&lt;/span&gt;=Request("txtCustomerID")&lt;span style="background-color: yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;input&lt;/span&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="hidden"&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="txtTxnAmount"&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value&lt;/span&gt;&lt;span style="color: blue;"&gt;="&lt;/span&gt;&lt;span style="background-color: yellow;"&gt;&amp;lt;%&lt;/span&gt;=Request("txtTxnAmount")&lt;span style="background-color: yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;input&lt;/span&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="hidden"&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="txtAdditionalInfo1"&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;value&lt;/span&gt;&lt;span style="color: blue;"&gt;="&lt;/span&gt;&lt;span style="background-color: yellow;"&gt;&amp;lt;%&lt;/span&gt;=Request("txtAdditionalInfo1")&lt;span style="background-color: yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt;&lt;span class="Apple-style-span" style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;input&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="hidden"&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="txtAdditionalInfo2"&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value&lt;/span&gt;&lt;span style="color: blue;"&gt;="&lt;/span&gt;&lt;span style="background-color: yellow;"&gt;&amp;lt;%&lt;/span&gt;=Request("txtAdditionalInfo2")&lt;span style="background-color: yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;input&lt;/span&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="hidden"&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="txtAdditionalInfo3"&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value&lt;/span&gt;&lt;span style="color: blue;"&gt;="&lt;/span&gt;&lt;span style="background-color: yellow;"&gt;&amp;lt;%&lt;/span&gt;=Request("txtAdditionalInfo3")&lt;span style="background-color: yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;input&lt;/span&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="hidden"&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="txtAdditionalInfo4"&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value&lt;/span&gt;&lt;span style="color: blue;"&gt;="&lt;/span&gt;&lt;span style="background-color: yellow;"&gt;&amp;lt;%&lt;/span&gt;=Request("txtAdditionalInfo4")&lt;span style="background-color: yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;input&lt;/span&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="hidden"&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="txtAdditionalInfo5"&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value&lt;/span&gt;&lt;span style="color: blue;"&gt;="&lt;/span&gt;&lt;span style="background-color: yellow;"&gt;&amp;lt;%&lt;/span&gt;=Request("txtAdditionalInfo5")&lt;span style="background-color: yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;input&lt;/span&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="hidden"&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="txtAdditionalInfo6"&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value&lt;/span&gt;&lt;span style="color: blue;"&gt;="&lt;/span&gt;&lt;span style="background-color: yellow;"&gt;&amp;lt;%&lt;/span&gt;=Request("txtAdditionalInfo6")&lt;span style="background-color: yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;input&lt;/span&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="hidden"&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="txtAdditionalInfo7"&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value&lt;/span&gt;&lt;span style="color: blue;"&gt;="&lt;/span&gt;&lt;span style="background-color: yellow;"&gt;&amp;lt;%&lt;/span&gt;=Request("txtAdditionalInfo7")&lt;span style="background-color: yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;input&lt;/span&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="hidden"&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="RU"&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://www.mahindrahomestays.com/Pages/confirmation.aspx"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&lt;span style="color: #a31515;"&gt;form&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;body&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;html&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: black; font-family: Calibri; font-size: 15px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;  &lt;br /&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in; text-indent: 0.5in;"&gt;&lt;span lang="EN-GB" style="color: black; font-family: Calibri; font-size: 11pt;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span lang="EN-GB" style="font-family: Verdana,sans-serif;"&gt;Once the Payment is done, the Bill Desk webiste posts the Response string to the Merchant website, in the form of a variable ie; “msg”.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span lang="EN-GB" style="font-family: Verdana,sans-serif;"&gt;The following sample code to be written to receive the response variable from the Billdesk website.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span class="Apple-style-span" style="font-family: Calibri; font-size: 15px;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span lang="EN-GB" style="font-family: Calibri;"&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;string&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; _paymentResp = Request.Form[&lt;span style="color: #a31515;"&gt;"msg"&lt;/span&gt;];&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span class="Apple-style-span" style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;[] arrResponse = _paymentResp.Split(&lt;span style="color: #a31515;"&gt;'|'&lt;/span&gt;); &lt;span style="color: green;"&gt;//PG&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span lang="EN-GB"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt;&lt;span class="Apple-style-span" style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; string&lt;/span&gt; merchantId = arrResponse[0];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; string&lt;/span&gt; _customerId = arrResponse[1];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; string&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; txnReferenceNo = arrResponse[2];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; bankReferenceNo = arrResponse[3];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; txnAmount = &lt;span style="color: #2b91af;"&gt;Convert&lt;/span&gt;.ToDecimal(arrResponse[4]);&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; bankId = arrResponse[5];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;string&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; bankMerchantId = arrResponse[6];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; txnType = arrResponse[7];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; currency = arrResponse[8];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; itemCode = arrResponse[9];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; securityType = arrResponse[10];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; securityId = arrResponse[11];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; securityPassword = arrResponse[12];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; txnDate = arrResponse[13]; &lt;span style="color: green;"&gt;//dd-mm-yyyy&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; authStatus = arrResponse[14];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; settlementType = arrResponse[15];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; additionalInfo1 = arrResponse[16];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;string&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; additionalInfo2 = arrResponse[17];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; additionalInfo3 = arrResponse[18];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; additionalInfo4 = arrResponse[19];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; additionalInfo5 = arrResponse[20];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;string&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; additionalInfo6 = arrResponse[21];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; additionalInfo7 = arrResponse[22];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; errorStatus = arrResponse[23];&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; _errorDescription = arrResponse[24];&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/814396016109370747-6528474551928779591?l=amitshinde14.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://amitshinde14.blogspot.com/2012/03/billdesk-payment-gateway-integration.html</link><author>noreply@blogger.com (Amit Kumar Shinde)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-814396016109370747.post-8795374758763880648</guid><pubDate>Thu, 08 Mar 2012 05:33:00 +0000</pubDate><atom:updated>2012-03-07T21:33:18.894-08:00</atom:updated><title>.Net Integration with Bill Desk Payment Gateway</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif; font-size: medium;"&gt;Introduction:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;Now-a-days online shopping websites has become very popular, and to handle the secure Payment transactions, these are relying on popular third part Payment gateways like Billdesk, paypal etc.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;BillDesk is the Payment Transaction Interface which allows the secure payment through Credit card/Online&amp;nbsp; Banking transaction.&lt;/span&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=9026839171971923687" name="_Toc300758926" style="font-family: Calibri; font-size: 11pt;"&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 27pt;"&gt; &lt;/div&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt; &lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif; font-size: medium;"&gt;&lt;b&gt;Step-by-step Transaction Process:&lt;/b&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri; font-size: 16pt; font-weight: bold;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;span style="font-size: 11pt;"&gt;a.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Customer logs-in at the merchant website, chooses the product/service that he intends to purchase.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;b.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Customer then decides to make payment at merchant’s website.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;c.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Merchant website will log the order by generating a Unique Order Number; and establish a connection with the BillDesk Payment Gateway Interface [refer the section on Payment Request].&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;d.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;At the BillDesk Payment Gateway; the customer is displayed with various ‘payment options’ that the customer can use. These would include – Credit Card; Online Net Banking.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;e.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Customer chooses the payment option at BillDesk Payment Gateway, and is taken to the page of that specific bank [if Netbanking option is chosen]. Customer then enters the relevant authentication details [ie, User ID/ Card Number/ Password] at the bank’s website; and then is requested to confirm the payment amount. &lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;If the customer chooses to pay using Credit card then a payment page with the look and feel of the merchant is displayed for the user to make a payment.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;f.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Customer’s account is debited and the Customer is then directed back to the designated Return URL [RU] at Merchant website. &lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;g.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;The BillDesk Payment Gateway will provide the return response to the designated Merchant return URL received in the initial transaction request. Merchant can use this response to update its system and display to the customer that the payment process was successful.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;span lang="EN-GB"&gt;h.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&amp;nbsp;BillDesk payment gateway also generates a unique Transaction ID against each order number that is received – this could be displayed to the customer; and used for any queries relating to the transaction.&lt;/span&gt;&lt;span lang="EN-GB" style="font-family: Calibri; font-size: 11pt;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;b&gt;&lt;span style="font-size: 16pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;Payment Request:&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt; &lt;/div&gt;&lt;div class="NormalCalibri" style="text-indent: 0.5in;"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;span lang="EN-GB" style="color: windowtext;"&gt;After the customer clicks on PAY [within Merchant website], a request &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;span lang="EN-GB" style="color: windowtext;"&gt;needs to be&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;generated by Merchant to following BillDesk URL for each&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;payment with the parameters indicated:&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in; text-indent: 0.5in;"&gt; &lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;https://www.billdesk.com/pgidsk/pgijsp/MerchantPaymentoption.jsp&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in; text-indent: 0.5in;"&gt; &lt;span lang="EN-GB" style="color: black; font-family: Verdana,sans-serif;"&gt;[&lt;i&gt;The above URL is for example purpose only. And will be unique for each Merchant.&lt;/i&gt;]&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="text-indent: 0.5in;"&gt; &lt;span lang="EN-GB" style="color: windowtext;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;A brief explanation of these parameters is below:&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt; &lt;/div&gt;&lt;table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none currentcolor; margin-left: 41.4pt;"&gt;&lt;tbody&gt;&lt;tr&gt;   &lt;td style="background: none repeat scroll 0% 0% rgb(230, 230, 230); border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;b&gt;&lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Parameter Name&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="background: none repeat scroll 0% 0% rgb(230, 230, 230); border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;b&gt;&lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="background: none repeat scroll 0% 0% rgb(230, 230, 230); border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;b&gt;&lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Sample Value&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;txtCustomerID&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Order Number&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;1073234&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;txtTxnAmount&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Total value of Transaction   Rs.Ps.&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;2400.30&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;txtAdditionalInfo1&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Source&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Identity of Merchant website   with Billdesk&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;txtAdditionalInfo2&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Currency&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;INR or USD or GBP or EUR&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;txtAdditionalInfo3&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Homestays&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Kerela Backwaters&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;txtAdditionalInfo4&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Arrival Date&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;25-Sep-09&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;txtAdditionalInfo5&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Depature Date&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;28-Sep-09&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;txtAdditionalInfo6&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Guests&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;2&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;txtAdditionalInfo7&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Rooms&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;1&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;RU&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Return URL – this dynamic return   URL of the merchant where the online return response has to be received for   that transaction&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;a href="https://payment.merchant.com/"&gt;&lt;span style="color: windowtext;"&gt;Https://payment.merchant.com&lt;/span&gt;&lt;/a&gt;   (sample)&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri; font-size: 11pt;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="MsoNormal"&gt; &lt;/div&gt;&lt;div class="MsoNormal"&gt; &lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;b&gt;&lt;span lang="EN-GB" style="color: black; font-family: Verdana,sans-serif;"&gt;Note: Parameters are case sensitive.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;&lt;span lang="EN-GB" style="color: black;"&gt;Example&lt;/span&gt;&lt;/b&gt;&lt;span lang="EN-GB" style="color: black;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span lang="EN-GB" style="color: black; font-family: TTE21D73A0t00;"&gt;&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;form&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=’abc’&lt;/span&gt; &lt;span style="color: red;"&gt;method&lt;/span&gt;&lt;span style="color: blue;"&gt;='POST'&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;action&lt;/span&gt;&lt;span style="color: blue;"&gt;='https://www.billdesk.com/pgidsk/pgijsp/MerchantPaymentoption.jsp'&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="text-indent: 0.5in;"&gt; &lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;input&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;='hidden'&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;='txtCustomerID'&lt;/span&gt; &lt;span style="color: red;"&gt;value&lt;/span&gt;&lt;span style="color: blue;"&gt;='1073234'&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;input&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;='hidden'&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;='txtTxnAmount'&lt;/span&gt; &lt;span style="color: red;"&gt;value&lt;/span&gt;&lt;span style="color: blue;"&gt;='2400.30'&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;input&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;='hidden'&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=' txtAdditionalInfo1'&lt;/span&gt; &lt;span style="color: red;"&gt;value&lt;/span&gt;&lt;span style="color: blue;"&gt;=' &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Identity of Merchant website with Billdesk '&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;input&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;='hidden'&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=' txtAdditionalInfo2'&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;value&lt;/span&gt;&lt;span style="color: blue;"&gt;='USD'&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;input&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;='hidden'&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=' txtAdditionalInfo3'&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;value&lt;/span&gt;&lt;span style="color: blue;"&gt;='Kerala Backwaters'&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;input&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;='hidden'&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=' txtAdditionalInfo4'&lt;/span&gt; &lt;span style="color: red;"&gt;value&lt;/span&gt;&lt;span style="color: blue;"&gt;='25-&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Sep-08'&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;input&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;='hidden'&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=' txtAdditionalInfo5'&lt;/span&gt; &lt;span style="color: red;"&gt;value&lt;/span&gt;&lt;span style="color: blue;"&gt;='28-&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Sep-08'&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;input&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;='hidden'&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=' txtAdditionalInfo6'&lt;/span&gt; &lt;span style="color: red;"&gt;value&lt;/span&gt;&lt;span style="color: blue;"&gt;='2'&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;input&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;='hidden'&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=' txtAdditionalInfo7'&lt;/span&gt; &lt;span style="color: red;"&gt;value&lt;/span&gt;&lt;span style="color: blue;"&gt;='1'&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;input&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;='hidden'&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;='RU'&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;value&lt;/span&gt;&lt;span style="color: blue;"&gt;='https://payment.merchant.com'&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt; &lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;!--&lt;/span--&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;form&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none currentcolor; margin-left: 0.5in;"&gt;&lt;tbody&gt;&lt;tr&gt;   &lt;td style="background: none repeat scroll 0% 0% rgb(230, 230, 230); border: 1pt solid windowtext; padding: 0in 5.4pt; width: 26.5pt;" valign="top" width="35"&gt;&lt;div class="NormalCalibri"&gt; &lt;b&gt;&lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;No.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="background: none repeat scroll 0% 0% rgb(230, 230, 230); border: 1pt solid windowtext; padding: 0in 5.4pt; width: 135pt;" valign="top" width="180"&gt;&lt;div class="NormalCalibri"&gt; &lt;b&gt;&lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Area&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="background: none repeat scroll 0% 0% rgb(230, 230, 230); border: 1pt solid windowtext; padding: 0in 5.4pt; width: 4.45in;" valign="top" width="427"&gt;&lt;div class="NormalCalibri"&gt; &lt;b&gt;&lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 26.5pt;" valign="top" width="35"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;1&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 135pt;" valign="top" width="180"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Secure BillDesk URL&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 4.45in;" valign="top" width="427"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Always use “https” for the   BillDesk URL where the request will&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;be posted.&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 26.5pt;" valign="top" width="35"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;2&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 135pt;" valign="top" width="180"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;POST method&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 4.45in;" valign="top" width="427"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;* Always Use “POST” method&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;* Variables must be sent as   HIDDEN values&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 26.5pt;" valign="top" width="35"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;3&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 135pt;" valign="top" width="180"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Referral URL&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 4.45in;" valign="top" width="427"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Always call the BillDesk   production URL from the Referral URL&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;only; which needs be shared at   the time of integration.&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 26.5pt;" valign="top" width="35"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;4&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 135pt;" valign="top" width="180"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Length of parameters&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 4.45in;" valign="top" width="427"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Each parameter field should not   be more than 120 characters.&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;A ‘NULL’ value will not be   accepted for any parameter.&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 26.5pt;" valign="top" width="35"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;5&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 135pt;" valign="top" width="180"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Disallowed characters&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 4.45in;" valign="top" width="427"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Special characters are   disallowed in the parameters that are&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;sent to BillDesk. For example:&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;lt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;%&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;'&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;"&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;^&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;`&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt; &lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span lang="EN-GB" style="color: windowtext;"&gt;$&lt;/span&gt;&lt;span lang="EN-GB" style="color: windowtext;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 26.5pt;" valign="top" width="35"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;6&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 135pt;" valign="top" width="180"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Transaction Amount&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 4.45in;" valign="top" width="427"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;During the test phase of the   integration, only Rs. 2 can be&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;used as a transaction amount.&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 26.5pt;" valign="top" width="35"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;7&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 135pt;" valign="top" width="180"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Parameter Name&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 4.45in;" valign="top" width="427"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;Parameter names (sent to   BillDesk) are case-sensitive&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri; font-size: 11pt;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;b&gt;&lt;span style="font-size: 16pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;Payment Response&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Verdana,sans-serif;"&gt;Once the Payment transaction is done in the Billdesk website, the payment response is sent to the Return URL [RU] specified dynamically by Merchant for each transaction.&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Verdana,sans-serif;"&gt;This response is the “Form submit” and can be retrieved by – Request.Form[“msg”]&lt;/span&gt;&lt;span lang="EN-GB" style="color: windowtext; font-family: Calibri; font-size: 11pt;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;b&gt;&lt;span lang="EN-GB" style="color: windowtext; font-size: 11pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;Response Message description:&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Courier;"&gt;MerchantID|CustomerID|TxnReferenceNo|BankReferenceNo|TxnAmount|BankID|BankMerchantID|TxnType|CurrencyName|ItemCode|SecurityType|SecurityID|SecurityPassword|TxnDate|AuthStatus|SettlementType|AdditionalInfo1|AdditionalInfo2|AdditionalInfo3|AdditionalInfo4|AdditionalInfo5|AdditionalInfo6|AdditionalInfo7|ErrorStatus|ErrorDescription|CheckSum&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Calibri; font-size: 11pt;"&gt;F&lt;/span&gt;&lt;span lang="EN-GB" style="color: windowtext; font-family: Calibri;"&gt;or example, suppose the Response message for a particular transaction is as follows:&lt;/span&gt;&lt;span lang="EN-GB" style="color: windowtext; font-family: Calibri; font-size: 11pt;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Courier;"&gt;MAHINDRAID|c7b9b0|MEPG9999999999|200911106652263|7800.00|EPG|NA|NA|INR|DIRECT|NA|NA|NA|10-11-2009 11:00:56|0300|NA|HOMESTAYS|INR|BBEstate-Coorg-Karnataka|17-Nov-09|20-Nov-09|3|1|NA|Transaction Successful|717696825&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Calibri;"&gt;Please note – MERCHANTID and the CHECKSUM KEY would be provided at the time of&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Calibri;"&gt;integration.&lt;span class="Apple-style-span" style="font-size: 11pt;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;b&gt;&lt;span style="font-size: 16pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;Payment updation process at Merchant end&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Verdana,sans-serif;"&gt;The following process should be followed at Merchant end for receiving and processing the&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Verdana,sans-serif;"&gt;payment response:&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.75in; text-indent: -0.75in;"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;span lang="EN-GB" style="color: windowtext;"&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;I.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-GB" style="color: windowtext;"&gt;Receive and Read the Payment Response message – msg at the Return URL&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.75in; text-indent: -0.75in;"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;span lang="EN-GB" style="color: windowtext;"&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;II.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-GB" style="color: windowtext;"&gt;Generate the ‘checksum value’ for the Payment Response and validate it with the&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;‘checksum value’ received in the Payment Response. If they match; proceed to step (c)&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;below; else display a Payment Rejection message to the customer.&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.75in; text-indent: -0.75in;"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;span lang="EN-GB" style="color: windowtext;"&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;III.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-GB" style="color: windowtext;"&gt;Update the original record in the merchant system based on the ‘AuthStatus’ field&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;received in the Payment Response. Refer the table below for various values that are&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;received in the AuthStatus field, and the related Transaction Status. The updation to&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in; text-indent: 0.25in;"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Verdana,sans-serif;"&gt;the original record must be done as follows:&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in; text-indent: 0.25in;"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Verdana,sans-serif;"&gt;Successful transaction [AuthStatus – 0300]&lt;/span&gt;&lt;br /&gt;&lt;span lang="EN-GB" style="color: windowtext; font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in; text-indent: 0.25in;"&gt; &lt;span lang="EN-GB" style="color: blue; font-family: Verdana,sans-serif;"&gt;Update &lt;record&gt; set STATUS = ‘SUCCESS’ where ORIGINALSTATUS=’PENDING’ and ORDERNUMBER=’&lt;/record&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in; text-indent: 0.25in;"&gt; &lt;span lang="EN-GB" style="color: blue; font-family: Verdana,sans-serif;"&gt;1073234’ and TRANSACTIONAMOUNT=’2400.30’&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in; text-indent: 0.25in;"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Verdana,sans-serif;"&gt;Failure transaction [AuthStatus – other than 0300]&lt;/span&gt;&lt;br /&gt;&lt;span lang="EN-GB" style="color: windowtext; font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in; text-indent: 0.25in;"&gt; &lt;span lang="EN-GB" style="color: blue; font-family: Verdana,sans-serif;"&gt;Update &lt;record&gt; set STATUS = ‘FAILURE’ where ORIGINALSTATUS=’PENDING’ and ORDERNUMBER=’&lt;/record&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in; text-indent: 0.25in;"&gt; &lt;span lang="EN-GB" style="color: blue; font-family: Verdana,sans-serif;"&gt;1073234’ and TRANSACTIONAMOUNT=’2400.30’&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.75in; text-indent: -0.75in;"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;span lang="EN-GB" style="color: windowtext;"&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;IV.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-GB" style="color: windowtext;"&gt;The above updation process ensures the following:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in; text-indent: 0.25in;"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Verdana,sans-serif;"&gt;i) &amp;nbsp; Only the original record is updated [through the Unique Order&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span lang="EN-GB" style="color: windowtext; font-family: Verdana,sans-serif;"&gt;Number]&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in; text-indent: 0.25in;"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Verdana,sans-serif;"&gt;ii) &amp;nbsp;The record is updated only once [for original status=PENDING]&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in; text-indent: 0.25in;"&gt; &lt;span lang="EN-GB" style="color: windowtext;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;iii) The record is updated for the same ‘Transaction Amount’ that was&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span lang="EN-GB" style="color: windowtext;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;initiated by the merchant.&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri; font-size: 11pt;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;b&gt;&lt;span style="font-size: 16pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;Authorization status:&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none currentcolor; margin-left: 0.5in;"&gt;&lt;tbody&gt;&lt;tr&gt;   &lt;td style="background: none repeat scroll 0% 0% rgb(230, 230, 230); border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;b&gt;&lt;span lang="EN-GB" style="color: windowtext; font-family: Calibri; font-size: 11pt;"&gt;A&lt;/span&gt;&lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;uthStatus&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="background: none repeat scroll 0% 0% rgb(230, 230, 230); border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;b&gt;&lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Status Reason&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="background: none repeat scroll 0% 0% rgb(230, 230, 230); border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;b&gt;&lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Proposed Transaction Status&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;0300&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Success&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Successful Transaction&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;0399&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Invalid Authentication at Bank&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Cancel Transaction&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;NA&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Invalid Input in the Request   Message&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Cancel Transaction&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;0002&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Billdesk waiting for the   response from bank&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Cancel Transaction&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;0001&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Error at Billdesk&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt;" valign="top" width="213"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;Cancel Transaction&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri; font-size: 11pt;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;span lang="EN-GB" style="color: windowtext;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;For all AuthStatus that is not a Success, an ErrorDescription would be provided in the Payment Response.&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri; font-size: 11pt;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none currentcolor; margin-left: 0.5in;"&gt;&lt;tbody&gt;&lt;tr&gt;   &lt;td style="background: none repeat scroll 0% 0% rgb(230, 230, 230); border: 1pt solid windowtext; padding: 0in 5.4pt; width: 26.5pt;" valign="top" width="35"&gt;&lt;div class="NormalCalibri"&gt; &lt;b&gt;&lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;No.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="background: none repeat scroll 0% 0% rgb(230, 230, 230); border: 1pt solid windowtext; padding: 0in 5.4pt; width: 135pt;" valign="top" width="180"&gt;&lt;div class="NormalCalibri"&gt; &lt;b&gt;&lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Area&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="background: none repeat scroll 0% 0% rgb(230, 230, 230); border: 1pt solid windowtext; padding: 0in 5.4pt; width: 4.45in;" valign="top" width="427"&gt;&lt;div class="NormalCalibri"&gt; &lt;b&gt;&lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 26.5pt;" valign="top" width="35"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;1&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 135pt;" valign="top" width="180"&gt;&lt;div class="NormalCalibri"&gt; &lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span lang="EN-GB" style="color: windowtext;"&gt;Checksum Validation&lt;/span&gt;&lt;span lang="EN-GB" style="color: windowtext;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 4.45in;" valign="top" width="427"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Always validate the checksum   before updating the transaction&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt; &lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span lang="EN-GB" style="color: windowtext;"&gt;Response&lt;/span&gt;&lt;span lang="EN-GB" style="color: windowtext;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 26.5pt;" valign="top" width="35"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;2&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 135pt;" valign="top" width="180"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Verify whether the&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;updation is as per the&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;process specified in&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;the interface&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;document&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: currentcolor windowtext windowtext currentcolor; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 4.45in;" valign="top" width="427"&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;Only the original record is   updated [through the Unique Order Number]&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Arial,Helvetica,sans-serif;"&gt;The record is updated only once   [for original status=PENDING]&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri"&gt; &lt;span lang="EN-GB" style="color: windowtext;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;The record is updated for the   same ‘Transaction Amount’ that was initiated by the merchant.&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri; font-size: 11pt;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;b&gt;&lt;span lang="EN-GB" style="color: windowtext;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"&gt;Sample Code:&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri; font-size: x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Verdana,sans-serif;"&gt;In the Merchant website, the Page use the “Post method” to send the variables to the Billdesk website&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in;"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Calibri; font-size: 11pt;"&gt;&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;html&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;head&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;id&lt;/span&gt;&lt;span style="color: blue;"&gt;="Head1"&lt;/span&gt; &lt;span style="color: red;"&gt;runat&lt;/span&gt;&lt;span style="color: blue;"&gt;="server"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;title&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;Payment&lt;span style="color: blue;"&gt;&lt;!--&lt;/span--&gt;&lt;span style="color: #a31515;"&gt;title&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;script&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="text/javascript"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;function&lt;/span&gt; myfunc () &lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;var&lt;/span&gt; frm = document.all(&lt;span style="color: #a31515;"&gt;"form2"&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; frm.submit();&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.onload = myfunc;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;!--&lt;/span--&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;script&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;!--&lt;/span--&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;head&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;body&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;form&lt;/span&gt; &lt;span style="color: red;"&gt;id&lt;/span&gt;&lt;span style="color: blue;"&gt;="form2"&lt;/span&gt; &lt;span style="color: red;"&gt;method&lt;/span&gt;&lt;span style="color: blue;"&gt;="post"&lt;/span&gt; &lt;span style="color: red;"&gt;action&lt;/span&gt;&lt;span style="color: blue;"&gt;="https://www.billdesk.com/ Paymentoption.jsp"&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="form2"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;input&lt;/span&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="hidden"&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="txtCustomerID"&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value&lt;/span&gt;&lt;span style="color: blue;"&gt;="&lt;/span&gt;&lt;span style="background-color: yellow;"&gt;&amp;lt;%&lt;/span&gt;=Request("txtCustomerID")&lt;span style="background-color: yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;input&lt;/span&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="hidden"&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="txtTxnAmount"&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value&lt;/span&gt;&lt;span style="color: blue;"&gt;="&lt;/span&gt;&lt;span style="background-color: yellow;"&gt;&amp;lt;%&lt;/span&gt;=Request("txtTxnAmount")&lt;span style="background-color: yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;input&lt;/span&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="hidden"&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="txtAdditionalInfo1"&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;div&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;value&lt;/span&gt;&lt;span style="color: blue;"&gt;="&lt;/span&gt;&lt;span style="background-color: yellow;"&gt;&amp;lt;%&lt;/span&gt;=Request("txtAdditionalInfo1")&lt;span style="background-color: yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt; &lt;span class="Apple-style-span" style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt; &lt;span class="Apple-style-span" style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;input&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="hidden"&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="txtAdditionalInfo2"&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value&lt;/span&gt;&lt;span style="color: blue;"&gt;="&lt;/span&gt;&lt;span style="background-color: yellow;"&gt;&amp;lt;%&lt;/span&gt;=Request("txtAdditionalInfo2")&lt;span style="background-color: yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;input&lt;/span&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="hidden"&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="txtAdditionalInfo3"&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value&lt;/span&gt;&lt;span style="color: blue;"&gt;="&lt;/span&gt;&lt;span style="background-color: yellow;"&gt;&amp;lt;%&lt;/span&gt;=Request("txtAdditionalInfo3")&lt;span style="background-color: yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;input&lt;/span&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="hidden"&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="txtAdditionalInfo4"&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value&lt;/span&gt;&lt;span style="color: blue;"&gt;="&lt;/span&gt;&lt;span style="background-color: yellow;"&gt;&amp;lt;%&lt;/span&gt;=Request("txtAdditionalInfo4")&lt;span style="background-color: yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;input&lt;/span&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="hidden"&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="txtAdditionalInfo5"&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value&lt;/span&gt;&lt;span style="color: blue;"&gt;="&lt;/span&gt;&lt;span style="background-color: yellow;"&gt;&amp;lt;%&lt;/span&gt;=Request("txtAdditionalInfo5")&lt;span style="background-color: yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;input&lt;/span&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="hidden"&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="txtAdditionalInfo6"&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value&lt;/span&gt;&lt;span style="color: blue;"&gt;="&lt;/span&gt;&lt;span style="background-color: yellow;"&gt;&amp;lt;%&lt;/span&gt;=Request("txtAdditionalInfo6")&lt;span style="background-color: yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;input&lt;/span&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="hidden"&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="txtAdditionalInfo7"&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value&lt;/span&gt;&lt;span style="color: blue;"&gt;="&lt;/span&gt;&lt;span style="background-color: yellow;"&gt;&amp;lt;%&lt;/span&gt;=Request("txtAdditionalInfo7")&lt;span style="background-color: yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;input&lt;/span&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="hidden"&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="RU"&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://www.mahindrahomestays.com/Pages/confirmation.aspx"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&lt;!--&lt;/span--&gt;&lt;span style="color: #a31515;"&gt;form&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue; margin-left: 0.5in;"&gt; &lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;!--&lt;/span--&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;body&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: blue;"&gt; &lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;!--&lt;/span--&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;;"&gt;html&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: black; font-family: Calibri; font-size: 15px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;  &lt;br /&gt;&lt;div class="NormalCalibri" style="margin-left: 0.5in; text-indent: 0.5in;"&gt; &lt;span lang="EN-GB" style="color: windowtext; font-family: Calibri; font-size: 11pt;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span lang="EN-GB" style="font-family: Verdana,sans-serif;"&gt;Once the Payment is done, the Bill Desk webiste posts the Response string to the Merchant website, in the form of a variable ie; “msg”.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span lang="EN-GB" style="font-family: Verdana,sans-serif;"&gt;The following sample code to be written to receive the response variable from the Billdesk website.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span class="Apple-style-span" style="font-family: Calibri; font-size: 15px;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span lang="EN-GB" style="font-family: Calibri;"&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Calibri;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;string&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; _paymentResp = Request.Form[&lt;span style="color: #a31515;"&gt;"msg"&lt;/span&gt;];&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span class="Apple-style-span" style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;[] arrResponse = _paymentResp.Split(&lt;span style="color: #a31515;"&gt;'|'&lt;/span&gt;); &lt;span style="color: green;"&gt;//PG&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt; &lt;span lang="EN-GB"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt; &lt;span class="Apple-style-span" style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; string&lt;/span&gt; merchantId = arrResponse[0];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; string&lt;/span&gt; _customerId = arrResponse[1];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; string&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; txnReferenceNo = arrResponse[2];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; bankReferenceNo = arrResponse[3];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; txnAmount = &lt;span style="color: #2b91af;"&gt;Convert&lt;/span&gt;.ToDecimal(arrResponse[4]);&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; bankId = arrResponse[5];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;string&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; bankMerchantId = arrResponse[6];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; txnType = arrResponse[7];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; currency = arrResponse[8];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; itemCode = arrResponse[9];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; securityType = arrResponse[10];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; securityId = arrResponse[11];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; securityPassword = arrResponse[12];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; txnDate = arrResponse[13]; &lt;span style="color: green;"&gt;//dd-mm-yyyy&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; authStatus = arrResponse[14];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; settlementType = arrResponse[15];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; additionalInfo1 = arrResponse[16];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;string&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; additionalInfo2 = arrResponse[17];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; additionalInfo3 = arrResponse[18];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; additionalInfo4 = arrResponse[19];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; additionalInfo5 = arrResponse[20];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;;"&gt;string&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; additionalInfo6 = arrResponse[21];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; additionalInfo7 = arrResponse[22];&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Calibri;"&gt; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; errorStatus = arrResponse[23];&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; _errorDescription = arrResponse[24];&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/814396016109370747-8795374758763880648?l=amitshinde14.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://amitshinde14.blogspot.com/2012/03/net-integration-with-bill-desk-payment.html</link><author>noreply@blogger.com (Amit Kumar Shinde)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-814396016109370747.post-8567212116422504289</guid><pubDate>Wed, 07 Mar 2012 03:10:00 +0000</pubDate><atom:updated>2012-03-06T19:10:22.472-08:00</atom:updated><title>Design Patterns In C# - Prototype Design Pattern</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;In my last entry we looked at the &lt;b&gt;Singleton&lt;/b&gt; design pattern, in which it allows on a single instance of a class to be created. In this entry we will look at another design pattern, the &lt;b&gt;Prototype&lt;/b&gt; design pattern.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;What is it:&lt;/b&gt;&lt;br /&gt;The Prototype design pattern is a pattern where new instances of a class are created by cloning an initial object. Reasons for using this design pattern are (but not limited to):&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Avoid the overhead of creating a new object using the [i]new[/il] keyword. This is helpful when there's a serious overhead of creating new objects.&lt;/li&gt;&lt;li&gt;Avoid subclasses&lt;/li&gt;&lt;li&gt;Use one isntance for the basis of future instances.&lt;/li&gt;&lt;/ul&gt;When we are not in a situation in which we can call an objects constructor directly, we could clone a pre-existing instance of the object (our prototype). Rather than creating more and more isntances of said object it's possible to save overhead by cloning an existing copy of your object.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Shallow &amp;amp; Deep Clone - Implement&lt;/b&gt;&lt;br /&gt;When working with this design method you must create a class using the &lt;a href="http://msdn.microsoft.com/en-us/library/sf985hc5.aspx" target="_blank"&gt;abstract modifier&lt;/a&gt;, meaning that it will be the only class your object will implement/inherit from. One thing to consider when using this design pattern is determining whether we want a deep clone or shallow clone. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Shallow clone:&lt;/b&gt; can be performed with using the &lt;a href="http://msdn.microsoft.com/en-us/library/system.object.memberwiseclone.aspx" target="_blank"&gt;Object.MemberWise Clone Method&lt;/a&gt;, which copies the nonstatic fields of the original object. With &lt;i&gt;reference types&lt;/i&gt; the reference is copied meaning the original and cloned object reference to the same instance, so if a value is changed in the original object the shallow cloned object with be updated. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Deep Clone:&lt;/b&gt; A deep clone copies both reference and value types, giving 2 distinct instances of an object, so if object A is modified the cloned object (object B) remains unchanged. While this may be preferred in some cases, remember that there is more overhead when performing a deep clone.&lt;br /&gt;&lt;br /&gt;For the purpose of this example we will give the option for either a deep or shallow clone of an object, but remember to make sure you know what kind of clone you need before performing the clone.&lt;br /&gt;&lt;br /&gt;For ease of use in this example I have created a small extension method to handle to deep clone functionality since there really isnt a built-in method in the .Net framework for performing a deep clone. This method will work for any object type as it doesnt expect a certain type (it expects something of type &lt;i&gt;T&lt;/i&gt;, which can be any serializable arbitrary type you wish). We will be cloning via Serialization, keep in mind there are several ways to deep clone an object, including Reflection and IL (Intermediate Language).&lt;br /&gt;&lt;br /&gt;&lt;b&gt;NOTE:&lt;/b&gt; With this method of cloning you need to add the &lt;a href="http://msdn.microsoft.com/en-us/library/system.serializableattribute.aspx" target="_blank"&gt;SerializableAttribute&lt;/a&gt; attribute to the object you want to clone with serialization.&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.IO;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Runtime.Serialization;&lt;br /&gt;using System.Runtime.Serialization.Formatters.Binary;&lt;br /&gt;&lt;br /&gt;namespace DZoneArticles.PrototypeDesignPattern&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static class DeepCloneExtension&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;br /&gt;&lt;summary&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// method to perform a deep clone of an arbitrary (unknown at the time of cloning) object&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;/summary&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;typeparam name="T"&gt;type of object being cloned&lt;/typeparam&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;param name="obj" /&gt;object instance being cloned&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;returns&gt;&lt;/returns&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static T DoDeepClone&lt;t&gt;(this T obj)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //make sure the object being passed is serializable, otherwise throw an&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //exception&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!obj.GetType().IsSerializable)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new ArgumentException("The object provided is not serializable. Please add the [Serializable()]&lt;br /&gt;&lt;br /&gt;attribute to your object", "obj");&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // check for a null object, if found the return the defaults&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // for the object&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (obj == null)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return default(T);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BinaryFormatter bf = new BinaryFormatter();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using (MemoryStream ms = new MemoryStream())&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bf.Serialize(ms, obj);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ms.Seek(0, SeekOrigin.Begin);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (T)bf.Deserialize(ms);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;b&gt;Implement Ptototype Design Pattern&lt;/b&gt;&lt;br /&gt;Now that this is out of the way let's go into the Prototype Design pattern. For this there will be three classes in play:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;EmployeePrototype:&lt;/b&gt; Declares an interface for cloning itself&lt;/li&gt;&lt;li&gt;&lt;b&gt;Employee:&lt;/b&gt; The actual class we'll be prototyping&lt;/li&gt;&lt;li&gt;&lt;b&gt;EmployeeManager:&lt;/b&gt; This class will manage the interaction between our class (&lt;b&gt;Employee&lt;/b&gt;), the prototype (&lt;b&gt;EmployeePrototype&lt;/b&gt;) and the client.&lt;/li&gt;&lt;/ul&gt;So let's construct a small sample application showing how the Prototype Design Process works. First we create &lt;b&gt;EmployeePrototype Class&lt;/b&gt;. This class will be marked as &lt;b&gt;abstract&lt;/b&gt;, meaning it will be the only class our &lt;b&gt;Employee&lt;/b&gt; class can inherit from. So here is our protypical class:&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;namespace DZoneArticles.PrototypeDesignPattern&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public abstract class EmployeePrototype&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public abstract EmployeePrototype Clone(bool deepClone);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;Now wasnt that simple, an abstract class with a single abstract method &lt;b&gt;Clone&lt;/b&gt;, it is in that method when we determine if a deep or shallow clone is being used (which is why we pass a bvoolean value to it). Our &lt;b&gt;EmployeeManager&lt;/b&gt; class will give us an &lt;a href="http://msdn.microsoft.com/en-us/library/6x16t2tx.aspx" target="_blank"&gt;indexer&lt;/a&gt; and allow us to access employees by a specified string index. Here's &lt;b&gt;EmployeeManager.cs&lt;/b&gt;:&lt;br /&gt;namespace DZoneArticles.PrototypeDesignPattern&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class EmployeeManager&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Dictionary&lt;string, employeeprototype=""&gt; _employees = new Dictionary&lt;string, employeeprototype=""&gt;();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public EmployeePrototype this[string idx]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return _employees[idx]; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set { _employees.Add(idx, value); }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;Now for our final class in the prototype pattern. This will be our actual employee class. Since we're going with a simple example the class will have 2 properties: First Name &amp;amp; Last Name. It will also have the abstract method &lt;b&gt;Clone&lt;/b&gt; from &lt;b&gt;EmployeePrototype&lt;/b&gt;, and will determine, by the value passed to it, whether we're doing a deep or shallow clone:&lt;/string,&gt;&lt;/string,&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.IO;&lt;br /&gt;&lt;br /&gt;namespace DZoneArticles.PrototypeDesignPattern&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Serializable()]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class Employee : EmployeePrototype&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private string _firstName;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private string _lastName;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string FirstName&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return _firstName; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set { _firstName = value; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string LastName&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return _lastName; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set { _lastName = value; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Employee(string fName, string lName)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this._firstName = fName;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this._lastName = lName;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override EmployeePrototype Clone(bool deepClone)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; switch (deepClone)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case true:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return this.DoDeepClone() as EmployeePrototype;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case false:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return this.MemberwiseClone() as EmployeePrototype;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; default:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return this.MemberwiseClone() as EmployeePrototype;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;So we have our prototype design pattern set up, let's see how it works when we put it into action:&lt;br /&gt;static void Main(string[] args)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EmployeeManager employee = new EmployeeManager();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; employee["John"] = new Employee("John", "Smith");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; employee["Bill"] = new Employee("Bill", "Jones");&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //now let's clone 'John Smith'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Employee employee1 = employee["John"].Clone(true) as Employee;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.ReadKey();&lt;br /&gt;}&lt;br /&gt;So we created 2 new employees via the &lt;b&gt;EmployeeManager&lt;/b&gt; class. With the constructor we set it's values (first name &amp;amp; last name). We then created a new employee object by cloning the first employee we created. Now we can modify this new employee and not have it affect the original copy since we did a deep clone. Had we went with the shallow clone if we modified the cloned emp,oyee it would have also updated the original employee we created.&lt;br /&gt;&lt;br /&gt;So that's how the Prototype Design Pattern works and how you can implement it in C#. While this is a real simple example it definitely can be put into action with more complex objects and situations. Thanks for reading and happy coding :) &lt;br /&gt;&lt;/t&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/814396016109370747-8567212116422504289?l=amitshinde14.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://amitshinde14.blogspot.com/2012/03/design-patterns-in-c-prototype-design.html</link><author>noreply@blogger.com (Amit Kumar Shinde)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-814396016109370747.post-851763578503331856</guid><pubDate>Tue, 06 Mar 2012 11:22:00 +0000</pubDate><atom:updated>2012-03-06T03:22:01.244-08:00</atom:updated><title>SQL SERVER – 2008 – Step By Step Installation Guide With Images</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;               &lt;br /&gt;&lt;div class="postnav"&gt;     &lt;div class="alignleft"&gt;« &lt;a href="http://blog.sqlauthority.com/2008/06/11/sql-server-2008-four-key-pillars/" rel="prev"&gt;SQL SERVER – 2008 – Four Key&amp;nbsp;Pillars&lt;/a&gt;&lt;/div&gt;&lt;div class="alignright"&gt;&lt;a href="http://blog.sqlauthority.com/2008/06/13/sql-server-2008-introduction-to-policy-management-enforcing-rules-on-sql-server/" rel="next"&gt;SQL SERVER – 2008 – Introduction to Policy Management – Enforcing Rules on SQL&amp;nbsp;Server&lt;/a&gt; »&lt;/div&gt;&lt;/div&gt;&lt;div class="posttitle"&gt;      &lt;h2&gt;SQL SERVER – 2008 – Step By Step Installation Guide With&amp;nbsp;Images&lt;/h2&gt;&lt;div class="post-info"&gt;June 12, 2008 by &lt;a href="http://blog.sqlauthority.com/author/pinaldave/" title="Posts by pinaldave"&gt;pinaldave&lt;/a&gt;  &lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;SQL SERVER 2008 Release Candidate 0  has been released for some time and I have got numorous request about  how to install SQL Server 2008. I have created this step by step guide  Installation Guide. Images are used to explain the process easier.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;strong&gt;[Click On Images to See Larger Image]&lt;/strong&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/20081.jpg" target="_blank"&gt;&lt;img alt="" height="471" src="http://www.pinaldave.com/bimg/2008small/20081.jpg" width="500" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/20082.jpg" target="_blank"&gt;&lt;img alt="" height="600" src="http://www.pinaldave.com/bimg/2008small/20082.jpg" width="445" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/20083.jpg" target="_blank"&gt;&lt;img alt="" height="375" src="http://www.pinaldave.com/bimg/2008small/20083.jpg" width="500" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/20084.jpg" target="_blank"&gt;&lt;img alt="" height="375" src="http://www.pinaldave.com/bimg/2008small/20084.jpg" width="500" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/20085.jpg" target="_blank"&gt;&lt;img alt="" height="349" src="http://www.pinaldave.com/bimg/2008small/20085.jpg" width="500" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/20086.jpg" target="_blank"&gt;&lt;img alt="" height="375" src="http://www.pinaldave.com/bimg/2008small/20086.jpg" width="500" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/20087.jpg" target="_blank"&gt;&lt;img alt="" height="375" src="http://www.pinaldave.com/bimg/2008small/20087.jpg" width="500" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/20088.jpg" target="_blank"&gt;&lt;img alt="" height="375" src="http://www.pinaldave.com/bimg/2008small/20088.jpg" width="500" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/20089.jpg" target="_blank"&gt;&lt;img alt="" height="375" src="http://www.pinaldave.com/bimg/2008small/20089.jpg" width="500" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/200810.jpg" target="_blank"&gt;&lt;img alt="" height="375" src="http://www.pinaldave.com/bimg/2008small/200810.jpg" width="500" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/200811.jpg" target="_blank"&gt;&lt;img alt="" height="375" src="http://www.pinaldave.com/bimg/2008small/200811.jpg" width="500" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/200812.jpg" target="_blank"&gt;&lt;img alt="" height="375" src="http://www.pinaldave.com/bimg/2008small/200812.jpg" width="500" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/200813.jpg" target="_blank"&gt;&lt;img alt="" height="375" src="http://www.pinaldave.com/bimg/2008small/200813.jpg" width="500" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/200814.jpg" target="_blank"&gt;&lt;img alt="" height="414" src="http://www.pinaldave.com/bimg/2008small/200814.jpg" width="500" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/200815.jpg" target="_blank"&gt;&lt;img alt="" height="414" src="http://www.pinaldave.com/bimg/2008small/200815.jpg" width="500" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/200816.jpg" target="_blank"&gt;&lt;img alt="" height="414" src="http://www.pinaldave.com/bimg/2008small/200816.jpg" width="500" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/200817.jpg" target="_blank"&gt;&lt;img alt="" height="414" src="http://www.pinaldave.com/bimg/2008small/200817.jpg" width="500" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/200818.jpg" target="_blank"&gt;&lt;img alt="" height="414" src="http://www.pinaldave.com/bimg/2008small/200818.jpg" width="500" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/200819.jpg" target="_blank"&gt;&lt;img alt="" height="414" src="http://www.pinaldave.com/bimg/2008small/200819.jpg" width="500" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/200820.jpg" target="_blank"&gt;&lt;img alt="" height="414" src="http://www.pinaldave.com/bimg/2008small/200820.jpg" width="500" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/200821.jpg" target="_blank"&gt;&lt;img alt="" height="414" src="http://www.pinaldave.com/bimg/2008small/200821.jpg" width="500" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/200822.jpg" target="_blank"&gt;&lt;img alt="" height="414" src="http://www.pinaldave.com/bimg/2008small/200822.jpg" width="500" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/200823.jpg" target="_blank"&gt;&lt;img alt="" height="414" src="http://www.pinaldave.com/bimg/2008small/200823.jpg" width="500" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/200824.jpg" target="_blank"&gt;&lt;img alt="" height="414" src="http://www.pinaldave.com/bimg/2008small/200824.jpg" width="500" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/200825.jpg" target="_blank"&gt;&lt;img alt="" height="383" src="http://www.pinaldave.com/bimg/2008small/200825.jpg" width="500" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/200826.jpg" target="_blank"&gt;&lt;img /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/200827.jpg" target="_blank"&gt;&lt;img alt="" height="358" src="http://www.pinaldave.com/bimg/2008small/200827.jpg" width="500" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.pinaldave.com/bimg/2008/200828.jpg"&gt;&lt;img alt="" src="http://www.pinaldave.com/bimg/2008small/200828.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/814396016109370747-851763578503331856?l=amitshinde14.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://amitshinde14.blogspot.com/2012/03/sql-server-2008-step-by-step.html</link><author>noreply@blogger.com (Amit Kumar Shinde)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-814396016109370747.post-5724508139717705393</guid><pubDate>Tue, 06 Mar 2012 11:14:00 +0000</pubDate><atom:updated>2012-03-06T03:14:40.959-08:00</atom:updated><title>Patterns in Real Life</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div id="contentdiv"&gt;            &lt;h2&gt;Introduction&lt;/h2&gt;In object oriented design (OO), we give clear responsibility to each  object. An object is like a black box which can receive and send  messages. All objects together form the complete system. Design patterns  by Gang of Four introduced many general reusable solutions to commonly  occurring problems in software design. I always correlate interactions  between objects to real life interactions involving people and or real  things. If you look around, you can see many real life examples for  patterns, but played out with people instead of real objects. In this  article, I will try to explain a few of these real life examples of  design patterns for you.&lt;br /&gt;&lt;h2&gt;&lt;a href=""&gt;Who can read this article?&lt;/a&gt;&lt;/h2&gt;Any one who can read English, of course, can read this article, but  the targeted audience is people with some years of software experience.  You need not know any special programming language, but you must know  one object oriented language. Also, you are expected to be familiar with  design patterns and the terminologies used in design patterns.&lt;br /&gt;&lt;h2&gt;&lt;a href=""&gt;Composite pattern&lt;/a&gt;&lt;/h2&gt;In Composite pattern, you don’t differentiate between a leaf and a  composite. The client treats a leaf or a composite the same way. You can  correlate this pattern with an organization. An organization consists  of many departments. Each department consists of many projects. Each  project consists of many project members. A typical organization  structure is as shown below.&lt;br /&gt;&lt;img alt="organization.gif" height="336" src="http://www.codeproject.com/KB/architecture/patterns_in_real_life/organization.gif" width="516" /&gt;&lt;br /&gt;&lt;h3&gt;&lt;a href=""&gt;Recursion&lt;/a&gt;&lt;/h3&gt;What makes the Composite pattern one of the most beautiful is the  power of recursion. I can explain this with the same organization  example. You want to find the total salary paid to all employees of the  organization. It is nothing but the salary of CEO + the salary paid to  all the departments. What is the salary of a department? It is the  salary of the department head + the salary of all projects. What is the  total salary of a project? It is the salary of the project manager + the  salary of all the project members. In a nutshell, the salary of  anything is the salary of self + the salary of all its sub groups.&lt;br /&gt;A typical example for this in the software scenario is an XML DOM  (Document Object Model) structure. A simple XML structure is shown  below.&lt;br /&gt;&lt;img alt="xml.gif" height="339" src="http://www.codeproject.com/KB/architecture/patterns_in_real_life/xml.gif" width="586" /&gt;&lt;br /&gt;As you can see here, “&lt;code&gt;employees&lt;/code&gt;” is a node. “&lt;code&gt;employee&lt;/code&gt;” is another node which is a child of &lt;code&gt;employees&lt;/code&gt;. What about &lt;code&gt;name&lt;/code&gt; in &lt;code&gt;employee&lt;/code&gt;?  That is also a node. It is nothing but a collection of node objects.  Each node can have n-number of child-nodes. If I draw a class diagram of  the same, it will be like shown below.&lt;br /&gt;&lt;img alt="composite_class.gif" height="216" src="http://www.codeproject.com/KB/architecture/patterns_in_real_life/composite_class.gif" width="396" /&gt;&lt;br /&gt;If I create an object structure for the same in a system, based on  the XML file input, you will have a structure which is as simple as a  single object to a complex structure involving any number of objects. A  typical structure is shown below:&lt;br /&gt;&lt;img alt="composite_object.gif" height="472" src="http://www.codeproject.com/KB/architecture/patterns_in_real_life/composite_object.gif" width="600" /&gt;&lt;br /&gt;To describe the advantages of the Composite pattern, I would like to  take a simple organization structure as shown below. If you want to find  the total number of employees in the organization, it is the sum of the  root node + all its children. The calculation goes recursively, as  shown below:&lt;br /&gt;&lt;img alt="recursion.gif" height="312" src="http://www.codeproject.com/KB/architecture/patterns_in_real_life/recursion.gif" width="516" /&gt;&lt;br /&gt;Another typical example of the power of recursion is GUI toolkits.  For example, Java SWT (Standard Widget Toolkit). If you want to apply a  theme for a dialog, you need to apply the theme for the dialog + all its  child components. A child can be a composite or a widget itself. If it  is a widget, there is no child for that, and the theme needs to be  applied only for the widget. But if it is a composite, we need to apply  the theme for all its children. Now again, a child can be a widget or a  composite. The loop continues until it covers all child widgets.&lt;br /&gt;Another example I can think of is the destruction of objects in C++.  Take any OO language without a garbage collector. Just imagine you have a  data structure like shown below. Each object has a reference only to  his children and the client is aware of only the root node object. How  will you destroy all the objects, leaving no memory leak? It is only a  couple of lines of code that takes to destroy the complete code.&lt;br /&gt;&lt;img alt="tree.gif" height="383" src="http://www.codeproject.com/KB/architecture/patterns_in_real_life/tree.gif" width="600" /&gt;&lt;br /&gt;Kill a node = Kill all its children and then kill yourself.&lt;br /&gt;Since the children are also of type node, the loop continues till it goes to the lowest level where there are no children.&lt;br /&gt;&lt;h2&gt;&lt;a href=""&gt;Observer pattern&lt;/a&gt;&lt;/h2&gt;A typical example for the Observer pattern is the conventional mail  delivery system. Whenever you have a mail, the postman will come and  knock at your door with the mail. Just imagine if you have to go to the  post office every day and check whether there are any mails. It would  have been a really inefficient system as each individual needs to go to  the post office periodically. This is eliminated in real life by  introducing a mail delivery mechanism.&lt;br /&gt;&lt;img alt="mailman.gif" height="532" src="http://www.codeproject.com/KB/architecture/patterns_in_real_life/mailman.gif" width="527" /&gt;&lt;br /&gt;It is the same in a GUI system as shown below. Your business logic,  in this case, the cassette player, will update all the GUI components  periodically, just like a post man who comes to your house with mail. It  would have been inefficient for the total system to implement a  periodic check by each widget to get the progress.&lt;br /&gt;&lt;img alt="standard_ui.gif" height="306" src="http://www.codeproject.com/KB/architecture/patterns_in_real_life/standard_ui.gif" width="516" /&gt;&lt;br /&gt;There are two typical models for Observer based on the way data is  passed. It can be a push model or a pull model. In the push model, data  is pushed along with the notification. An example for this is mail  delivery, magazine subscriptions etc. In the pull model, the client will  be notified about what is happening. But, it is always the  responsibility of the client to check whether the relevant data is there  or not. An example for this is RSS feeds. Whenever there is a change in  the website, and if you have subscribed for the feed, you will get a  notification. But, it is up to you to go back and see if you are  interested.&lt;br /&gt;&lt;h2&gt;&lt;a href=""&gt;Factory Pattern and Abstract Factory pattern&lt;/a&gt;&lt;/h2&gt;Imagine you are constructing a house and you approach a carpenter for  a door. You give the measurement for the door and your requirements,  and he will construct a door for you. In this case, the carpenter is a  factory of doors. Your specifications are inputs for the factory, and  the door is the output or product from the factory.&lt;br /&gt;Now, consider the same example of the door. You can go to a  carpenter, or you can go to a plastic door shop or a PVC shop. All of  them are door factories. Based on the situation, you decide what kind of  factory you need to approach. This is like an Abstract Factory.&lt;br /&gt;&lt;img alt="factory.gif" height="440" src="http://www.codeproject.com/KB/architecture/patterns_in_real_life/factory.gif" width="440" /&gt;&lt;br /&gt;&lt;h2&gt;&lt;a href=""&gt;Adapter&lt;/a&gt;&lt;/h2&gt;I think this is a self explanatory pattern. You can find many real  life examples for this pattern, and the simplest, which is called by the  same name, is a power adapter. You have an AC power supply and the  responsibility of the adapter is to provide different types of sockets  adapted to the one needed.&lt;br /&gt;&lt;img alt="adapter.gif" height="444" src="http://www.codeproject.com/KB/architecture/patterns_in_real_life/adapter.gif" width="600" /&gt;&lt;br /&gt;Another example for this is a translator who is translating languages spoken by one person for another person.&lt;br /&gt;&lt;h2&gt;&lt;a href=""&gt;Façade&lt;/a&gt;&lt;/h2&gt;Imagine you want to organize a marriage reception. You need to  decorate the hall where the event is planned. You need a music band to  play some music. You want to organize dinner for say 100 people, and  also snack in the evening for around 50 people. If you wanted to  organize such an event some 10 years back, you wanted to go to a caterer  for food, a musical troop for music, and organize flowers and people to  decorate them, and so and so. Some twenty years back, we needed to go  to the fish market, the meat shop, the vegetable market etc., for the  raw materials for the food and then organize a cook so that you have  everything ready for the event. Now, life is really simpler with event  managers. You just need to walk to an event manager and tell him that  you need a hall decorated with flowers, dinner for 100 people, snacks  for 50 people, and need a good music troop to play music while the  reception is going on. You don’t need to worry about anything, and they  will take care of the rest. This is a typical example for Façade. You  don’t need to interact with many different objects for each and every  activity. You will be provided a single interface which will act as a  façade for many activities. This makes the life of clients much simpler.&lt;br /&gt;Other examples for Façade are one stop bill payment shops, a support  desk in a big organization which takes all kinds of support requests  etc.&lt;br /&gt;&lt;h2&gt;&lt;a href=""&gt;Decorator&lt;/a&gt;&lt;/h2&gt;A decorator decorates something. An example for Decorator is a  sunglass. It takes light as input, removes all harmful parts in the  light, and passes it on. If you give apple as an input to a system, and  if it gives orange as output, that is &lt;strong&gt;not&lt;/strong&gt; a Decorator. Another example for this is music filtering.&lt;br /&gt;A software example for Decorator is JAVA I/O. Initially, I wondered  why we need to create so many objects just to do a file operation. I  realized how flexible and wonderful it is after some time.&lt;br /&gt;&lt;h2&gt;&lt;a href=""&gt;Template&lt;/a&gt;&lt;/h2&gt;A typical example for the Template pattern is the Computer  Engineering degree curriculum. It covers all the basic stuff required  for a typical software engineer. He can’t work as it is in an industry  as he needs to fill in many gaps which are required in the specific  domain. But, he will have the necessary knowledge to move to any  software company after completion of the course.&lt;br /&gt;&lt;h2&gt;&lt;a href=""&gt;Reactor&lt;/a&gt;&lt;/h2&gt;Recently, I went to a restaurant in Bangalore. There was a female  standing outside, receiving all the people entering the restaurant. She  received us with a pleasant smile, then took us inside, and helped us  find a table. She assigned a waiter to serve us, and then went back to  the reception and waited for new clients. All she did was receive a new  visitor. She is just like a web server serving multiple clients. In a  typical web server, there is a thread simply waiting for requests from  clients. Whenever there is a client request, it creates a separate  thread and assigns that thread to handle the request. The thread will  die down after serving the requests.&lt;br /&gt;&lt;h2&gt;&lt;a href=""&gt;Conclusion&lt;/a&gt;&lt;/h2&gt;You can find many more examples like this in our day to day life for  real life design patterns. If we correlate these, we will appreciate the  patterns better. Most of these real life patterns were evolved over a  long period of time by brilliant people to have efficient systems in the  society. If we follow this in software systems, we can create efficient  software systems just like other efficient systems around you.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/814396016109370747-5724508139717705393?l=amitshinde14.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://amitshinde14.blogspot.com/2012/03/patterns-in-real-life.html</link><author>noreply@blogger.com (Amit Kumar Shinde)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-814396016109370747.post-8108485317187306905</guid><pubDate>Tue, 06 Mar 2012 08:32:00 +0000</pubDate><atom:updated>2012-03-06T00:32:25.460-08:00</atom:updated><title>Abstract Factory Design Pattern</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;span id="ContentPlaceHolder1_lblDescription"&gt;&lt;span itemprop="articleBody"&gt;An  abstract factory provides an interface for creating families of related  objects without specifying their concrete classes. Sometimes one wants  to construct an instance of one of a suite of classes, deciding between  the classes at the time of instantiation. In order to avoid duplicating  the decision making everywhere an instance is created, we need a  mechanism for creating instances of related classes without necessarily  knowing which will be instantiated. Abstract Factory is an abstract  class defining a common protocol of Factory methods. Concrete subclasses  of the abstract factory implement this protocol to answer instances of  the appropriate suite of classes. This is useful when there is a need to  have multiple families of products. The system shall be configured with  one of multiple families of products.&lt;br /&gt;&lt;br /&gt;Here is an example.  Suppose there is a computer factory which needs to create CPU and Memory  as products. An interface ComputerFactory is defined which defines the  abstract methods for creating abstract CPU and Memory. A concrete  computer factory is defined by the class ComputerFactoryA which creates  the suit of products belonging to the ‘A’ series i.e. CPUA and MemoryA.  Note that CPUA and MemoryA implement the respective interfaces CPU and  Memory which represents the abstract products. There is a test class  called Client which defines a static method to create the suit of  products. Note that this method is a like a template which is  independent of the particular suit of products. We just need to pass the  object of a concrete factory of our interest and it will create the  related products.&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;//The Abstract ComputerFactory to create an Abstract CPU and Memory&lt;br /&gt;public interface ComputerFactory&lt;br /&gt;{&lt;br /&gt;    CPU createCPU();&lt;br /&gt;    Memory createMemory();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//Abstract CPU&lt;br /&gt;public interface CPU&lt;br /&gt;{&lt;br /&gt;    string GetCPU();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//Abstract Memory&lt;br /&gt;public interface Memory&lt;br /&gt;{&lt;br /&gt;    string GetMemory();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//Concrete ComputerFactoryA tp create CPUA and MemoryA&lt;br /&gt;public class ComputerFactoryA : ComputerFactory&lt;br /&gt;{&lt;br /&gt;    public CPU createCPU() { return new CPUA(); }&lt;br /&gt;    public Memory createMemory() { return new MemoryA(); }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//Concrete CPUA&lt;br /&gt;public class CPUA : CPU&lt;br /&gt;{&lt;br /&gt;    public string GetCPU() { return "CPUA"; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//Concrete MemoryA&lt;br /&gt;public class MemoryA : Memory&lt;br /&gt;{&lt;br /&gt;    public string GetMemory() { return "MemoryA"; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//client class&lt;br /&gt;using System;&lt;br /&gt;public class Client&lt;br /&gt;{&lt;br /&gt;    //this is a template method; does not depend on the Concrete Factory &lt;br /&gt;    //and the Concrete classes&lt;br /&gt;    public static void BuildComputer(ComputerFactory factory)&lt;br /&gt;    {&lt;br /&gt;        CPU cpu = factory.createCPU();&lt;br /&gt;        Memory memory = factory.createMemory();&lt;br /&gt;        Console.WriteLine("CPU:{0}", cpu.GetCPU());&lt;br /&gt;        Console.WriteLine("Memory:{0}", memory.GetMemory());&lt;br /&gt;    }    &lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;This how the test code would look like:&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;Client.BuildComputer(new ComputerFactoryA());&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/814396016109370747-8108485317187306905?l=amitshinde14.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://amitshinde14.blogspot.com/2012/03/abstract-factory-design-pattern.html</link><author>noreply@blogger.com (Amit Kumar Shinde)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-814396016109370747.post-1471834550725382004</guid><pubDate>Tue, 06 Mar 2012 05:51:00 +0000</pubDate><atom:updated>2012-03-05T21:51:04.363-08:00</atom:updated><title>What does  'N' Stands for in MS sql Queries</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;em style="font-size: 14pt;"&gt;Unicode strings&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Unicode strings have a format similar to character strings but are  preceded by an N identifier (N stands for National Language in the  SQL-92 standard).&lt;br /&gt;&lt;br /&gt;The N prefix must be uppercase. For example, 'Michél'  is a character constant while N'Michél' is a Unicode constant.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;Unicode  constants are interpreted as Unicode data, and are not evaluated using a  code page. Unicode constants do have a collation, which primarily  controls comparisons and case sensitivity. Unicode constants are  assigned the default collation of the current database, unless the  COLLATE clause is used to specify a collation. Unicode data is stored  using two bytes per character, as opposed to one byte per character for  character data. For more information, see Using Unicode Data. &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/814396016109370747-1471834550725382004?l=amitshinde14.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://amitshinde14.blogspot.com/2012/03/what-does-n-stands-for-in-ms-sql.html</link><author>noreply@blogger.com (Amit Kumar Shinde)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-814396016109370747.post-8328737632676668874</guid><pubDate>Sat, 03 Mar 2012 10:47:00 +0000</pubDate><atom:updated>2012-03-03T02:47:46.789-08:00</atom:updated><title>The Observer Design Pattern</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I will attempt to explain what is one of the most widely used Design Patterns: Observer Pattern.&lt;br /&gt;&lt;br /&gt;Problem domain: Implementing the Publisher/Subscriber scenario. We need a mechanism which allows us to notify subscriber objects whenever the publisher object changes state.&lt;br /&gt;&lt;br /&gt;There is one publisher or subject class and one or more subscriber or observer classes.&lt;br /&gt;Illustration&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Explanation&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In order for observers to receive a notification, they must implement some kind of update method which the subject can call whenever it changes state. The observers must have the freedom to register and un-register from subscription to the subject at any point in time.&lt;br /&gt;&lt;br /&gt;The subject contains the stuff. So, whenever the stuff changes, observers need to be notified.&lt;br /&gt;&lt;br /&gt;Here, the Observer Pattern comes to the rescue.&lt;br /&gt;&lt;b&gt;Implementation&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;We need to create two Interfaces: Subject and Observer. The interface for the subject contains the register, unregister, and notify method signatures, as follows:&lt;br /&gt;&lt;br /&gt;public interface Subject&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; public void register(Observer o);&lt;br /&gt;&amp;nbsp; public void unregister(Observer o);&lt;br /&gt;&amp;nbsp; public void notify();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The interface for the observer contains an update method signature:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;public interface Observer&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void update(int value);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Now, let us assume that we are building a sample stock market gadget app. Here, the subject is the one which has the 'stuff', i.e., the stock market quotes. The observers are different classes which display the latest stock quotes to the user.&lt;br /&gt;&lt;br /&gt;Let us have classes representing the subject/observer relationship: the StockMarket class being the subject, and we have three different observer classes: GoogleStockGadget, YahooStockGadget, and MSNStockGadget.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The StockMarket class must implement the Subject interface:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;public class StockMarket : Subject&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; // A Collection to keep track of all Registered Observers&lt;br /&gt;&amp;nbsp; ArrayList observers = new ArrayList();&lt;br /&gt;&lt;br /&gt;&amp;nbsp; // Stores latest stock quote (example is purposely simplistic)&lt;br /&gt;&amp;nbsp; int newValue = 0;&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; public void setValue(int v)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newValue = v;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; public void register(Observer o)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; observers.add(o);&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp; public void unregister(Observer o)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; int i = observers.indexOf(o);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; observers.remove(i);&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp; public void notify()&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i=0;i &amp;lt; observers.size();i++)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Observer ob = (Observer)observers.get(i);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ob.update(newValue);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;The observers: GoogleStockGadget, YahooStockGadget, and MSNStockGadget, must implement the Observer interface.&lt;br /&gt;&lt;br /&gt;Note that the observer classes must maintain a reference variable of type Subject.&lt;br /&gt;&lt;br /&gt;public class GoogleStockGadet : Observer&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; int latestValue = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp; Subject stockMarket; // Subject reference variable&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; // Note how subject is passed in the constructor of Observer&lt;br /&gt;&amp;nbsp;&amp;nbsp; public GoogleStockGadet(Subject subject)&lt;br /&gt;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; stockMarket = subject;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; stockMarket.register(this); // Registering itself to the Subject&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; public void update(int value)&lt;br /&gt;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; latestValue = value;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; display();&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; public void display()&lt;br /&gt;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println("Latest Quote=" + latestValue);&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; public void unsubscribe()&lt;br /&gt;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stockMarket.unregister(this);&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Similarly, YahooStockGadget and MSNStockGadget implement the observer interface.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Now, let's see how we make it all work in the main program.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;public class MainProgram&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; public static void Main(string[] args)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Initialize Subject&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; StockMarket stockMarket =&amp;nbsp; new StockMarket();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; int latestQuote = 0;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Initialize Gadgets..Note the subject being passed in Constructor&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GoogleStockGadget googleGadget = new GoogleStockGadget(stockMarket);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MSNStockGadget msnGadget =&amp;nbsp; new MSNStockGadget(stockMarket);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; YahooStockGadget yahooGadget = new YahooStockGadget(stockMarket);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Code for Getting latest stock &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // ....&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // ....&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; stockMarket.setValue(latestQuote);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Updating all Registered Observers&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; stockMarket.notify();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //GoogleGadget decides to unregister/unsubscirbe&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; googleGadget.unsubscribe();&lt;br /&gt;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;With that, I end my article. Remember, the Observer Design Pattern solves the common problem of notifying several objects (i.e., Observers) about changes in the state of one principle object (or the Subject).&lt;br /&gt;&lt;br /&gt;This, being my first article, might not be perfect, but hopefully, it has helped you in better understanding the concepts of the Observer Design Pattern.&lt;br /&gt;&lt;br /&gt;Happy coding!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/814396016109370747-8328737632676668874?l=amitshinde14.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://amitshinde14.blogspot.com/2012/03/observer-design-pattern.html</link><author>noreply@blogger.com (Amit Kumar Shinde)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-814396016109370747.post-6598932174472182811</guid><pubDate>Sat, 03 Mar 2012 09:26:00 +0000</pubDate><atom:updated>2012-03-03T01:26:03.218-08:00</atom:updated><title>Design Pattern Implementation using C#</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Introduction&lt;br /&gt;&lt;br /&gt;Design patterns may be said as a set of probable solutions for a particular problem which is tested to work best in certain situations. In other words, Design patterns, say you have found a problem. Certainly, with the evolution of software industry, most of the others might have faced the same problem once. Design pattern shows you the best possible way to solve the recurring problem.&lt;br /&gt;&lt;br /&gt;Uses of Design Patterns&lt;br /&gt;&lt;br /&gt;While creating an application, we think a lot on how the software will behave in the long run. It is very hard to predict how the architecture will work for the application when the actual application is implemented completely. There might issues which you cant predict and may come while implementing the software. Design patterns helps you to find tested proven design paradigm to build a solid foundation for your project. So, if you follow design pattern you can easily prevent major issues to come while building your actual project. Moreover design pattern also helps the other architects to understand your code easily.&lt;br /&gt;&lt;br /&gt;History of Design Patterns&lt;br /&gt;&lt;br /&gt;When the word design pattern comes into mind, the first thing that one may think is the classical book on Design Pattern "Gangs of Four" which was published by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides.&amp;nbsp; In this book, it is first discussed capabilities and pitfalls of Object oriented programming, and later on it discusses about the classic Design Patterns on OOPS.&lt;br /&gt;&lt;br /&gt;You can read more about history of design patterns from here.&lt;br /&gt;&lt;br /&gt;Types of Design Pattern&lt;br /&gt;&lt;br /&gt;Design patterns can be divided into 3 categories.&lt;br /&gt;&lt;br /&gt;Creational Patterns : These patterns deals mainly with creation of objects and classes. &lt;br /&gt;Structural Patterns : These patterns deals with Class and Object Composition. &lt;br /&gt;Behavioural Patterns : These mainly deals with Class - Object communication. That means they are concerned with the communication between class and objects. &lt;br /&gt;&lt;br /&gt;In this article, I am going to discuss few examples of these patterns. They are&lt;br /&gt;Singleton Design Pattern &lt;br /&gt;Factory Design Pattern &lt;br /&gt;Factory Method Design Pattern &lt;br /&gt;Abstract Factory Design Pattern, &lt;br /&gt;Builder Design Pattern, &lt;br /&gt;Prototype Design Pattern &lt;br /&gt;Adapter Design Pattern &lt;br /&gt;Bridge Design Pattern &lt;br /&gt;Decorator Design Pattern &lt;br /&gt;Composite Design Pattern &lt;br /&gt;Flyweight Design Pattern &lt;br /&gt;Memento Design Pattern &lt;br /&gt;Mediator Design Pattern &lt;br /&gt;Observer Design Pattern &lt;br /&gt;Iterator Pattern&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/814396016109370747-6598932174472182811?l=amitshinde14.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://amitshinde14.blogspot.com/2012/03/design-pattern-implementation-using-c.html</link><author>noreply@blogger.com (Amit Kumar Shinde)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-814396016109370747.post-9212767816802134056</guid><pubDate>Fri, 02 Mar 2012 04:00:00 +0000</pubDate><atom:updated>2012-03-01T20:00:45.236-08:00</atom:updated><title>Enabling Dynamic HTTP Compression in IIS7 on Windows Server 2008</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I’m not very familiar with the newer configuration screens in Windows  Server 2008 so I pulled my hair out trying to update some settings.  Apparently it’s just too obvious for Google to have been any help so I’m  documenting it here for the next shmuck.&lt;br /&gt;I wanted to enable dynamic http compression. I found the page to &lt;i&gt;enable&lt;/i&gt; it but it wasn’t &lt;i&gt;installed&lt;/i&gt;:&lt;br /&gt;&lt;blockquote&gt;“The dynamic content compression module is not installed.” (but we won’t tell you how to install it)&lt;/blockquote&gt;It turns out that installing it is very easy and didn’t require a reboot (for me, at least):&lt;br /&gt;&lt;b&gt;Text only&lt;/b&gt;&lt;br /&gt;Install it:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Open server manager&lt;/li&gt;&lt;li&gt;Roles &amp;gt; Web Server (IIS)&lt;/li&gt;&lt;li&gt;Role Services (scroll down) &amp;gt; Add Role Services&lt;/li&gt;&lt;li&gt;Add desired role (Web Server &amp;gt; Performance &amp;gt; Dynamic Content Compression)&lt;/li&gt;&lt;li&gt;Next, Install, Wait…Done!&lt;/li&gt;&lt;/ol&gt;Enable it:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Open server manager&lt;/li&gt;&lt;li&gt;Roles &amp;gt; Web Server (IIS) &amp;gt; Internet Information Services (IIS) Manager&lt;/li&gt;&lt;li&gt;Next pane: Sites &amp;gt; Default Web Site &amp;gt; Your Web Site&lt;/li&gt;&lt;li&gt;Main pane: IIS &amp;gt; Compression&lt;/li&gt;&lt;/ol&gt;&lt;b&gt;With perdy pictures&lt;/b&gt;&lt;br /&gt;Install it:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Open server manager     &lt;br /&gt;&lt;a href="http://lh3.ggpht.com/_IKD9WtY5kxU/SoVu9t5XwII/AAAAAAAAAe8/ET0YIX9YDeU/0%20start%20server%20manager%5B2%5D.png?imgmax=800"&gt;&lt;img alt="0 start server manager" border="0" height="51" src="http://lh3.ggpht.com/_IKD9WtY5kxU/SoVwI9YuQcI/AAAAAAAAAfA/nxgLdFWMoko/0%20start%20server%20manager_thumb.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;" title="0 start server manager" width="212" /&gt;&lt;/a&gt;      &lt;/li&gt;&lt;li&gt;Roles &amp;gt; Web Server (IIS)&lt;/li&gt;&lt;li&gt;Role Services (scroll down) &amp;gt; Add Role Services     &lt;br /&gt;&lt;a href="http://lh4.ggpht.com/_IKD9WtY5kxU/SoVwKZ4BftI/AAAAAAAAAfE/rBQz1crywsY/s1600-h/SNAG-0000%5B10%5D.png"&gt;&lt;img alt="SNAG-0000" border="0" height="242" src="http://lh6.ggpht.com/_IKD9WtY5kxU/SoVwLJKojoI/AAAAAAAAAfI/p05kFyp462U/SNAG-0000_thumb%5B6%5D.png?imgmax=800" style="border-color: -moz-use-text-color; border-style: none; border-width: 0px; display: inline;" title="SNAG-0000" width="400" /&gt;&lt;/a&gt;      &lt;/li&gt;&lt;li&gt;Add desired role (Web Server &amp;gt; Performance &amp;gt; Dynamic Content Compression)     &lt;br /&gt;&lt;a href="http://lh6.ggpht.com/_IKD9WtY5kxU/SoVwLbnjSPI/AAAAAAAAAfM/tw2kgJGE11o/s1600-h/SNAG-0001%5B3%5D.png"&gt;&lt;img alt="SNAG-0001" border="0" height="126" src="http://lh6.ggpht.com/_IKD9WtY5kxU/SoVwLuYOtEI/AAAAAAAAAfQ/lgRIEWyhUsk/SNAG-0001_thumb%5B1%5D.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;" title="SNAG-0001" width="289" /&gt;&lt;/a&gt;      &lt;/li&gt;&lt;li&gt;Next, Install, Wait…Done!     &lt;br /&gt;&lt;a href="http://lh6.ggpht.com/_IKD9WtY5kxU/SoVwMWkzOcI/AAAAAAAAAfU/0nrUFvNdBWg/s1600-h/SNAG-0002%5B3%5D.png"&gt;&lt;img alt="SNAG-0002" border="0" height="127" src="http://lh4.ggpht.com/_IKD9WtY5kxU/SoVwM3PbbiI/AAAAAAAAAfY/YjnWn_AnyCY/SNAG-0002_thumb%5B1%5D.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;" title="SNAG-0002" width="430" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;Enable it:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Open server manager&lt;/li&gt;&lt;li&gt;Roles &amp;gt; Web Server (IIS) &amp;gt; Internet Information Services (IIS) Manager     &lt;br /&gt;&lt;a href="http://lh3.ggpht.com/_IKD9WtY5kxU/SoVwNM19vlI/AAAAAAAAAfc/QKLitvzy6LA/SNAG-0003%5B2%5D.png?imgmax=800"&gt;&lt;img alt="SNAG-0003" border="0" height="92" src="http://lh5.ggpht.com/_IKD9WtY5kxU/SoVwOfEiu8I/AAAAAAAAAfg/EMuaWDP3sFU/SNAG-0003_thumb.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;" title="SNAG-0003" width="175" /&gt;&lt;/a&gt;      &lt;/li&gt;&lt;li&gt;Next pane: Sites &amp;gt; Default Web Site &amp;gt; Your Web Site&lt;/li&gt;&lt;li&gt;Main pane: IIS &amp;gt; Compression     &lt;br /&gt;&lt;a href="http://lh3.ggpht.com/_IKD9WtY5kxU/SoVwO-RukqI/AAAAAAAAAfk/r_R9KWbZix4/SNAG-0004%5B3%5D.png?imgmax=800"&gt;&lt;img alt="SNAG-0004" border="0" height="484" src="http://lh4.ggpht.com/_IKD9WtY5kxU/SoVxaZL5hwI/AAAAAAAAAfo/N3tih3uVqT4/SNAG-0004_thumb%5B1%5D.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;" title="SNAG-0004" width="529" /&gt;&lt;/a&gt;      &lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh6.ggpht.com/_IKD9WtY5kxU/SoVxa4H5_HI/AAAAAAAAAfs/eHOMIrqNd2A/s1600-h/SNAG-0005%5B3%5D.png"&gt;&lt;img alt="SNAG-0005" border="0" height="164" src="http://lh4.ggpht.com/_IKD9WtY5kxU/SoVxbVs91lI/AAAAAAAAAfw/-MS1wQpjN_M/SNAG-0005_thumb%5B1%5D.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;" title="SNAG-0005" width="418" /&gt;&lt;/a&gt; &lt;/li&gt;&lt;/ol&gt;You might be wondering why you’d want to compress content in the first place. &lt;a href="http://weblogs.asp.net/owscott/archive/2009/02/22/iis-7-compression-good-bad-how-much.aspx"&gt;This site&lt;/a&gt;  has a nice analysis of the practice as well as detailed information  regarding what compression level you should use (and how to set it).&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/814396016109370747-9212767816802134056?l=amitshinde14.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://amitshinde14.blogspot.com/2012/03/enabling-dynamic-http-compression-in.html</link><author>noreply@blogger.com (Amit Kumar Shinde)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_IKD9WtY5kxU/SoVwI9YuQcI/AAAAAAAAAfA/nxgLdFWMoko/s72-c/0%20start%20server%20manager_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-814396016109370747.post-965015149264439196</guid><pubDate>Fri, 02 Mar 2012 03:01:00 +0000</pubDate><atom:updated>2012-03-01T19:01:00.037-08:00</atom:updated><title>10 Ways to Improve Your Web Page Performance</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;There are a &lt;em&gt;million  and one ways&lt;/em&gt; to boost your website’s performance. The methods vary and  some are more involved than others. The three &lt;em&gt;main areas&lt;/em&gt;  that you can work on are: hardware (your web server),  server-side  scripting optimization (PHP, Python, Java), and front-end performance   (the meat of the web page).&lt;br /&gt;This article primarily focuses on &lt;em&gt;front-end performance&lt;/em&gt; since it’s the easiest to work on and provides you the  most bang for your buck.&lt;br /&gt;&lt;h4&gt;Why focus on front-end performance?&lt;/h4&gt;The front-end (i.e. your HTML, CSS, JavaScript,  and images) is the most &lt;em&gt;accessible&lt;/em&gt;  part of your website. If you’re on a shared web hosting plan, you might  not  have root (or root-like) access to the server and therefore can’t  tweak and adjust  server settings. And even if you &lt;em&gt;do&lt;/em&gt; have the  right permissions, web server and database engineering require   specialized knowledge to give you any immediate benefits.&lt;br /&gt;It’s also &lt;em&gt;cheap&lt;/em&gt;.  Most of the front-end optimization  discussed can be done at no other cost but  your time. Not only is it  inexpensive, but it’s the best use of your time because front-end  performance is responsible for a &lt;a href="http://yuiblog.com/blog/2006/11/28/performance-research-part-1/" title="Performance Research, Part 1: What the 80/20 Rule Tells Us about Reducing HTTP Requests - Yahoo! User Interface Blog."&gt;very  large part&lt;/a&gt; of a website’s response time.&lt;br /&gt;With this in mind, here are a few &lt;em&gt;simple&lt;/em&gt; ways to &lt;strong&gt;improve the  speed&lt;/strong&gt; of your website.&lt;br /&gt;&lt;h3&gt;1. Profile your web pages to find the culprits.&lt;/h3&gt;&lt;img alt="Firebug screen shot." height="230" src="http://images.sixrevisions.com/2008/12/22-02_save_images_right_v2.jpg" width="550" /&gt;&lt;br /&gt;&lt;span id="more-282"&gt;&lt;/span&gt;&lt;br /&gt;It’s helpful to profile your web page to find  components that you  don’t need or components that can be optimized. Profiling a web page  usually  involves a tool such as &lt;a href="http://getfirebug.com/"&gt;Firebug&lt;/a&gt; to  determine &lt;em&gt;what&lt;/em&gt; components  (i.e. images, CSS files, HTML documents,  and JavaScript files) are being requested by the user, &lt;em&gt;how  long&lt;/em&gt; the component takes to load, and &lt;em&gt;how  big&lt;/em&gt; it is. A general rule of thumb is that you should keep your page  components as small as possible (&lt;a href="http://developer.yahoo.com/performance/rules.html#under25" title="Rule 25 of Best Practices for Speeding Up Your Web Site on Yahoo!."&gt;under  25KB is a good target&lt;/a&gt;).&lt;br /&gt;Firebug’s Net tab (shown above) can help you hunt down  huge files  that bog down your website.  In the above example, you can see that it   gives you a break down of all the components required to render a web  page  including: what it is, where it is, how big it is,  and how long  it took to load.&lt;br /&gt;There are many tools on the web to help you profile your web  page – check out &lt;a href="http://sixrevisions.com/tools/faster_web_page/" title="15 Tools to Help You Develop Faster Web Pages - Six Revisions"&gt;this  guide&lt;/a&gt; for a few more tools that you can use.&lt;br /&gt;&lt;h3&gt;2. Save images in the right format to reduce their file size.&lt;/h3&gt;&lt;img alt="JPEG vs GIF screenshot." height="230" src="http://images.sixrevisions.com/2008/12/22-01_firebug.jpg" width="550" /&gt;&lt;br /&gt;If you have a lot of images, it’s essential to learn about  the  optimal format for each image. There are three common web image file   formats: &lt;em&gt;JPEG&lt;/em&gt;, &lt;em&gt;GIF&lt;/em&gt;, and &lt;em&gt;PNG&lt;/em&gt;. In general,  you  should use JPEG for realistic photos with smooth gradients and color  tones.  You should use GIF or PNG for images that have solid colors  (such as charts and  logos).&lt;br /&gt;GIF and PNG are similar, but PNG typically produces a lower file  size. Read Coding Horror’s &lt;a href="http://www.codinghorror.com/blog/archives/000810.html" title="Getting the Most Out of PNG on Coding Horror."&gt;weigh-in on using PNG’s  over GIF’s&lt;/a&gt;.&lt;br /&gt;&lt;h3&gt;3. Minify your CSS and JavaScript documents to save a few bytes.&lt;/h3&gt;&lt;a href="http://en.wikipedia.org/wiki/Minify" title="Minification (programming) on Wikipedia."&gt;Minification&lt;/a&gt;  is the  process  of removing unneeded characters (such as tabs, spaces,   source code comments) from the source code to reduce its file size.  For example:&lt;br /&gt;This chuck of CSS:&lt;br /&gt;&lt;pre&gt;.some-class {&lt;br /&gt;  color: #ffffff;&lt;br /&gt;  line-height: 20px;&lt;br /&gt;  font-size: 9px;&lt;br /&gt;}&lt;/pre&gt;can be converted to:&lt;br /&gt;&lt;pre&gt;.some-class{color:#fff;line-height:20px;font-size:9px;}&lt;/pre&gt;…and it’ll work just fine.&lt;br /&gt;And don’t &lt;em&gt;worry&lt;/em&gt; –  you won’t have to reformat your code &lt;em&gt;manually&lt;/em&gt;.   There’s a plethora of free tools available at your disposal for  minifying your  CSS and JavaScript files. For CSS, you can find a bunch  of easy-to-use tools  from this &lt;a href="http://sixrevisions.com/css/css_code_optimization_formatting_validation/"&gt;CSS  optimization tools list&lt;/a&gt;. For JavaScript, some popular minification options are &lt;a href="http://www.crockford.com/javascript/jsmin.html" title="JSMIN, The JavaScript Minifier."&gt;JSMIN&lt;/a&gt;, &lt;a href="http://developer.yahoo.com/yui/compressor/"&gt;YUI Compressor&lt;/a&gt;, and &lt;a href="http://jcay.com/id-190119110113039.html"&gt;JavaScript Code Improver&lt;/a&gt;.  A good minifying application gives you the ability to reverse the  minification for when you’re in development. Alternatively, you can use  an in-browser tool like Firebug to see the formatted version of your  code.&lt;br /&gt;&lt;h3&gt;4. Combine CSS and JavaScript files to reduce HTTP requests&lt;/h3&gt;For every component that’s needed to render a web page, an &lt;a href="http://en.wikipedia.org/wiki/HTTP#Request_message"&gt;HTTP request&lt;/a&gt;  is  created to the server. So, if you have five CSS files for a web  page, you would  need at least five separate HTTP GET requests for that  particular  web page. By combining files, you reduce the HTTP request  overhead required to  generate a web page.&lt;br /&gt;Check out Niels Leenheer’s article on how you can &lt;a href="http://rakaz.nl/item/make_your_pages_load_faster_by_combining_and_compressing_javascript_and_css_files" title="Make your pages load faster by combining and compressing javascript and css files on rakaz."&gt;combine  CSS and JS files using PHP&lt;/a&gt; (which can be adapted to other languages).  SitePoint discusses a similar method of &lt;a href="http://www.sitepoint.com/blogs/2007/04/10/faster-page-loads-bundle-your-css-and-javascript/" title="Faster Page Loads - Bundle Your CSS and Javascript on SitePoint."&gt;bundling  your CSS and JavaScript&lt;/a&gt;;they were able to shave off &lt;em&gt;1.6 seconds&lt;/em&gt; in  response time, thereby reducing the response time by &lt;em&gt;76% of the original time&lt;/em&gt;.&lt;br /&gt;Otherwise, you can  combine your CSS and JavaScript files using  good, old &lt;em&gt;copy-and-paste&lt;/em&gt;‘ing (works like a charm).&lt;br /&gt;&lt;h3&gt;5. Use CSS sprites to reduce HTTP requests&lt;/h3&gt;&lt;img alt="CSS Sprites on Digg." height="230" src="http://images.sixrevisions.com/2008/12/22-03_css_sprites_on_digg.png" width="530" /&gt;&lt;br /&gt;A &lt;a href="http://spritegen.website-performance.org/section/what-are-css-sprites" title="What are CSS sprites? on Website Performance."&gt;CSS Sprite&lt;/a&gt; is a  combination of smaller images into one big image. To display the correct image,  you adjust the &lt;code&gt;background-position&lt;/code&gt; CSS attribute. Combining multiple images in this way reduces HTTP  requests.&lt;br /&gt;For example, on &lt;a href="http://digg.com/"&gt;Digg&lt;/a&gt; (shown above), you can  see individual icons for user interaction. To reduce  server requests, Digg combined several icons in &lt;a href="http://digg.com/img/menu-current.gif" title="One of Digg's CSS sprites."&gt;one  big image&lt;/a&gt; and then used CSS to position them appropriately.&lt;br /&gt;You can do this manually, but there’s a web-based tool  called &lt;a href="http://www.connectedinternet.co.uk/2008/01/15/tweaking-your-sites-performance-to-the-max/"&gt;CSS  Sprite Generator&lt;/a&gt; that gives you the option of uploading images to be  combined into one CSS sprite, and then outputs the CSS code (the &lt;code&gt;background-position&lt;/code&gt; attributes) to render the images.&lt;br /&gt;&lt;h3&gt;6. Use server-side compression to reduce file sizes&lt;/h3&gt;This can be tricky if you’re on a shared web host that  doesn’t  already server-side compression, but to fully optimize the serving of  page  components they should be compressed. Compressing page objects  is  similar to zipping up a large file that you send through email: &lt;em&gt;You&lt;/em&gt; (web server) zip up a &lt;em&gt;large family picture&lt;/em&gt; (the page  component) and email it to your &lt;em&gt;friend&lt;/em&gt; (the browser) – they in turn unpack your ZIP file to see the picture. Popular  compression methods are &lt;a href="http://en.wikipedia.org/wiki/DEFLATE"&gt;Deflate&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Gzip"&gt;gzip&lt;/a&gt;.&lt;br /&gt;If you run your own dedicated server or if you have a VPS – you’re in  luck  – if you don’t have compression enabled, installing an  application to handle compression is  a cinch. Check out this guide on  how to install &lt;a href="http://schroepl.net/projekte/mod_gzip/install.htm"&gt;mod_gzip&lt;/a&gt; on  Apache.&lt;br /&gt;&lt;h3&gt;7. Avoid inline CSS and JavaScript&lt;/h3&gt;By default, external CSS and JavaScript files are cached by the  user’s  browser. When a user navigates away  from the landing page, they  will already have your stylesheets and JavaScript  files, which in turn  saves them the need to download styles and scripts again. If you use a  lot of CSS and JavaScript in your HTML document, you won’t be taking  advantage of the web browser’s caching features.&lt;br /&gt;&lt;h3&gt;8. Offload site assets and features&lt;/h3&gt;&lt;img alt="Amazon S3Fox for Six Revisions." height="230" src="http://images.sixrevisions.com/2008/12/22-04_s3fox.jpg" width="530" /&gt;&lt;br /&gt;Unloading some of your site assets and features to third-party web   services greatly reduces the work of your web server. The principle of   offloading site assets and features  is that you share the burden of  serving page  components with another server.&lt;br /&gt;You can use &lt;a href="http://www.feedburner.com/fb/a/home"&gt;Feedburner&lt;/a&gt; to handle your RSS feeds, &lt;a href="http://flickr.com/"&gt;Flickr&lt;/a&gt; to serve your  images (&lt;a href="http://www.blogherald.com/2008/02/04/the-dangers-of-offloading-images/" title="The Dangers of Offloading Images on The Blog Herald."&gt;be aware of the  implications&lt;/a&gt; of offloading your images though), and the &lt;a href="http://code.google.com/apis/ajaxlibs/"&gt;Google AJAX Libraries API&lt;/a&gt; to  serve popular JavaScript frameworks/libraries like MooTools, jQuery, and Dojo.&lt;br /&gt;For example, on Six Revisions I use Amazon’s Simple Storage  Service (&lt;a href="http://aws.amazon.com/s3/"&gt;Amazon S3&lt;/a&gt;  for short), to  handle the images you see on this page, as well as  Feedburner to handle RSS feeds.  This allows my own server to handle   just the serving of HTML, CSS, and CSS image backgrounds. Not only are  these  solutions cost-effective, but they drastically reduce the  response times of web pages.&lt;br /&gt;&lt;h3&gt;9. Use Cuzillion to plan out an optimal web page structure&lt;/h3&gt;&lt;img alt="Cuzzillion screen shot." height="230" src="http://images.sixrevisions.com/2008/12/22-05_cuzzillion.png" width="530" /&gt;&lt;br /&gt;&lt;a href="http://stevesouders.com/cuzillion/"&gt;Cuzillion&lt;/a&gt; is a web-based application created by &lt;a href="http://stevesouders.com/bio.php"&gt;Steve  Souders&lt;/a&gt;  (front-end engineer for Google after leaving Yahoo! as Chief of   Performance) that helps you experiment with different configurations of a  web  page’s structure in order to see what the optimal structure is. If  you already  have a web page design, you can use Cuzillion to simulate  your web page’s structure  and then tweak it to see if you can improve  performance by moving things around.&lt;br /&gt;View InsideRIA’s &lt;a href="http://www.insideria.com/2008/04/cuzillion-optimizing-web-app-a.html"&gt;video  interview&lt;/a&gt; of Steve Sounders discussing how Cuzillion works and the &lt;a href="http://stevesouders.com/cuzillion/help.php"&gt;Help&lt;/a&gt; guide to get you  started quickly.&lt;br /&gt;&lt;h3&gt;10. Monitor web server performance and create benchmarks  regularly.&lt;/h3&gt;The web server is the &lt;em&gt;brains&lt;/em&gt; of the operation – it’s  responsible for getting/sending HTTP  requests/responses to the right  people and serves all of your web page  components. If your web server  isn’t performing well, you won’t get the maximum benefit  of your  optimization efforts.&lt;br /&gt;It’s essential that you are constantly checking your web server for  performance issues. If you have root-like access and can install stuff  on the  server, check out &lt;a href="http://httpd.apache.org/docs/2.0/programs/ab.html"&gt;ab&lt;/a&gt; – an Apache web server benchmarking tool or &lt;a href="http://www.hpl.hp.com/research/linux/httperf/"&gt;Httperf&lt;/a&gt; from IBM.&lt;br /&gt;If you don’t have access to your web server (or have &lt;em&gt;no clue&lt;/em&gt; what I’m talking about) you’ll  want to use a remote tool like &lt;a href="http://www.fiddlertool.com/fiddler/"&gt;Fiddler&lt;/a&gt; or &lt;a href="http://www.httpwatch.com/"&gt;HTTPWatch&lt;/a&gt; to analyze and monitor  HTTP traffic. They will both point out places that are troublesome for you to  take a look at.&lt;br /&gt;Benchmarking before and after making major changes will also give you  some insight on the effects of your changes. If your web server can’t  handle the traffic your website generates, it’s time for an upgrade or  server migration.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/814396016109370747-965015149264439196?l=amitshinde14.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://amitshinde14.blogspot.com/2012/03/10-ways-to-improve-your-web-page.html</link><author>noreply@blogger.com (Amit Kumar Shinde)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-814396016109370747.post-8967178387153426415</guid><pubDate>Thu, 01 Mar 2012 12:23:00 +0000</pubDate><atom:updated>2012-03-01T04:23:40.839-08:00</atom:updated><title>SQL Server Optimization Tips for Designing Tables</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Normalize your tables to the third normal form.&lt;br /&gt;&amp;nbsp;A table is in third normal form (3NF) if it is in second normal form (2NF) and if it does not contain transitive dependencies. In most cases, you should normalize your tables to the third normal form. The normalization is used to reduce the total amount of redundant data in the database. The less data there is, the less work SQL Server has to perform, speeding its performance.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Consider the denormalization of your tables from the forth or fifth normal forms to the third normal form.&lt;br /&gt;&amp;nbsp;Normalization to the forth and fifth normal forms can result in some performance degradation, especially when you need to perform many joins against several tables. It may be necessary to denormalize your tables to prevent performance degradation. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Consider horizontal partitioning of the very large tables into the current and the archives versions.&lt;br /&gt;&amp;nbsp;The less space used, the smaller the table, the less work SQL Server has to perform to evaluate your queries. For example, if you need to query only data for the current year in your daily work, and you need all the data only once per month for the monthly report, you can create two tables: one with the current year's data and one with the old data.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Create the table's columns as narrow as possible.&lt;br /&gt;&amp;nbsp;This can reduce the table's size and improve performance of your queries as well as some maintenance tasks (such as backup, restore and so on).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Try to reduce the number of columns in a table.&lt;br /&gt;&amp;nbsp;The fewer the number of columns in a table, the less space the table will use, since more rows will fit on a single data page, and less I/O overhead will be required to access the table's data.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Try to use constraints instead of triggers, rules, and defaults whenever possible.&lt;br /&gt;&amp;nbsp;Constraints are much more efficient than triggers and can boost performance. Constraints are more consistent and reliable in comparison to triggers, rules and defaults, because you can make errors when you write your own code to perform the same actions as the constraints.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you need to store integer data from 0 through 255, use tinyint data type.&lt;br /&gt;&amp;nbsp;The columns with tinyint data type use only one byte to store their values, in comparison with two bytes, four bytes and eight bytes used to store the columns with smallint, int and bigint data types accordingly. For example, if you design tables for a small company with 5-7 departments, you can create the departments table with the DepartmentID tinyint column to store the unique number of each department.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you need to store integer data from -32,768 through 32,767, use smallint data type.&lt;br /&gt;&amp;nbsp;The columns with smallint data type use only two bytes to store their values, in comparison with four bytes and eight bytes used to store the columns with int and bigint data types respectively. For example, if you design tables for a company with several hundred employees, you can create an employee table with the EmployeeID smallint column to store the unique number of each employee.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you need to store integer data from -2,147,483,648 through 2,147,483,647, Use int data type.&lt;br /&gt;&amp;nbsp;The columns with int data type use only four bytes to store their values, in comparison with eight bytes used to store the columns with bigint data types. For example, to design tables for a library with more than 32,767 books, create a books table with a BookID int column to store the unique number of each book.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Use smallmoney data type instead of money data type, if you need to store monetary data values from 214,748.3648 through 214,748.3647.&lt;br /&gt;&amp;nbsp;The columns with smallmoney data type use only four bytes to store their values, in comparison with eight bytes used to store the columns with money data types. For example, if you need to store the monthly employee payments, it might be possible to use a column with the smallmoney data type instead of money data type.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Use smalldatetime data type instead of datetime data type, if you need to store the date and time data from January 1, 1900 through June 6, 2079, with accuracy to the minute.&lt;br /&gt;&amp;nbsp;The columns with smalldatetime data type use only four bytes to store their values, in comparison with eight bytes used to store the columns with datetime data types. For example, if you need to store the employee's hire date, you can use column with the smalldatetime data type instead of datetime data type.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Use varchar/nvarchar columns instead of text/ntext columns whenever possible.&lt;br /&gt;&amp;nbsp;Because SQL Server stores text/ntext columns on the Text/Image pages separately from the other data, stored on the Data pages, it can take more time to get the text/ntext values.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Use char/varchar columns instead of nchar/nvarchar if you do not need to store unicode data.&lt;br /&gt;&amp;nbsp;The char/varchar value uses only one byte to store one character, the nchar/nvarchar value uses two bytes to store one character, so the char/varchar columns use two times less space to store data in comparison with nchar/nvarchar columns.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Consider setting the 'text in row' SQL Server 2000 table's option.&lt;br /&gt;&amp;nbsp;The text, ntext, and image values are stored on the Text/Image pages, by default. This option specifies that small text, ntext, and image values will be placed on the Data pages with other data values in a data row. This can increase the speed of read and write operations and reduce the amount of space used to store small text, ntext, and image data values. You can set the 'text in row' table option by using the sp_tableoption stored procedure.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you work with SQL Server 2000, use cascading referential integrity constraints instead of triggers whenever possible.&lt;br /&gt;&amp;nbsp;For example, if you need to make cascading deletes or updates, specify the ON DELETE or ON UPDATE clause in the REFERENCES clause of the CREATE TABLE or ALTER TABLE statements. The cascading referential integrity constraints are much more efficient than triggers and can boost performance.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/814396016109370747-8967178387153426415?l=amitshinde14.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://amitshinde14.blogspot.com/2012/03/sql-server-optimization-tips-for.html</link><author>noreply@blogger.com (Amit Kumar Shinde)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-814396016109370747.post-3766933967512936884</guid><pubDate>Wed, 29 Feb 2012 04:34:00 +0000</pubDate><atom:updated>2012-02-28T20:34:18.125-08:00</atom:updated><title>How ASP.NET Web Pages are Processed on the Web Server</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;h2 class="section"&gt;Introduction&lt;/h2&gt;&lt;br /&gt;Have you ever wondered, precisely, what happens on the Web server when a request for an ASP.NET Web page comes in? How does the Web server handle the incoming request?  How is the HTML that is emitted to the client generated? What mechanisms are possible for us developers to work with an incoming request in its various stages of processing? In this article we'll take a rather detailed look at how ASP.NET Web pages are processed on the Web server.&lt;br /&gt;&lt;br /&gt;&lt;h2 class="section"&gt;Step 0: The Browser Makes an HTTP Request for an ASP.NET Web Page&lt;/h2&gt;&lt;br /&gt;The entire process begins with a Web browser making a request for an ASP.NET Web page.  For example, a user might type into their browser's Address window the URL for this article, &lt;code&gt;http://aspnet.4guysfromrolla.com/articles/011404.aspx&lt;/code&gt;. The Web browser, then, would make an HTTP request to the 4Guys Web server, asking for the particular file &lt;code&gt;/articles/011404-1.aspx&lt;/code&gt;.  &lt;br /&gt;&lt;h2 class="section"&gt;Step 1: The Web Server Receives the HTTP Request&lt;/h2&gt;&lt;br /&gt;The sole task of a Web server is to accept incoming HTTP requests and to return the requested resource in an HTTP response. The 4Guys Web server runs Microsoft's Internet Information Services (IIS) Web server.  The first things IIS does when a request comes in is decide how to handle the request.  Its decision is based upon the requested file's extension. For example, if the requested file has the &lt;code&gt;.asp&lt;/code&gt; extension, IIS will route the request to be handled by &lt;code&gt;asp.dll&lt;/code&gt;.  &lt;a href="http://www.4guysfromrolla.com/images/iisConfig.gif"&gt; &lt;img align="right" alt="The extensions can be mapped through IIS." height="275" src="http://www.4guysfromrolla.com/images/iisConfig.tiny.gif" width="250" /&gt;&lt;/a&gt; There are numerous file extensions that map to the ASP.NET engine, some of which include: &lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;.aspx&lt;/code&gt;, for ASP.NET Web pages,&lt;/li&gt;&lt;li&gt;&lt;code&gt;.asmx&lt;/code&gt;, for ASP.NET Web services,&lt;/li&gt;&lt;li&gt;&lt;code&gt;.config&lt;/code&gt;, for ASP.NET configuration files,&lt;/li&gt;&lt;li&gt;&lt;code&gt;.ashx&lt;/code&gt;, for custom ASP.NET HTTP handlers,&lt;/li&gt;&lt;li&gt;&lt;code&gt;.rem&lt;/code&gt;, for remoting resources,&lt;/li&gt;&lt;li&gt;And others!&lt;/li&gt;&lt;/ul&gt;In the IIS administration screens, you can configure the extension mappings.  The screenshot to the right shows the configuration screen for IIS 5.0.  You could, for example, add your own custom extensions here.  That is, you could have requests for &lt;code&gt;.scott&lt;/code&gt; files routed to the ASP.NET engine. &lt;br /&gt;The diagram below illustrates the steps 0 and 1 of a request for an ASP.NET Web page.  When a request comes into the Web server, it is routed to the proper place (perhaps &lt;code&gt;asp.dll&lt;/code&gt; for classic ASP page requests, perhaps the ASP.NET engine for ASP.NET requests) based on the requested file's extension. &lt;br /&gt;&lt;br /&gt;&lt;center&gt; &lt;img alt="A diagram illustrating steps 1 and 2." height="202" src="http://www.4guysfromrolla.com/images/steps0and1.gif" width="500" /&gt; &lt;/center&gt; &lt;br /&gt;&lt;h2 class="section"&gt;Step 2: Examining the ASP.NET Engine&lt;/h2&gt;&lt;br /&gt;An initial request for &lt;code&gt;http://aspnet.4guysfromrolla.com/articles/011404.aspx&lt;/code&gt; will reach IIS and then be routed to the ASP.NET engine, but what happens next?  The ASP.NET engine is often referred to as the ASP.NET HTTP pipeline, because the incoming request passes through a variable number of &lt;i&gt;HTTP modules&lt;/i&gt; on its way to an &lt;i&gt;HTTP handler&lt;/i&gt;.  HTTP modules are classes that have access to the incoming request.  These modules can inspect the incoming request and make decisions that affect the internal flow of the request.  After passing through the specified HTTP modules, the request reaches an HTTP handler, whose job it is to generate the output that will be sent back to the requesting browser. The following diagram illustrates the pipeline an ASP.NET request flows through. &lt;br /&gt;&lt;br /&gt;&lt;center&gt; &lt;img alt="A diagram illustrating step 2." height="253" src="http://www.4guysfromrolla.com/images/step2.gif" width="263" /&gt; &lt;/center&gt; There are a number of pre-built HTTP modules that are included in the HTTP pipeline by default.  These modules include: &lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;OutputCache&lt;/code&gt;, which handles returning and caching the page's HTML output, if needed&lt;/li&gt;&lt;li&gt;&lt;code&gt;Session&lt;/code&gt;, which loads in the session state based on the user's incoming request and the session method specified in the &lt;code&gt;Web.config&lt;/code&gt; file&lt;/li&gt;&lt;li&gt;&lt;code&gt;FormsAuthentication&lt;/code&gt;, which attempts to authenticate the user based on the forms authentication scheme, if used&lt;/li&gt;&lt;li&gt;And others!&lt;/li&gt;&lt;/ul&gt;In fact, you can see a precise list of what modules are used by default by going to the &lt;code&gt;machine.config&lt;/code&gt; file (located in the &lt;code&gt;$WINDOWS$\Microsoft.NET\Framework\$VERSION$\CONFIG&lt;/code&gt; directory) and searching for the &lt;code&gt;&lt;httpmodules&gt;&lt;/httpmodules&gt;&lt;/code&gt; element.&lt;br /&gt;&lt;table border="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#cccccc" width="100%"&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;httpmodules&gt;&lt;add name="OutputCache" type="System.Web.Caching.OutputCacheModule"&gt;&lt;add name="Session" type="System.Web.SessionState.SessionStateModule"&gt;&lt;add name="WindowsAuthentication" type="System.Web.Security.WindowsAuthenticationModule"&gt;&lt;add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule"&gt;&lt;add name="PassportAuthentication" type="System.Web.Security.PassportAuthenticationModule"&gt;&lt;add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule"&gt;&lt;add name="FileAuthorization" type="System.Web.Security.FileAuthorizationModule"&gt;&lt;add name="ErrorHandlerModule" type="System.Web.Mobile.ErrorHandlerModule, &lt;br /&gt;                                          System.Web.Mobile, Version=1.0.5000.0, &lt;br /&gt;                                          Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"&gt;&lt;/add&gt;&lt;/add&gt;&lt;/add&gt;&lt;/add&gt;&lt;/add&gt;&lt;/add&gt;&lt;/add&gt;&lt;/add&gt;&lt;/httpmodules&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;HTTP handlers are the endpoints in the ASP.NET HTTP pipeline.  The job of the HTTP handler is to generate the output for the requested resource.  For ASP.NET Web pages, this means rendering the Web controls into HTML and returning this HTML.  For a Web service, it would involve executing the specified method and wrapping its return values into an appropriately formatted SOAP response.  (For more on Web services, be sure to read: &lt;a href="http://www.4guysfromrolla.com/articles/100803-1.aspx"&gt;An Extensive Examination of Web Services&lt;/a&gt;.) &lt;br /&gt;Different ASP.NET resources use different HTTP handlers.  The handlers used by default are spelled out in the &lt;code&gt;machine.config&lt;/code&gt;'s &lt;code&gt;&lt;httphandler&gt;&lt;/httphandler&gt;&lt;/code&gt; section.  Entries in this section refer to classes that are either HTTP handlers themselves or are HTTP handler &lt;i&gt;factories&lt;/i&gt;.  An HTTP handler factory merely returns a suitable HTTP handler instance when invoked. &lt;br /&gt;&lt;br /&gt;&lt;table border="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#cccccc" width="100%"&gt;&lt;pre&gt;&lt;code&gt;&lt;httphandlers&gt;&lt;add path="*.vjsproj" type="System.Web.HttpForbiddenHandler" verb="*"&gt;&lt;add path="*.java" type="System.Web.HttpForbiddenHandler" verb="*"&gt;&lt;add path="*.jsl" type="System.Web.HttpForbiddenHandler" verb="*"&gt;&lt;add path="trace.axd" type="System.Web.Handlers.TraceHandler" verb="*"&gt;&lt;add path="*.aspx" type="System.Web.UI.PageHandlerFactory" verb="*"&gt;&lt;add path="*.ashx" type="System.Web.UI.SimpleHandlerFactory" verb="*"&gt;&lt;br /&gt;&lt;/add&gt;&lt;/add&gt;&lt;/add&gt;&lt;/add&gt;&lt;/add&gt;&lt;/add&gt;&lt;/httphandlers&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;Realize that you can create your own HTTP modules and HTTP handlers, and then plug them into the pipeline for &lt;i&gt;all&lt;/i&gt; Web sites on the Web server by modifying &lt;code&gt;machine.config&lt;/code&gt;, or you can add them to a particular Web application by modifying that application's &lt;code&gt;Web.config&lt;/code&gt; file.  A thorough discussion on using HTTP modules and handlers is far beyond the scope of this article, but realize that you can accomplish some neat things using modules and handlers.  For example, you can use HTTP modules to provide a custom URL rewritter, which can be useful for automatically fixing 404 errors to using shorter and user-friendlier URLs.  (See &lt;a href="http://www.15seconds.com/issue/030522.htm"&gt;Rewrite.NET - A URL Rewriting Engine for .NET&lt;/a&gt; for an example of using HTTP modules for URL rewriting.)  Another cool use of modules is &lt;a href="http://www.blowery.org/code/HttpCompressionModule.html"&gt;compressing the generated HTML&lt;/a&gt;. &lt;br /&gt;For a good discussion on HTTP modules and handlers be sure to read Mansoor Ahmed Siddiqui's article: &lt;a href="http://www.15seconds.com/issue/020417.htm"&gt;HTTP Handlers and HTTP Modules in ASP.NET&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;&lt;h2 class="section"&gt;Step 3: Generating the Output&lt;/h2&gt;&lt;br /&gt;The final step is for the suitable HTTP handler to generate the appropriate output.  This output, then, is passed back through the HTTP modules and then back to IIS, which then sends it back to the client that initiated the request.  (If the client was a Web browser, the Web browser would receive this HTML and display it.)  Since the steps for generating the output differ by HTTP handler, let's  focus in on one in particular - the HTTP handler that is used to render ASP.NET Web pages.  To retrace the initial steps,  when a request comes into IIS for an ASP.NET page (i.e., one with a &lt;code&gt;.aspx&lt;/code&gt; extension), the request is handed off to the ASP.NET engine.  The request then moves through the modules.  The request is then routed to the &lt;code&gt;PageHandlerFactory&lt;/code&gt;, since in the &lt;code&gt;machine.config&lt;/code&gt;'s &lt;code&gt;&lt;httphandler&gt;&lt;/httphandler&gt;&lt;/code&gt; section we have the mapping: &lt;br /&gt;&lt;table border="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#cccccc" width="100%"&gt;&lt;pre&gt;&lt;code&gt;&lt;httphandlers&gt;&lt;add path="*.aspx" type="System.Web.UI.PageHandlerFactory" verb="*"&gt;&lt;br /&gt;&lt;/add&gt;&lt;/httphandlers&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;The &lt;code&gt;PageHandlerFactory&lt;/code&gt; class is an HTTP handler factory.  It's job is to provide an instance of an HTTP handler that can handle the request.  What &lt;code&gt;PageHandlerFactory&lt;/code&gt; does is find the compiled class that represents the ASP.NET Web page that is being requested. &lt;br /&gt;If you use Visual Studio .NET to create your ASP.NET Web pages you know that the Web pages are composed of two separate files: a &lt;code&gt;.aspx&lt;/code&gt; file, which contains just the HTML markup and Web controls, and a &lt;code&gt;.aspx.vb&lt;/code&gt; or &lt;code&gt;.aspx.cs&lt;/code&gt; file that contains the code-behind class (which contains the server-side code).  If you don't use Visual Studio .NET, you likely use a server-side &lt;code&gt;&lt;script&gt;&lt;/code&gt; block to hold the server-side code.Regardless of what approach you use, when the ASP.NET Web page is first visited after a change to the HTML or Web controlcontent, the ASP.NET engine creates a class that derives from the &lt;code&gt;System.Web.UI.Page&lt;/code&gt; class.This dynamically created class is then compiled.&lt;/p&gt;&lt;p&gt;Not coincidentally, the &lt;code&gt;Page&lt;/code&gt; class implements &lt;code&gt;IHttpHandler&lt;/code&gt;, thereby indicating that itsuffices as an HTTP handler.  What the &lt;code&gt;PageHandlerFactory&lt;/code&gt; does, then, is check to see if a compiled versionof the requested ASP.NET Web page's class exists.  If not, it dynamically creates this class and compiles it.  Thisclass, then, has a particular method invoked which generates the page's complete HTML markup.  It's this HTML markupthat is then returned to the client.  (Have you noticed that when visiting an ASP.NET Web page after making changes tothe HTML or Web control content, there is a bit of a delay?  This delay is due to the ASP.NET engine needing torecreate and recompile the ASP.NET page's corresponding class.)&lt;/p&gt;&lt;center&gt;&lt;img src="http://www.4guysfromrolla.com/images/step3.gif" alt="A diagram illustrating step 3." height="329" width="265"&gt;&lt;/center&gt;&lt;p&gt;Realize that the &lt;code&gt;011404-1.aspx&lt;/code&gt; class might need to first be generated and compiled by the &lt;code&gt;PageHandlerFactory&lt;/code&gt; before it can be invoked to generate the HTML.  The process of page rendering - whichinvolves obtaining the HTML markup for the requested ASP.NET Web page - is a bit beyond the scope of this article,but is discussed in good detail in Dino Esposito's article, &lt;a href="http://msdn2.microsoft.com/en-us/library/aa479007.aspx"&gt;TheASP.NET Page Object Model&lt;/a&gt;.&lt;/p&gt;&lt;h2 class="section"&gt;Conclusion&lt;/h2&gt;In this article we looked at an overview of how ASP.NET Web pages are processed on the Web server.  It involvesa number of steps, starting with a request from a client, and culminating with the requested ASP.NET Web page'sclass generating the page's rendered HTML.  In between, the request bounces through IIS and into the ASP.NET engine,where it proceeds through a module pipeline down into the corresponding HTTP handler.&lt;p&gt;Happy Programming!&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/DIV&gt;&lt;/script&gt;&lt;/code&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/814396016109370747-3766933967512936884?l=amitshinde14.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://amitshinde14.blogspot.com/2012/02/how-aspnet-web-pages-are-processed-on.html</link><author>noreply@blogger.com (Amit Kumar Shinde)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-814396016109370747.post-5826634526882934087</guid><pubDate>Wed, 29 Feb 2012 03:35:00 +0000</pubDate><atom:updated>2012-02-28T19:35:37.823-08:00</atom:updated><title>6 important .NET concepts: - Stack, heap, Value types, reference types, boxing and Unboxing.</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;h2&gt;&lt;a href="http://www.blogger.com/post-create.g?blogID=814396016109370747" name="Introduction"&gt;Introduction&lt;/a&gt;&lt;br /&gt;&lt;/h2&gt;This article will explain 6 &lt;span class="search-highlight"&gt;important&lt;/span&gt; &lt;span class="search-highlight"&gt;concepts&lt;/span&gt;  Stack , heap , value types , reference types , boxing and unboxing.  This article starts first explaining what happens internally when you  declare a variable and then it moves ahead to explain 2 &lt;span class="search-highlight"&gt;important&lt;/span&gt; &lt;span class="search-highlight"&gt;concepts&lt;/span&gt; stack and heap. Article then talks about reference types and value types and clarifies some of the &lt;span class="search-highlight"&gt;important&lt;/span&gt; fundamentals around them. &lt;br /&gt;&lt;br /&gt;Finally the article concludes by demonstrating how performance is hampered due to boxing and unboxing with a sample code.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;&lt;a href="http://www.blogger.com/post-create.g?blogID=814396016109370747" name="What goes inside when you declare a variable"&gt;What goes inside when you declare a variable?&lt;/a&gt;&lt;br /&gt;&lt;/h2&gt;When you declare a variable in a .Net application, it allocates some  chunk of memory in to the RAM. This memory has 3 things first the name  of the variable, second data type of the variable and finally the value  of the variable.&lt;br /&gt;&lt;br /&gt;That was a simple explanation of what happens in  the memory, but depending on what kind of data type your variable is  allocated on that type of memory. There are two types of memory  allocation stack memory and heap memory. In the coming sections we will  try to understand these two types of memory in more details.&lt;br /&gt;&lt;br /&gt;&lt;img border="0" height="215" src="http://www.codeproject.com/KB/dotnet/6importentStepsDotNet/2.jpg" width="482" /&gt;&lt;br /&gt;&lt;h2&gt;&lt;a href="http://www.blogger.com/post-create.g?blogID=814396016109370747" name="Stack and Heap"&gt; Stack and Heap&lt;/a&gt;&lt;br /&gt;&lt;/h2&gt;In order to understand stack and heap, let’s understand what actually happens in the below code internally.&lt;br /&gt;&lt;br /&gt;&lt;div class="pre-action-link" id="premain0" style="display: block;" width="100%"&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre id="pre0" style="margin-top: 0pt;"&gt;&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; Method1()&lt;br /&gt;{&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Line 1&lt;br /&gt;&lt;/span&gt;&lt;span class="code-keyword"&gt;int&lt;/span&gt; i=4;&lt;br /&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Line 2&lt;br /&gt;&lt;/span&gt;&lt;span class="code-keyword"&gt;int&lt;/span&gt; y=2;&lt;br /&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;Line 3&lt;br /&gt;&lt;/span&gt;class1 cls1 = &lt;span class="code-keyword"&gt;new&lt;/span&gt; class1();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;It’s a 3 line code so let’s understand line by line how things execute internally.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Line 1:-&lt;/b&gt;  When this line is executed compiler allocates a small amount of memory  in to memory type called as stack. Stack is responsible of keeping track  of running memory needed in your application.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Line 2:-&lt;/b&gt;  Now the execution moves to the next step. As the name says stack it  stacks this memory allocation on the top of the first memory allocation.  You can think about stack as series of compartment or boxes put on top  of each other. &lt;br /&gt;&lt;br /&gt;Memory allocation and de-allocation is done using  LIFO (Last in first out) logic. In other words memory is allocated and  de-allocated at only one end of the memory i.e. top of the stack.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Line 3:- &lt;/b&gt;In  line 3 we have a created an object. When this line is executed it  creates a pointer on the stack and the actual object is stored in a  different type of memory location called as ‘Heap’. ‘Heap’ does not  track running memory it’s just pile of objects which can reached at any  moment of time. Heap is used for dynamic memory allocation. &lt;br /&gt;&lt;br /&gt;One more &lt;span class="search-highlight"&gt;important&lt;/span&gt;  point to note here is reference pointers are allocated on stack. The  statement, Class1 cls1; does not allocate memory for an instance of  Class1, it only allocates a stack variable cls1 (and sets it to null).  The time it hits the new keyword it allocates on "HEAP".&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Exiting the method (The fun):-&lt;/b&gt;  Now finally the execution control starts exiting the method. When it  passes the end control it clears all the memory variables which are  assigned on stack. In other words all variables which are related to  ‘int’ data type are de-allocated in ‘LIFO’ fashion from the stack.&lt;br /&gt;&lt;br /&gt;The BIG catch – It did not de-allocate the heap memory. This memory will be later de-allocated by “GARBAGE COLLECTOR”.&lt;br /&gt;&lt;br /&gt;&lt;img border="0" height="375" src="http://www.codeproject.com/KB/dotnet/6importentStepsDotNet/13.jpg" width="580" /&gt;&lt;br /&gt;Now many of our developer friends must be wondering why two types of  memory, can’t we just allocate everything on just one memory type and we  are done.&lt;br /&gt;&lt;br /&gt;If you look closely primitive data types are not  complex, they hold single values like ‘int i = 0’. Object data types are  complex, they reference other objects or other primitive data types. In  other words they hold reference to other multiple values and each one  of them must be stored in memory. Object types need dynamic memory while  primitive needs static type memory. If the requirement is of dynamic  memory it’s allocated on a heap or else it goes on a stack.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Image taken from &lt;a href="http://michaelbungartz.wordpress.com/"&gt;http://michaelbungartz.wordpress.com/&lt;/a&gt; &lt;br /&gt;&lt;img border="0" height="255" src="http://www.codeproject.com/KB/dotnet/6importentStepsDotNet/14.jpg" width="523" /&gt;&lt;br /&gt;&lt;h2&gt;&lt;a href="http://www.blogger.com/post-create.g?blogID=814396016109370747" name="Value types and reference types"&gt;Value types and reference types&lt;/a&gt;&lt;br /&gt;&lt;/h2&gt;Now that we have understood the concept of ‘Stack’ and ‘Heap’ it’s  time to understand the concept of value types and reference types.&lt;br /&gt;&lt;br /&gt;Value  types are types which hold both data and the memory on the same  location. While a reference type has a pointer which points to the  memory location.&lt;br /&gt;&lt;br /&gt;Below is a simple integer data type with name  ‘i’ whose value is assigned to an other integer data type with name ‘j’.  Both these memory values are allocated on the stack. &lt;br /&gt;&lt;br /&gt;When we  assign the ‘int’ value to the other ‘int’ value it creates a complete  different copy. In other word if you change either of them the other  does not change. These kinds of data types are called as ‘Value types’.&lt;br /&gt;&lt;img border="0" height="276" src="http://www.codeproject.com/KB/dotnet/6importentStepsDotNet/5.jpg" width="616" /&gt;&lt;br /&gt;When we create an object and when we assign one object to the other  object, they both point to the same memory location as show in the below  code snippet. So when we assign ‘obj’ to ‘obj1’ they both point to the  same memory location.&lt;br /&gt;&lt;br /&gt;In other words if we change one of them the other object is also affected this is termed as ‘Reference types’.&lt;br /&gt;&lt;br /&gt;&lt;img border="0" height="331" src="http://www.codeproject.com/KB/dotnet/6importentStepsDotNet/6.jpg" width="616" /&gt;&lt;br /&gt;&lt;h2&gt;&lt;a href="http://www.blogger.com/post-create.g?blogID=814396016109370747" name="So which data types are ref type and value type"&gt;So which data types are ref type and value type?&lt;/a&gt;&lt;br /&gt;&lt;/h2&gt;In .NET depending on data types the variable is either assigned on  the stack or on the heap. ‘String’ and ‘Objects’ are reference types and  any other .NET primitive data types are assigned on the stack. Below  figure explains the same in a more detail manner.&lt;br /&gt;&lt;img border="0" height="431" src="http://www.codeproject.com/KB/dotnet/6importentStepsDotNet/7.jpg" width="580" /&gt;&lt;br /&gt;&lt;h2&gt;&lt;a href="http://www.blogger.com/post-create.g?blogID=814396016109370747" name="Boxing and Unboxing"&gt;Boxing and Unboxing&lt;/a&gt;&lt;br /&gt;&lt;/h2&gt;WOW, you have given so much knowledge, so what’s the use of it in  actual programming. One of the biggest implications is to understand the  performance hit which is incurred due to data moving from stack to heap  and vice versa. &lt;br /&gt;&lt;br /&gt;Consider the below code snippet. When we move a  value type to reference type the data is moved from the stack to the  heap. When we move reference type to a value type the data is moved from  the heap to the stack.&lt;br /&gt;&lt;br /&gt;This movement of data from the heap to stack and vice-versa creates a performance hit. &lt;br /&gt;&lt;br /&gt;When the data moves from value types to reference types its termed as ‘Boxing’ and the vice versa is termed as ‘UnBoxing’.&lt;br /&gt;&lt;img border="0" height="500" src="http://www.codeproject.com/KB/dotnet/6importentStepsDotNet/8.jpg" width="679" /&gt;&lt;br /&gt;If you compile the above code and see the same in ILDASM you can see  in the IL code how ‘boxing’ and ‘unboxing’ looks, below figure  demonstrates the same.&lt;br /&gt;&lt;img border="0" height="344" src="http://www.codeproject.com/KB/dotnet/6importentStepsDotNet/9.jpg" width="580" /&gt;&lt;br /&gt;&lt;h2&gt;&lt;a href="http://www.blogger.com/post-create.g?blogID=814396016109370747" name="Performance implication of Boxing and unboxing"&gt;Performance implication of Boxing and unboxing&lt;/a&gt;&lt;br /&gt;&lt;/h2&gt;In order to see how the performance is impacted we ran the below two  functions 10,000 times. One function has boxing and the other function  is simple. We used a stop watch object to monitor the time taken. &lt;br /&gt;&lt;br /&gt;The  boxing function was executed in 3542 MS while without boxing the code  was executed in 2477 MS. In other words try to avoid boxing and  unboxing. In project you always need boxing and unboxing , use it when  it’s absolutely necessary.&lt;br /&gt;&lt;br /&gt;With the same article the sample code is attached which demonstrates this performance implication.&lt;br /&gt;&lt;img border="0" height="344" src="http://www.codeproject.com/KB/dotnet/6importentStepsDotNet/10.jpg" width="650" /&gt;&lt;br /&gt;Currently I have not put a source code for unboxing but the same hold  true for the same. You can write the same and experiment it by using  stopwatch class.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/814396016109370747-5826634526882934087?l=amitshinde14.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://amitshinde14.blogspot.com/2012/02/6-important-net-concepts-stack-heap.html</link><author>noreply@blogger.com (Amit Kumar Shinde)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-814396016109370747.post-3590134488682640724</guid><pubDate>Tue, 28 Feb 2012 06:06:00 +0000</pubDate><atom:updated>2012-02-27T22:06:07.601-08:00</atom:updated><title>Top 10 Best Practices for Production ASP.NET Applications</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;h2&gt;1.&amp;nbsp; Generate new encryption keys&lt;/h2&gt;When moving an application  to production for the first time it is a good idea to generate new  encryption keys.&amp;nbsp; This includes the machine validation key and  decryption key as well as any other custom keys your application may be  using.&amp;nbsp; There is &lt;a href="http://www.codeproject.com/KB/aspnet/machineKey.aspx" target="_blank" title="ASP.NET machineKey Generator"&gt;an article on CodeProject&lt;/a&gt; that talks about generating machineKeys specifically that should be helpful with this.&lt;br /&gt;&lt;h2&gt;2.&amp;nbsp; Encrypt sensitive sections of your web.config&lt;/h2&gt;This includes both the connection string and machine key sections.&amp;nbsp; See &lt;a href="http://weblogs.asp.net/scottgu/archive/2006/01/09/434893.aspx" target="_blank" title="Encrypting Web.Config Values in ASP.NET 2.0"&gt;Scott Guthrie's post&lt;/a&gt;  for some good references.&amp;nbsp; Note that if your application runs in a  clustered environment you will need to share a custom key using the RSA  provider as described in an &lt;a href="http://msdn2.microsoft.com/en-us/library/68ze1hb2%28VS.80%29.aspx" target="_blank" title="Specifying a Protected Configuration Provider"&gt;MSDN article&lt;/a&gt;.&lt;br /&gt;&lt;h2&gt;3.&amp;nbsp; Use trusted SQL connections&lt;/h2&gt;Both &lt;a href="http://idunno.org/articles/276.aspx" target="_blank" title="Using SQL trusted Connections with ASP.NET"&gt;Barry Dorrans&lt;/a&gt; and &lt;a href="http://weblogs.asp.net/achang/archive/2004/04/15/113866.aspx" target="_blank" title="How to use Trusted Connection when SQL server and web Server are on two separate machines"&gt;Alex Chang&lt;/a&gt; have articles which discuss this in detail.&lt;br /&gt;&lt;h2&gt;4.&amp;nbsp; Set retail="true" in your machine.config&lt;/h2&gt;&lt;ol&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;configuration&lt;/span&gt;&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;system.web&lt;/span&gt;&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;deployment&lt;/span&gt;&lt;span&gt;retail&lt;/span&gt;=&lt;span&gt;"true"&lt;/span&gt;&lt;span&gt;/&amp;gt;&lt;/span&gt;&lt;span&gt;&lt;!--&lt;/span--&gt;&lt;span&gt;system.web&lt;/span&gt;&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&lt;!--&lt;/span--&gt;&lt;span&gt;configuration&lt;/span&gt;&lt;span&gt;&amp;gt;&lt;/span&gt;This  will kill three birds with one stone.&amp;nbsp; It will force the 'debug' flag  in the web.config to be false,&amp;nbsp; it will disable page output tracing,  and&amp;nbsp; it will force the custom error page to be shown to remote users  rather than the actual exception or error message.&amp;nbsp; For more information  you can read &lt;a href="http://weblogs.asp.net/scottgu/archive/2006/04/11/442448.aspx" target="_blank" title="Don't run production ASP.NET Applications with debug=&amp;quot;true&amp;quot; enabled, by Scott Guthrie"&gt;Scott Guthrie's post&lt;/a&gt; or the &lt;a href="http://msdn2.microsoft.com/en-us/library/ms228298%28VS.80%29.aspx" target="_blank" title="maching.config deployment element (ASP.NET Settings Schema)"&gt;MSDN reference&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/ol&gt;&lt;h2&gt;5.&amp;nbsp; Create a new application pool for your site&lt;/h2&gt;When setting up your new site for the first time do not share an  existing application pool.&amp;nbsp; Create a new application pool which will be  used by only by the new web application.&lt;br /&gt;&lt;h2&gt;6.&amp;nbsp; Set the memory limit for your application pool&lt;/h2&gt;When creating the application pool, specifically set the memory limit rather than the time limit which is set by default.&amp;nbsp; &lt;a href="http://www.asp.net/" target="_blank"&gt;Asp.net&lt;/a&gt; has a &lt;a href="http://www.asp.net/learn/whitepapers/aspnet-and-iis6/" target="_blank" title="Running ASP.NET 1.1 with IIS 6.0"&gt;good whitepaper&lt;/a&gt; which explains the value of this:&lt;br /&gt;&lt;blockquote&gt; By default IIS 6.0 does not set a limit on the amount of memory that  IIS is allowed to use. ASP.NET’s Cache feature relies on a limitation of  memory so the Cache can proactively remove unused items from memory.  &lt;br /&gt;It is recommended that you configure the memory recycling feature of IIS 6.0.&lt;/blockquote&gt;&lt;h2&gt;7.&amp;nbsp; Create and appropriately use an app_Offline.htm file&lt;/h2&gt;There are many benefits to using this file.&amp;nbsp; It provides an easy way  to take your application offline in a somewhat user friendly way (you  can at least have a pretty explanation) while fixing critical issues or  pushing a major update.&amp;nbsp; It also forces an application restart in case  you forget to do this for a deployment.&amp;nbsp; Once again, ScottGu is the &lt;a href="http://weblogs.asp.net/scottgu/archive/2006/04/09/442332.aspx" target="_blank" title="App_Offline.htm and working around the &amp;quot;IE Friendly Errors&amp;quot; feature"&gt;best source&lt;/a&gt; for more information on this.&lt;br /&gt;&lt;h2&gt;8.&amp;nbsp; Develop a repeatable deployment process and automate it&lt;/h2&gt;It is way too easy to make mistakes when deploying any type of  software.&amp;nbsp; This is especially the case with software that uses  configuration files that may be different between the development,  staging, or production environments.&amp;nbsp; I would argue that the process you  come up with is not nearly as important as it being easily repeatable  and automated.&amp;nbsp; You can fine tune the process as needed, but you don't  want a simple typo to bring a site down.&lt;br /&gt;&lt;h2&gt;9.&amp;nbsp; Build and reference release versions of all assemblies&lt;/h2&gt;In addition to making sure ASP.NET is not configured in debug mode,  also make sure that your assemblies are not debug assemblies.&amp;nbsp; There are  of course exceptions if you are trying to solve a unique issue in your  production environment ... but in most cases you should always deploy  with release builds for all assemblies.&lt;br /&gt;&lt;h2&gt;10.&amp;nbsp; Load test&lt;/h2&gt;This goes without saying.&amp;nbsp; Inevitably, good load testing will uncover threading and memory issues not otherwise considered.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/814396016109370747-3590134488682640724?l=amitshinde14.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://amitshinde14.blogspot.com/2012/02/top-10-best-practices-for-production.html</link><author>noreply@blogger.com (Amit Kumar Shinde)</author><thr:total>0</thr:total></item></channel></rss>