<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5307194740548566318</id><updated>2024-09-13T08:09:30.044-07:00</updated><category term="A delegate in C#"/><category term="ACID"/><category term="Caching in ASP.NET"/><category term="Handle back button of the browser"/><category term="SESSION in asp.net"/><category term="caputure user cantrol button click event in aspx page"/><category term="execute scaler and execute non querry"/><category term="net framework"/><title type='text'>Interview question</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>29</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5307194740548566318.post-4516903775761543206</id><published>2020-11-28T02:27:00.004-08:00</published><updated>2020-11-28T02:27:46.617-08:00</updated><title type='text'>Best Book for AIEEE</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt;

Best Book for AIEEE



&lt;iframe style=&quot;width:120px;height:240px;&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; src=&quot;//ws-in.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&amp;OneJS=1&amp;Operation=GetAdHtml&amp;MarketPlace=IN&amp;source=ac&amp;ref=qf_sp_asin_til&amp;ad_type=product_link&amp;tracking_id=kamlesh2222-21&amp;marketplace=amazon&amp;region=IN&amp;placement=9388919769&amp;asins=9388919769&amp;linkId=57af235d3db2367991d498c6cbf7c8d3&amp;show_border=false&amp;link_opens_in_new_window=false&amp;price_color=333333&amp;title_color=0066C0&amp;bg_color=FFFFFF&quot;&gt;
    &lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/4516903775761543206/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allinterview-question.blogspot.com/2020/11/best-book-for-aieee.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/4516903775761543206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/4516903775761543206'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/2020/11/best-book-for-aieee.html' title='Best Book for AIEEE'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5307194740548566318.post-3601366128597954442</id><published>2011-07-20T02:35:00.001-07:00</published><updated>2011-07-20T02:35:19.714-07:00</updated><title type='text'>Three Tier Architecture in ASP.NET</title><content type='html'>&lt;h1 style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 12.0pt;&quot;&gt;Three Tier Architecture in ASP.NET&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;&lt;div class=&quot;articletext&quot; style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;3-tier application is a program which is organized into three major disjunctive tiers on layers. Here we can see that how these layers increase the reusability of codes. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;These layers are described below.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;articletext&quot; style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;1. Application layer or Business layer&lt;br /&gt;
2. Business layer&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;a. Property layer(Sub layer of business layer)&lt;br /&gt;
3. data layer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2 style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Advantages of three Tier Architecture.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div class=&quot;articletext&quot; style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;The main characteristic of a Host Architecture is that the application and databases reside on the same host computer and the user interacts with the host using an unfriendly and dump terminal. This architecture does not support distributed computing (the host applications are not able to connect a database of a strategically allied partner). Some managers found that developing a host application take too long and it is expensive. Consequently led these disadvantages to Client-Server architecture.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;articletext&quot; style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;Client-Server architecture is 2-Tier architecture because the client does not distinguish between Presentation layer and business layer. The increasing demands on GUI controls caused difficulty to manage the mixture of source code from GUI and Business Logic (Spaghetti Code). Further, Client Server Architecture does not support enough the Change Management. Let suppose that the government increases the Entertainment tax rate from 4% to 8 %, then in the Client-Server case, we have to send an update to each clients and they must update synchronously on a specific time otherwise we may store invalid or wrong information. The Client-Server Architecture is also a burden to network traffic and resources. Let us assume that about five hundred clients are working on a data server then we will have five hundred ODBC connections and several ruffian record sets, which must be transported from the server to the clients (because the Business layer is stayed in the client side). The fact that Client-Server does not have any caching facilities like in ASP.NET, caused additional traffic in the network. Normally, a server has a better hardware than client therefore it is able compute algorithms faster than a client, so this fact is also an additional pro argument for the 3.Tier Architecture. This categorization of the application makes the function more reusable easily and it becomes too easy to find the functions which have been written previously. If programmer wants to make further update in the application then he easily can understand the previous written code and can update easily.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2 style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Application layer or Presentation layer&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div class=&quot;articletext&quot; style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;Application layer is the form which provides the user interface to either programmer of end user. Programmer uses this layer for designing purpose and to get or set the data back and forth.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;margin-right: 3.75pt; text-align: center;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shapetype
 id=&quot;_x0000_t75&quot; coordsize=&quot;21600,21600&quot; o:spt=&quot;75&quot; o:preferrelative=&quot;t&quot;
 path=&quot;m@4@5l@4@11@9@11@9@5xe&quot; filled=&quot;f&quot; stroked=&quot;f&quot;&gt;  &lt;v:stroke joinstyle=&quot;miter&quot;/&gt;  &lt;v:formulas&gt;   &lt;v:f eqn=&quot;if lineDrawn pixelLineWidth 0&quot;/&gt;   &lt;v:f eqn=&quot;sum @0 1 0&quot;/&gt;   &lt;v:f eqn=&quot;sum 0 0 @1&quot;/&gt;   &lt;v:f eqn=&quot;prod @2 1 2&quot;/&gt;   &lt;v:f eqn=&quot;prod @3 21600 pixelWidth&quot;/&gt;   &lt;v:f eqn=&quot;prod @3 21600 pixelHeight&quot;/&gt;   &lt;v:f eqn=&quot;sum @0 0 1&quot;/&gt;   &lt;v:f eqn=&quot;prod @6 1 2&quot;/&gt;   &lt;v:f eqn=&quot;prod @7 21600 pixelWidth&quot;/&gt;   &lt;v:f eqn=&quot;sum @8 21600 0&quot;/&gt;   &lt;v:f eqn=&quot;prod @7 21600 pixelHeight&quot;/&gt;   &lt;v:f eqn=&quot;sum @10 21600 0&quot;/&gt;  &lt;/v:formulas&gt;  &lt;v:path o:extrusionok=&quot;f&quot; gradientshapeok=&quot;t&quot; o:connecttype=&quot;rect&quot;/&gt;  &lt;o:lock v:ext=&quot;edit&quot; aspectratio=&quot;t&quot;/&gt; &lt;/v:shapetype&gt;&lt;v:shape id=&quot;_x0000_i1026&quot; type=&quot;#_x0000_t75&quot; alt=&quot;&quot; style=&#39;width:366.75pt;
 height:242.25pt&#39;&gt;  &lt;v:imagedata src=&quot;file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\16\clip_image001.jpg&quot;
  o:href=&quot;http://www.beansoftware.com/ASP.NET-Tutorials/Images/Three-Tier-Presentation-Layer.jpg&quot;/&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img height=&quot;323&quot; src=&quot;file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/msohtml1/16/clip_image002.jpg&quot; v:shapes=&quot;_x0000_i1026&quot; width=&quot;489&quot; /&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2 style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Business layer&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div class=&quot;articletext&quot; style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;This layer is a class which we use to write the function which works as a mediator to transfer the data from Application or presentation layer data layer. In the three tier architecture we never let the data access layer to interact with the presentation layer.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2 style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;a. Property Layer&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div class=&quot;articletext&quot; style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;This layer is also a class where we declare the variable corresponding to the fields of the database which can be required for the application and make the properties so that we can get or set the data using these properties into the variables. These properties are public so that we can access its values.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2 style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Data Access Layer&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;This layer is also a class which we use to get or set the data to the database back and forth. This layer only interacts with the database. We write the database queries or use stored procedures to access the data from the database or to perform any operation to the database. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2 style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Summary&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;margin-right: 3.75pt; text-align: center;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape
 id=&quot;_x0000_i1025&quot; type=&quot;#_x0000_t75&quot; alt=&quot;&quot; style=&#39;width:368.25pt;height:147.75pt&#39;&gt;  &lt;v:imagedata src=&quot;file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\16\clip_image003.jpg&quot;
  o:href=&quot;http://www.beansoftware.com/ASP.NET-Tutorials/Images/Three-Tier-Diagram.jpg&quot;/&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img height=&quot;197&quot; src=&quot;file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/msohtml1/16/clip_image003.jpg&quot; v:shapes=&quot;_x0000_i1025&quot; width=&quot;491&quot; /&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;articletext&quot; style=&quot;margin-bottom: 5.0pt; margin-left: .5in; margin-right: 3.75pt; margin-top: 5.0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 8.0pt; mso-fareast-font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;o&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;Application layer is the form where we design using the controls like textbox, labels, command buttons etc.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;articletext&quot; style=&quot;margin-bottom: 5.0pt; margin-left: .5in; margin-right: 3.75pt; margin-top: 5.0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 8.0pt; mso-fareast-font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;o&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;Business layer is the class where we write the functions which get the data from the application layer and passes through the data access layer.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;articletext&quot; style=&quot;margin-bottom: 5.0pt; margin-left: .5in; margin-right: 3.75pt; margin-top: 5.0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 8.0pt; mso-fareast-font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;o&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;Data layer is also the class which gets the data from the business layer and sends it to the database or gets the data from the database and sends it to the business layer.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;articletext&quot; style=&quot;margin-bottom: 5.0pt; margin-left: .5in; margin-right: 3.75pt; margin-top: 5.0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 8.0pt; mso-fareast-font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;o&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;Property layer is the sub layer of the business layer in which we make the properties to sent or get the values from the application layer. These properties help to sustain the value in a object so that we can get these values till the object destroy.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2 style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Data flow from application layer to data layer&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div class=&quot;articletext&quot; style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;You can download sample &lt;a href=&quot;http://www.beansoftware.com/ASP.NET-Tutorials/Examples/Three-Tier.zip&quot;&gt;three tier project&lt;/a&gt;, used for this tutorial. Here we are passing the code of the student to the business layer and on the behalf of that getting the data from the database which is being displayed on the application layer.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;articletext&quot; style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;Presentation Layer:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;articletext&quot; style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; DataGrid1_SelectedIndexChanged(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, System.EventArgs e)&lt;br /&gt;
{&lt;br /&gt;
&lt;span style=&quot;color: #339933;&quot;&gt;// Object of the Property layer&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clsStudent objproperty=&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; clsStudent();&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #339933;&quot;&gt;// Object of the business layer&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clsStudentInfo objbs=&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; clsStudentInfo();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #339933;&quot;&gt;// Object of the dataset in which we receive the data sent by the business layer&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataSet ds=&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; DataSet();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #339933;&quot;&gt;// here we are placing the value in the property â€œIDâ€&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #339933; font-family: Arial; font-size: 8.0pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #339933; font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt; using the object of the&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: #339933;&quot;&gt;&amp;nbsp;&amp;nbsp; property layer &lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objproperty.id=&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;.Parse(DataGrid1.SelectedItem.Cells[1].Text.ToString());&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #339933;&quot;&gt;// In ths following code we are calling a function from the business layer and &amp;nbsp;&amp;nbsp; passing the object of the property layer which will carry the ID till the&amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #339933;&quot;&gt;&amp;nbsp;&amp;nbsp; database.&lt;/span&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; ds=objbs.GetAllStudentBsIDWise(objproperty);&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #339933;&quot;&gt;// What ever the data has been returned by the above function into the dataset is &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #339933;&quot;&gt;&amp;nbsp;&amp;nbsp; being populate through the presentation laye.&lt;/span&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; txtId.Text=ds.Tables[0].Rows[0][0].ToString();&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; txtFname.Text=ds.Tables[0].Rows[0][1].ToString();&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; txtAddress.Text=ds.Tables[0].Rows[0][2].ToString();&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; txtemail.Text=ds.Tables[0].Rows[0][3].ToString();&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; Image1.ImageUrl=ds.Tables[0].Rows[0][4].ToString();&lt;br /&gt;
}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;articletext&quot; style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;Property Layer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;articletext&quot; style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;span style=&quot;color: #339933; font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;// These are the properties has been defined in the property layer. Using the object of the property layer we can set or get the data to or from these properties.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; clsStudent&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: green;&quot;&gt;// Class for Student Table&lt;/span&gt;&lt;br /&gt;
&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; &lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; _id;&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; &lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; _Name;&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; &lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; _Address;&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; &lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; _Email;&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; &lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; _Picture;&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; &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; &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; id // &lt;span style=&quot;color: green;&quot;&gt;Property to set or get the value into _id variable&lt;/span&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; {&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; &lt;span style=&quot;color: blue;&quot;&gt;get&lt;/span&gt;{&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; _id;}&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; &lt;span style=&quot;color: blue;&quot;&gt;set&lt;/span&gt;{_id=&lt;span style=&quot;color: blue;&quot;&gt;value&lt;/span&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; }&lt;br /&gt;
&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; &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; Name&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; {&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; &lt;span style=&quot;color: blue;&quot;&gt;get&lt;/span&gt;{&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; _Name;}&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; &lt;span style=&quot;color: blue;&quot;&gt;set&lt;/span&gt;{_Name=&lt;span style=&quot;color: blue;&quot;&gt;value&lt;/span&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; }&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; &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; Address&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; {&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; &lt;span style=&quot;color: blue;&quot;&gt;get&lt;/span&gt;{&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; _Address;}&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; &lt;span style=&quot;color: blue;&quot;&gt;set&lt;/span&gt;{_Address=&lt;span style=&quot;color: blue;&quot;&gt;value&lt;/span&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; }&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; &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; &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; Email&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; {&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; &lt;span style=&quot;color: blue;&quot;&gt;get&lt;/span&gt;{&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; _Email;}&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; &lt;span style=&quot;color: blue;&quot;&gt;set&lt;/span&gt;{_Email=&lt;span style=&quot;color: blue;&quot;&gt;value&lt;/span&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; }&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; &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; Picture&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; {&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; &lt;span style=&quot;color: blue;&quot;&gt;get&lt;/span&gt;{&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; _Picture;}&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; &lt;span style=&quot;color: blue;&quot;&gt;set&lt;/span&gt;{ _Picture=&lt;span style=&quot;color: blue;&quot;&gt;value&lt;/span&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; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;articletext&quot; style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;Business Layer:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;articletext&quot; style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&quot;Obj&quot; is the object of the clsStudent class has been defined in the property layer. This function is receiving the property object and passing it to the datalayer class&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;articletext&quot; style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;span style=&quot;color: #339933; font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;// this is the function of the business layer which accepts the data from the application layer and passes it to the data layer.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: #339933;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; clsStudentInfo&lt;br /&gt;
{&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; DataSet GetAllStudentBsIDWise(clsStudent obj)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataSet ds=&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; DataSet();&lt;br /&gt;
ds=objdt.getdata_dtIDWise(obj);&lt;span style=&quot;color: green;&quot;&gt;// Calling of Data layer function&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; ds;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
}&lt;br /&gt;
}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;articletext&quot; style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;Datalayer Layer&lt;/span&gt;&lt;/strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;articletext&quot; style=&quot;margin-right: 3.75pt;&quot;&gt;&lt;span style=&quot;color: #339933; font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;// this is the datalayer function which is receiving the data from the business layer and &lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: #339933;&quot;&gt;&amp;nbsp;&amp;nbsp; performing the required operation into the database&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; clsStudentData &lt;span style=&quot;color: green;&quot;&gt;// Data layer class&lt;/span&gt;&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; DataSet getdata_dtIDWise(clsStudent obj)&lt;span style=&quot;color: green;&quot;&gt; // object of property layer class &lt;/span&gt;&lt;br /&gt;
&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; DataSet ds;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; sql;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sql=&quot;select * from student where StudentId=&quot;+obj.id+&quot; order by StudentId&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ds=&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; DataSet();&lt;br /&gt;
&lt;span style=&quot;color: #339933;&quot;&gt;// this is the datalayer function which accepts trhe sql query and performs the &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #339933;&quot;&gt;&amp;nbsp;&amp;nbsp; corresponding operation&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ds=objdt.ExecuteSql(sql);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; ds;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
} &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/3601366128597954442/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allinterview-question.blogspot.com/2011/07/three-tier-architecture-in-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/3601366128597954442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/3601366128597954442'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/2011/07/three-tier-architecture-in-aspnet.html' title='Three Tier Architecture in ASP.NET'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5307194740548566318.post-6797973782678920455</id><published>2011-07-20T02:34:00.001-07:00</published><updated>2011-07-20T02:34:41.268-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SESSION in asp.net"/><title type='text'>SESSION in asp.net</title><content type='html'>&lt;h2&gt;&lt;a href=&quot;&quot; name=&quot;2&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;What is Session ?&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Web is &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Stateless&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;, which means a new instance of the web page class is re-created each time the page is posted to the server. As we all know &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;HTTP is a stateless protocol&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;, it can&#39;t hold the client information on page. If user inserts some information, and move to the next page, that data will be lost and user would not able to retrieve the information. So what we need? we need to store information. Session provides that facility to store information on &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;server memory&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;. It can support any type of object to store along with our &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;custom &lt;/span&gt;&lt;/code&gt;&lt;span class=&quot;code-sdkkeyword&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;object&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;. For every client &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Session data store separately&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;, means session data is stored as per client basis. Have a look at the following diagram.&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div align=&quot;center&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shapetype id=&quot;_x0000_t75&quot;
 coordsize=&quot;21600,21600&quot; o:spt=&quot;75&quot; o:preferrelative=&quot;t&quot; path=&quot;m@4@5l@4@11@9@11@9@5xe&quot;
 filled=&quot;f&quot; stroked=&quot;f&quot;&gt;  &lt;v:stroke joinstyle=&quot;miter&quot;/&gt;  &lt;v:formulas&gt;   &lt;v:f eqn=&quot;if lineDrawn pixelLineWidth 0&quot;/&gt;   &lt;v:f eqn=&quot;sum @0 1 0&quot;/&gt;   &lt;v:f eqn=&quot;sum 0 0 @1&quot;/&gt;   &lt;v:f eqn=&quot;prod @2 1 2&quot;/&gt;   &lt;v:f eqn=&quot;prod @3 21600 pixelWidth&quot;/&gt;   &lt;v:f eqn=&quot;prod @3 21600 pixelHeight&quot;/&gt;   &lt;v:f eqn=&quot;sum @0 0 1&quot;/&gt;   &lt;v:f eqn=&quot;prod @6 1 2&quot;/&gt;   &lt;v:f eqn=&quot;prod @7 21600 pixelWidth&quot;/&gt;   &lt;v:f eqn=&quot;sum @8 21600 0&quot;/&gt;   &lt;v:f eqn=&quot;prod @7 21600 pixelHeight&quot;/&gt;   &lt;v:f eqn=&quot;sum @10 21600 0&quot;/&gt;  &lt;/v:formulas&gt;  &lt;v:path o:extrusionok=&quot;f&quot; gradientshapeok=&quot;t&quot; o:connecttype=&quot;rect&quot;/&gt;  &lt;o:lock v:ext=&quot;edit&quot; aspectratio=&quot;t&quot;/&gt; &lt;/v:shapetype&gt;&lt;v:shape id=&quot;_x0000_i1025&quot; type=&quot;#_x0000_t75&quot; alt=&quot;explor2.jpg&quot;
 style=&#39;width:184.5pt;height:171pt&#39;&gt;  &lt;v:imagedata src=&quot;file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\14\clip_image001.jpg&quot;
  o:href=&quot;http://www.codeproject.com/KB/aspnet/ExploringSession/explor2.jpg&quot;/&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img alt=&quot;explor2.jpg&quot; height=&quot;228&quot; src=&quot;file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/msohtml1/14/clip_image001.jpg&quot; v:shapes=&quot;_x0000_i1025&quot; width=&quot;246&quot; /&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;center&quot; style=&quot;text-align: center;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Fig : For every client session data store separately&lt;/span&gt;&lt;/strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;State Management using session is one of the asp.net best features, because it is secure, transparent from users and we can store any kind of object with in it. Along with advantages, some times session can causes performance issue for heavy traffic sites because its stored on server memory and clients read data from the server itself. Now lets have a look at the advantages and disadvantages of using session in our web application.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h2&gt;&lt;a href=&quot;&quot; name=&quot;3&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Advantages and Disadvantages of Session ?&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Following are the basic advantages and disadvantages of using session. I have describe in details with each type of session at later point of time.&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;code&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Advantages :&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul type=&quot;disc&quot;&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l5 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;It helps to maintain user states and data to all over      the application. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l5 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;It can easily be implemented and we can store any      kind of object.&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l5 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Stores every client data separately.&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l5 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Session is secure and transparent from user. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;code&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Disadvantages :&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul type=&quot;disc&quot;&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l6 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Performance overhead in case of large volume of user,      because of session data stored in server memory. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l6 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Overhead involved in serializing and De-Serializing      session Data. because In case of &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;StateServer &lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;and &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;SQLServer &lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;session mode we need to serialize the object before      store.&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Besides these, there are many advantages and disadvantages of session that are based of session Types. I have Discussed all of them.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h2&gt;&lt;a href=&quot;&quot; name=&quot;11&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;InPorc Session Mode :&lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;This is the default session mode in Asp.Net. Its stores session Information in &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Current Application Domain&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;. This is the best session mode which is based on web application Performance. But main disadvantage is that, It will lose the data if we restart the server. There are some more advantages and disadvantages of InProc session mode. I will come to those points again .&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h2&gt;&lt;a href=&quot;&quot; name=&quot;12&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Overview of InProc Session Mode : &lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;&lt;span style=&quot;mso-bookmark: 12;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;As I have already discussed&amp;nbsp; InProc mode session data will be stored on the current application domain. So It is easily and quickly available.&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div align=&quot;center&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;So, InProc session mode store its session data in a &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;memory &lt;/span&gt;&lt;/code&gt;&lt;span class=&quot;code-sdkkeyword&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;object&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt; on that &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;application domain&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;. This is handled by &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;worker process&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt; in application pool. So If we restart the server we will lose the session data. If Client request for the data , state provide read the data from &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;In-Memory&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt; Object and return it to the client. In &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;web.config&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt; we have to mention Session mode&amp;nbsp; and also we have to set the &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Timeout&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape
 id=&quot;_x0000_i1026&quot; type=&quot;#_x0000_t75&quot; alt=&quot;explor3.gif&quot; style=&#39;width:325.5pt;
 height:61.5pt&#39;&gt;  &lt;v:imagedata src=&quot;file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\14\clip_image002.gif&quot;
  o:href=&quot;http://www.codeproject.com/KB/aspnet/ExploringSession/explor3.gif&quot;/&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img alt=&quot;explor3.gif&quot; height=&quot;82&quot; src=&quot;file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/msohtml1/14/clip_image002.gif&quot; v:shapes=&quot;_x0000_i1026&quot; width=&quot;434&quot; /&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;This Session TimeOut Setting keeps session alive for 30 minute. This can be configurable from Code behind too.&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape
 id=&quot;preimg5&quot; o:spid=&quot;_x0000_i1027&quot; type=&quot;#_x0000_t75&quot; alt=&quot;&quot; style=&#39;width:6.75pt;
 height:6.75pt&#39;&gt;  &lt;v:imagedata src=&quot;file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\14\clip_image003.gif&quot;
  o:href=&quot;http://www.codeproject.com/images/minus.gif&quot;/&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img height=&quot;9&quot; src=&quot;file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/msohtml1/14/clip_image003.gif&quot; v:shapes=&quot;preimg5&quot; width=&quot;9&quot; /&gt;&lt;!--[endif]--&gt;Collapse&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Session.TimeOut=30&lt;strong&gt;&lt;span style=&quot;font-family: Verdana; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;;&lt;/span&gt;&lt;/strong&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&amp;nbsp;There are two type of session events available in asp.net &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Session_Start()&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt; and &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Session_End&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;. It is the only mode that supports the&lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt; Session_End() &lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;event. These events will call after the session timeout period is over. The general flow for the &lt;/span&gt;&lt;st1:place&gt;&lt;st1:placename&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;InProc&lt;/span&gt;&lt;/st1:placename&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt; &lt;/span&gt;&lt;st1:placename&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Session&lt;/span&gt;&lt;/st1:placename&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt; &lt;/span&gt;&lt;st1:placetype&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;State&lt;/span&gt;&lt;/st1:placetype&gt;&lt;/st1:place&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt; is some thing like this.&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div align=&quot;center&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id=&quot;_x0000_i1028&quot; type=&quot;#_x0000_t75&quot;
 alt=&quot;&quot; style=&#39;width:115.5pt;height:240.75pt&#39;&gt;  &lt;v:imagedata src=&quot;file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\14\clip_image004.jpg&quot;
  o:href=&quot;http://www.codeproject.com/KB/aspnet/ExploringSession/explor7.jpg&quot;/&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img height=&quot;321&quot; src=&quot;file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/msohtml1/14/clip_image004.jpg&quot; v:shapes=&quot;_x0000_i1028&quot; width=&quot;154&quot; /&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Now, when the &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Session_End()&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt; will call that depends on Session Time Out. This is a very fast mechanism because no serialization occurs for storing and retrieving data, and data are staying inside the same application domain.&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h2&gt;&lt;a href=&quot;&quot; name=&quot;13&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;When Should we use InProc Session Mode ?&lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;InProc is the default session mode. It can be very helpful for a &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;small web sites &lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;and where the number of &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;user are very less&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;, We should avoid InProc in case of &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Web Garden &lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;(I will come to this topic in details) Scenario . &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h2&gt;&lt;strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Advantages and Disadvantages&lt;/span&gt;&lt;/strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;&lt;a href=&quot;&quot; name=&quot;14&quot;&gt;&lt;/a&gt;&lt;code&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Advantages : &lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-left: .5in; mso-list: l3 level1 lfo3; tab-stops: list .5in; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 8.0pt; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;It store Session data in memory object of current application domain. So&amp;nbsp; accessing data is very fast and data is easily available. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: .5in; mso-list: l3 level1 lfo3; tab-stops: list .5in; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 8.0pt; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;There is not requirements of &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;serialization&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt; to store data in InProc Session Mode. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: .5in; mso-list: l3 level1 lfo3; tab-stops: list .5in; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 8.0pt; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Implementation is very easy, just similar to using &lt;/span&gt;&lt;st1:place&gt;&lt;st1:placename&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;View&lt;/span&gt;&lt;/st1:placename&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt; &lt;/span&gt;&lt;st1:placetype&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;State&lt;/span&gt;&lt;/st1:placetype&gt;&lt;/st1:place&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;Disadvantages :&lt;/span&gt;&lt;/strong&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt; &lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;although InProc Session is fastest, common and default mechanism, It has lots of limitation. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-left: .5in; mso-list: l1 level1 lfo4; tab-stops: list .5in; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 8.0pt; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;If the worker Process or application domain recycles all session data will be lost. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: .5in; mso-list: l1 level1 lfo4; tab-stops: list .5in; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 8.0pt; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Though its fastest, but more session data and more users can affects performance, because of memory. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: .5in; mso-list: l1 level1 lfo4; tab-stops: list .5in; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 8.0pt; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;we can&#39;t use it in &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;web Garden&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt; scenarios . &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: .5in; mso-list: l1 level1 lfo4; tab-stops: list .5in; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 8.0pt; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;This session mode is not suitable for &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;web farm&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt; scenarios also. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;So as per above discussion, we can conclude InProc is very fast session storing mechanism but suitable for small web application. InProc Session Data will get lost if we Restart the server, application domain recycles It is also not suitable for Web Farm and Web Garden Scenarios. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Now have a look that what are the other option&amp;nbsp; available to overcome these problem. First Come to StateServer Mode.&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h2&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Out-Proc Or &lt;/span&gt;&lt;/code&gt;&lt;a href=&quot;&quot; name=&quot;15&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;StateServer Session Mode :&lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;er uses a stand-alone &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Windows Services&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;, which is Independent to IIS and can also run on a separate server. This session state is totally managed by &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;aspnet_state.exe&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;. This server may runs on the same system, but it&#39;s out side of that main&amp;nbsp; application domain where your web application is running. This allow if you restart your asp.net process restarted your session data will be alive. This approaches has several disadvantages due to the overhead of &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;serialization and de-serialization&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;, its also increases the cost of data access because of every time when user retrieves session data, our application hits a different process.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div align=&quot;center&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id=&quot;_x0000_i1029&quot; type=&quot;#_x0000_t75&quot;
 alt=&quot;&quot; style=&#39;width:307.5pt;height:141.75pt&#39;&gt;  &lt;v:imagedata src=&quot;file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\14\clip_image005.jpg&quot;
  o:href=&quot;http://www.codeproject.com/KB/aspnet/ExploringSession/explor8.jpg&quot;/&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img height=&quot;189&quot; src=&quot;file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/msohtml1/14/clip_image005.jpg&quot; v:shapes=&quot;_x0000_i1029&quot; width=&quot;410&quot; /&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h3&gt;&lt;a href=&quot;&quot; name=&quot;20&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;Advantages and Disadvantages.&lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;&lt;span style=&quot;mso-bookmark: 20;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;So based on the above discussion &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Advantages :&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-left: .5in; mso-list: l4 level1 lfo5; tab-stops: list .5in; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 8.0pt; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Its keeps the data separate from IIS so, any Issue with IIS does not hamper Session data. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: .5in; mso-list: l4 level1 lfo5; tab-stops: list .5in; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 8.0pt; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;It is useful in web farm and web garden scenarios. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Disadvantages :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-left: .5in; mso-list: l2 level1 lfo6; tab-stops: list .5in; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 8.0pt; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Process is slow due to Serialization and De-Serialization &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: .5in; mso-list: l2 level1 lfo6; tab-stops: list .5in; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 8.0pt; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;State Server always need to be up and running. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;&quot; name=&quot;23&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;SQL Server Session Mode &lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;&lt;span style=&quot;mso-bookmark: 23;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;This session mode provide us more &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;secure&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt; and &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;reliable&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt; Session management in asp.net. In this session&amp;nbsp; mode, the Session data is&lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt; serialized&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt; and stored in the SQL Server database.&amp;nbsp; Main disadvantages of this session storage methods is &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;overhead related with Data Serialization and De-Serialization&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;. It is the best option for using in the &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;web farms&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;.&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;h3&gt;&lt;a href=&quot;&quot; name=&quot;25&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;Advantages and Disadvantages&lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Advantages :&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul type=&quot;disc&quot;&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l7 level1 lfo7; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Session data do not&amp;nbsp; affected if we restart the      IIS.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l7 level1 lfo7; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;It is the most reliable and secure session      management. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l7 level1 lfo7; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;It keeps data located centrally ,&amp;nbsp; It can be      easily accessible from other application. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l7 level1 lfo7; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;It is&amp;nbsp; very useful in web farm and web garden      scenarios. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Disadvantages :&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul type=&quot;disc&quot;&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo8; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Processing is very slow in nature. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo8; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Object serialization and de-serialization creates      overhead&amp;nbsp; for application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo8; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;As the session data is handled in different server,      so we have to take care of SQL server. It should be always up and running.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/6797973782678920455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allinterview-question.blogspot.com/2011/07/session-in-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/6797973782678920455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/6797973782678920455'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/2011/07/session-in-aspnet.html' title='SESSION in asp.net'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5307194740548566318.post-8664501374596873878</id><published>2011-07-20T02:33:00.003-07:00</published><updated>2011-07-20T02:33:51.169-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="net framework"/><title type='text'>net framework</title><content type='html'>&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN&quot; style=&quot;mso-ansi-language: EN;&quot;&gt;The &lt;b&gt;Microsoft .NET Framework&lt;/b&gt; is a software framework that can be installed on computers running Microsoft Windows operating systems. It includes a large library of coded solutions to common programming problems and a virtual machine that manages the execution of programs written specifically for the framework. The .NET Framework supports multiple programming languages in a manner that allows language interoperability, whereby each language can utilize code written in other languages; in particular, the .NET library is available to all the programming languages that .NET encompasses.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/8664501374596873878/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allinterview-question.blogspot.com/2011/07/net-framework.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/8664501374596873878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/8664501374596873878'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/2011/07/net-framework.html' title='net framework'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5307194740548566318.post-3766137028184612682</id><published>2011-07-20T02:33:00.001-07:00</published><updated>2011-07-20T02:33:08.077-07:00</updated><title type='text'>how to send email by gmail account with asp.net</title><content type='html'>&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 12.0pt;&quot;&gt;Here is an example on how to send HTML email from your ASP.NET page using your Google account.&lt;br /&gt;
&lt;br /&gt;
(This setup can be easily used to send messages via any other SMTP server that requires authentication).&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;Note&lt;/span&gt;: the code snippet assumes you have a Label component on Page with named lblMsg that will show &lt;br /&gt;
success/failure message to the user that is sending email.&lt;br /&gt;
(But this can be easily changed).&lt;/div&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&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; &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;SmtpClient&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; client = &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;SmtpClient&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&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; client.DeliveryMethod = &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;SmtpDeliveryMethod&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;.Network;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&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; client.EnableSsl = &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&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; client.Host = &lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;smtp.gmail.com&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&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; client.Port = 587;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&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; &lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;// setup Smtp authentication&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&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; System.Net.&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;NetworkCredential&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; credentials = &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;

&lt;span style=&quot;mso-spacerun: yes;&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; &lt;/span&gt;new&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; System.Net.&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;NetworkCredential&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;your_account@gmail.com&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;yourpassword&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&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; client.UseDefaultCredentials = &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&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; client.Credentials = credentials;&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;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&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; &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;MailMessage&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; msg = &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;MailMessage&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&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; msg.From = &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;MailAddress&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;your_account@gmail.com&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&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; msg.To.Add(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;MailAddress&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(&quot;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;destination_address@someserver.com&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&quot;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&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; msg.Subject = &lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;This is a test Email subject&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&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; msg.IsBodyHtml = &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&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; msg.Body = &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;.Format(&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;b&amp;gt;Test HTML Email&amp;lt;/b&amp;gt;&amp;lt;/body&amp;gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&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; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;try&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&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; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&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; client.Send(msg);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&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; lblMsg.Text = &lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Your message has been successfully sent.&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&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; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&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; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Exception&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; ex)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&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; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&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; lblMsg.ForeColor = &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Color&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;.Red;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&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; lblMsg.Text = &lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Error occured while sending your message.&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; + ex.Message;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #FFFEFF;&quot;&gt;&lt;span style=&quot;color: black;&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; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
Just make sure you dont overuse it, Google is our friend &lt;!--[if gte vml 1]&gt;&lt;v:shapetype
 id=&quot;_x0000_t75&quot; coordsize=&quot;21600,21600&quot; o:spt=&quot;75&quot; o:preferrelative=&quot;t&quot;
 path=&quot;m@4@5l@4@11@9@11@9@5xe&quot; filled=&quot;f&quot; stroked=&quot;f&quot;&gt;  &lt;v:stroke joinstyle=&quot;miter&quot;/&gt;  &lt;v:formulas&gt;   &lt;v:f eqn=&quot;if lineDrawn pixelLineWidth 0&quot;/&gt;   &lt;v:f eqn=&quot;sum @0 1 0&quot;/&gt;   &lt;v:f eqn=&quot;sum 0 0 @1&quot;/&gt;   &lt;v:f eqn=&quot;prod @2 1 2&quot;/&gt;   &lt;v:f eqn=&quot;prod @3 21600 pixelWidth&quot;/&gt;   &lt;v:f eqn=&quot;prod @3 21600 pixelHeight&quot;/&gt;   &lt;v:f eqn=&quot;sum @0 0 1&quot;/&gt;   &lt;v:f eqn=&quot;prod @6 1 2&quot;/&gt;   &lt;v:f eqn=&quot;prod @7 21600 pixelWidth&quot;/&gt;   &lt;v:f eqn=&quot;sum @8 21600 0&quot;/&gt;   &lt;v:f eqn=&quot;prod @7 21600 pixelHeight&quot;/&gt;   &lt;v:f eqn=&quot;sum @10 21600 0&quot;/&gt;  &lt;/v:formulas&gt;  &lt;v:path o:extrusionok=&quot;f&quot; gradientshapeok=&quot;t&quot; o:connecttype=&quot;rect&quot;/&gt;  &lt;o:lock v:ext=&quot;edit&quot; aspectratio=&quot;t&quot;/&gt; &lt;/v:shapetype&gt;&lt;v:shape id=&quot;_x0000_i1025&quot; type=&quot;#_x0000_t75&quot; alt=&quot;&quot; style=&#39;width:14.25pt;
 height:14.25pt&#39;&gt;  &lt;v:imagedata src=&quot;file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\12\clip_image001.gif&quot;
  o:href=&quot;http://www.aspdotnetfaq.com/fckeditor/editor/images/smiley/msn/angel_smile.gif&quot;/&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img height=&quot;19&quot; src=&quot;file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/msohtml1/12/clip_image001.gif&quot; v:shapes=&quot;_x0000_i1025&quot; width=&quot;19&quot; /&gt;&lt;!--[endif]--&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/3766137028184612682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allinterview-question.blogspot.com/2011/07/how-to-send-email-by-gmail-account-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/3766137028184612682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/3766137028184612682'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/2011/07/how-to-send-email-by-gmail-account-with.html' title='how to send email by gmail account with asp.net'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5307194740548566318.post-870821694801388486</id><published>2011-07-20T02:32:00.002-07:00</published><updated>2011-07-20T02:32:37.669-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="caputure user cantrol button click event in aspx page"/><title type='text'>how to caputure user cantrol button click event in aspx page</title><content type='html'>&lt;h3&gt;how to caputure user cantrol button click event in aspx page &lt;/h3&gt;&lt;div class=&quot;MsoNormal&quot;&gt;in ascx page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;using System;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;using System.Data;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;using System.Configuration;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;using System.Collections;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;using System.Web;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;using System.Web.Security;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;using System.Web.UI;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;using System.Web.UI.WebControls;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;using System.Web.UI.WebControls.WebParts;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;using System.Web.UI.HtmlControls;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;public partial class WebUserControl : System.Web.UI.UserControl&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;public event EventHandler obj;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;public string st&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;get&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;return this.TextBox1.Text;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;protected void Page_Load(object sender, EventArgs e)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;protected void Button1_Click(object sender, EventArgs e)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;obj(sender, e);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In aspx page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;
{&lt;br /&gt;
WebUserControl1.obj += new EventHandler(Button1_Click);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
protected void Button1_Click(object sender, EventArgs e)&lt;br /&gt;
{&lt;br /&gt;
Label1.Text = WebUserControl1.st;&lt;br /&gt;
&lt;br /&gt;
} &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/870821694801388486/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allinterview-question.blogspot.com/2011/07/how-to-caputure-user-cantrol-button.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/870821694801388486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/870821694801388486'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/2011/07/how-to-caputure-user-cantrol-button.html' title='how to caputure user cantrol button click event in aspx page'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5307194740548566318.post-7463497014271881484</id><published>2011-07-20T02:32:00.000-07:00</published><updated>2011-07-20T02:32:00.349-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Handle back button of the browser"/><title type='text'>Handle back button of the browser</title><content type='html'>&lt;h6&gt;Introduction&lt;/h6&gt;&lt;div class=&quot;MsoNormal&quot;&gt;How many time, it has happened with you that when your client has asked you to that end-user should not be allowed to go back to previous page using browsers back button? But the actual problem is we don&#39;t have any control on the browser&#39;s back button.&amp;nbsp;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: #2a2a2a;&quot;&gt;The “Back” browser button cannot be actually disabled by a web application as the browser security will not allow this. But yes there are number of workarounds using which we can achieve this functionality.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-size: 10.0pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #9900cc; font-size: 11.5pt;&quot;&gt;Solutions&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Using JavaScript, we can forward the user to the same page if user presses the back button of the browser. See the code below :&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;pre&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;&amp;lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot;&amp;gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;function GoBack()&lt;/pre&gt;&lt;pre&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;window.history.forward();&lt;/pre&gt;&lt;pre&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/pre&gt;&lt;pre&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Call this JavaScript function on the onload event of body tag.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;pre&gt;&amp;lt;body onload=&quot;GoBack();&quot;&amp;gt;&lt;/pre&gt;&lt;div style=&quot;line-height: 18.0pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: #2a2a2a; font-family: Verdana;&quot;&gt;This method will always redirect to the user on the current page itself.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: Verdana; font-size: 8.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 18.0pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: #2a2a2a; font-family: Verdana;&quot;&gt;For example, user is on page 1 and there is a link on Page 1 which takes user to Page 2. Now when user clicks on the link, browser redirects the control to Page 2.&amp;nbsp;Now from page 2 if user press back button of the browser then user will be redirect to the page 2 itself.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: Verdana; font-size: 8.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 18.0pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: #2a2a2a; font-family: Verdana;&quot;&gt;window.history contains the collection of the page visited by the user for particular browser session. As an alternative of window.history.forward(), one can also use&amp;nbsp;window.history.go(+1). As both are same.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: Verdana; font-size: 8.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 18.0pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: #2a2a2a; font-family: Verdana;&quot;&gt;But if we want to display web page expired warning on the click of back button as we normally see in all banking sites? Actually what happens is, when you press the back button, browser takes the page from cache and display it on screen. So if we want to show web page expired warning, we should not allow the browser to cache the page. We can achieve this via ASP.NET.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: Verdana; font-size: 8.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;span style=&quot;color: #2a2a2a;&quot;&gt;protected void Page_Load(object sender, EventArgs e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=&quot;color: #2a2a2a;&quot;&gt;{&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=&quot;color: #2a2a2a;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;Response.Cache.SetCacheability(HttpCacheability.NoCache);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=&quot;color: #2a2a2a;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div style=&quot;line-height: 18.0pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: #2a2a2a; font-family: Verdana;&quot;&gt;This code will not allow page to be cached.&amp;nbsp;But one problem with this approach is that this will only work when there are some dynamic content in the page. i.e. change any drop down box value and then try to press back button.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: Verdana; font-size: 8.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h6&gt;Conclusion&lt;/h6&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt;&quot;&gt;&lt;span style=&quot;color: #2a2a2a; font-family: Verdana;&quot;&gt;Your comments are always&amp;nbsp;appreciated.&amp;nbsp;If you can find out better solution then this please let me also know.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt;&quot;&gt;&lt;span style=&quot;color: #2a2a2a; font-family: Verdana;&quot;&gt;Enjoy...&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/7463497014271881484/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allinterview-question.blogspot.com/2011/07/handle-back-button-of-browser.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/7463497014271881484'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/7463497014271881484'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/2011/07/handle-back-button-of-browser.html' title='Handle back button of the browser'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5307194740548566318.post-5810452304302691052</id><published>2011-07-20T02:31:00.002-07:00</published><updated>2011-07-20T02:31:29.806-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="execute scaler and execute non querry"/><title type='text'>execute scaler and execute non querry</title><content type='html'>&lt;strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;ExecuteNonQuery&lt;/span&gt;&lt;/strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt; expects to run a command, or a stored procedure, that affects the state of the specified table. This means anything but a query command. You normally use this method to issue an INSERT, UPDATE, DELETE, CREATE, and SET statement.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;ExecuteNonQuery&lt;/span&gt;&lt;/strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt; returns only the number of rows affected by the command execution, or â€“1 should this information be unavailable. It doesn’t give you a chance to access any result set generated by the statement or the stored procedure. Actually, there’s really nothing to prevent you from using this method for a query command, but in this case you get neither the resultset nor the number of the affected rows.&lt;br /&gt;
cmd.Connection.Open();&lt;br /&gt;
nRecsAffected = cmd.ExecuteNonQuery();&lt;br /&gt;
cmd.Connection.Close();&lt;br /&gt;
// check the record(s) affected here&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;The number of affected rows is also made available through the RecordsAffected property of the SqlCommand object. This property equals â€“1 in case of errors or if a query command is executed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;ExecuteScalar&lt;/span&gt;&lt;/strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt; expects to run a query command, or more likely a stored procedure, that returns data. However, this method is different from ExecuteReader in that it just makes available, as a scalar value, the first column on the first row of the selected resultset.&lt;br /&gt;
cmd.Connection.Open();&lt;br /&gt;
Object o = cmd.ExecuteScalar(); cmd.Connection.Close();&lt;br /&gt;
// work on the scalar here&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;The method returns the value as a boxed object. It’s then up to you to unbox or cast that value to the proper, expected type.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;ExecuteScalar&lt;/span&gt;&lt;/strong&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt; turns out to be particularly useful when you have statistical or aggregate operations to accomplish on a certain amount of data. In these and similar circumstances, there is just one value that you might want to return back to the caller. Because of its use cases, you normally use this method on more or less complex stored procedures rather than on single SQL statements.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/5810452304302691052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allinterview-question.blogspot.com/2011/07/execute-scaler-and-execute-non-querry.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/5810452304302691052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/5810452304302691052'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/2011/07/execute-scaler-and-execute-non-querry.html' title='execute scaler and execute non querry'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5307194740548566318.post-2334302706017075415</id><published>2011-07-20T02:31:00.000-07:00</published><updated>2011-07-20T02:31:03.248-07:00</updated><title type='text'>Difference between Varchar &amp; Nvarchar in Sqlserver</title><content type='html'>&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-weight: bold;&quot;&gt;NCHAR&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt; and &lt;span style=&quot;mso-bidi-font-weight: bold;&quot;&gt;NVARCHAR&lt;/span&gt; data types are both Unicode character data types with a maximum length of 4,000 characters.&amp;nbsp; The main difference between these 2 data types is that an &lt;span style=&quot;mso-bidi-font-weight: bold;&quot;&gt;NCHAR&lt;/span&gt; data type is fixed-length while an &lt;span style=&quot;mso-bidi-font-weight: bold;&quot;&gt;NVARCHAR&lt;/span&gt; is variable-length.&amp;nbsp; If the number of characters entered in an &lt;span style=&quot;mso-bidi-font-weight: bold;&quot;&gt;NCHAR&lt;/span&gt; data type column is less than the specified column length, spaces are appended to it to fill up the whole length.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;Another difference is in the storage size wherein the storage size for &lt;span style=&quot;mso-bidi-font-weight: bold;&quot;&gt;NCHAR&lt;/span&gt; is two times &lt;i&gt;n&lt;/i&gt; bytes while for &lt;span style=&quot;mso-bidi-font-weight: bold;&quot;&gt;NVARCHAR&lt;/span&gt; is two times the number of characters entered (in bytes).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;You should use &lt;span style=&quot;mso-bidi-font-weight: bold;&quot;&gt;NCHAR&lt;/span&gt; data type when the data values in a column are expected to be consistently close to the same size.&amp;nbsp; On the other hand, you should use &lt;span style=&quot;mso-bidi-font-weight: bold;&quot;&gt;NVARCHAR&lt;/span&gt; when the data values in a column are expected to vary considerably in size.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: Verdana; font-size: 8.0pt;&quot;&gt;Varchar means Variable-length Character string.&lt;br /&gt;
Nvarchar will store Unicode characters.Both will be used all most for the same purpose but with little difference.&lt;br /&gt;
Varchar will store the 8-bit data in database where as Nvarchar will be stored as 16-bit data in Database.&lt;br /&gt;
In Sql server 2005&lt;br /&gt;
&lt;br /&gt;
The size for a table page is 8,196 bytes, and no one row in a table can be more than 8,060 characters.&lt;br /&gt;
This in turn limits the maximum size of a VARCHAR to 8,000 bytes.&lt;br /&gt;
Varchar (MAX) and Nvarchar (MAX). Varchar (MAX) can hold max of 2,147,483,648 characters and NVARCHAR (MAX) can hold 1,073,741,823 characters. We use Varchar instead of TEXT and NTEXT which cannot be used to passed as variables in a stored procedure where as Varchar (MAX) or Nvarchar (MAX) cannot have such restriction.&lt;br /&gt;
&lt;br /&gt;
If you&#39;re in the process of migrating an existing data design for SQL Server 2005, it might make sense to migrate some TEXT / NTEXT fields to VARCHAR (MAX) / NVARCHAR (MAX) types when appropriate.&lt;br /&gt;
&lt;br /&gt;
If you need Unicode support for a given data type, either now or soon enough, go with NVARCHAR. If you&#39;re sticking with 8-bit data for design or storage reasons, go with VARCHAR. Note that you can always migrate from VARCHAR to NVARCHAR at the cost of some room -- but you can&#39;t go the other way &#39;round. Also, because NVARCHAR involves fetching that much more data, it may prove to be slower depending on how many table pages must be retrieved for any given operation.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;varchar uses 8 bits per character. nvarchar is UNICODE, a double-byte&lt;br /&gt;
character set, requiring 16 bits to store each character. UNICODE can&lt;br /&gt;
handle languages that are difficult to impossible with single-byte&lt;br /&gt;
character sets such as ASCII. If you must support many languages&lt;br /&gt;
UNICODE is a very clean way to do it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/2334302706017075415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allinterview-question.blogspot.com/2011/07/difference-between-varchar-nvarchar-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/2334302706017075415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/2334302706017075415'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/2011/07/difference-between-varchar-nvarchar-in.html' title='Difference between Varchar &amp; Nvarchar in Sqlserver'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5307194740548566318.post-2020429086938287313</id><published>2011-07-20T02:30:00.001-07:00</published><updated>2011-07-20T02:30:31.807-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="A delegate in C#"/><title type='text'>A delegate in C#</title><content type='html'>&lt;span style=&quot;color: black; font-family: Verdana; font-size: 9.5pt;&quot;&gt;A delegate in C# is similar to a function pointer in C or C++. Using a delegate allows the programmer to encapsulate a reference to a method inside a delegate object. The delegate object can then be passed to code which can call the referenced method, without having to know at compile time which method will be invoked. Unlike function pointers in C or C++, delegates are object-oriented, type-safe, and secure. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: Verdana; font-size: 9.5pt;&quot;&gt;A delegate declaration defines a type that encapsulates a method with a particular set of arguments and return type. For static methods, a delegate object encapsulates the method to be called. For instance methods, a delegate object encapsulates both an instance and a method on the instance. If you have a delegate object and an appropriate set of arguments, you can invoke the delegate with the arguments. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: Verdana; font-size: 9.5pt;&quot;&gt;An interesting and useful property of a delegate is that it does not know or care about the class of the object that it references. Any object will do; all that matters is that the method&#39;s argument types and return type match the delegate&#39;s. This makes delegates perfectly suited for &quot;anonymous&quot; invocation. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: black; font-family: Verdana; font-size: 9.5pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;Note&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: 9.5pt;&quot;&gt;Delegates run under the caller&#39;s security permissions, not the declarer&#39;s permissions.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: 9.5pt;&quot;&gt;This tutorial includes two examples: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul type=&quot;disc&quot;&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;color: black; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.5pt;&quot;&gt;Example 1 shows how to declare, instantiate,      and call a delegate.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;color: black; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.5pt;&quot;&gt;Example 2 shows how to combine two delegates.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: 9.5pt;&quot;&gt;In addition, it discusses the following topics: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul type=&quot;disc&quot;&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;color: black; mso-list: l1 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.5pt;&quot;&gt;Delegates and Events&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;color: black; mso-list: l1 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.5pt;&quot;&gt;Delegates vs. Interfaces&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;border-left: solid #BBBBBB 1.0pt; border: none; mso-border-left-alt: solid #BBBBBB .75pt; padding: 0in 0in 0in 0in;&quot;&gt;  &lt;h4 style=&quot;border: none; mso-border-left-alt: solid #BBBBBB .75pt; mso-padding-alt: 0in 0in 0in 0in; padding: 0in;&quot;&gt;&lt;span style=&quot;font-size: 9.5pt;&quot;&gt;Example 1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;&lt;/div&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: 9.5pt;&quot;&gt;The following example illustrates declaring, instantiating, and using a delegate. The &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: black; font-size: 10.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;BookDB&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: 9.5pt;&quot;&gt; class encapsulates a bookstore database that maintains a database of books. It exposes a method &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: black; font-size: 10.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;ProcessPaperbackBooks&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: 9.5pt;&quot;&gt;, which finds all paperback books in the database and calls a delegate for each one. The &lt;b&gt;delegate&lt;/b&gt; type used is called &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: black; font-size: 10.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;ProcessBookDelegate&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: 9.5pt;&quot;&gt;. The &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: black; font-size: 10.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;Test&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: 9.5pt;&quot;&gt; class uses this class to print out the titles and average price of the paperback books.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: Verdana; font-size: 9.5pt;&quot;&gt;The use of delegates promotes good separation of functionality between the bookstore database and the client code. The client code has no knowledge of how the books are stored or how the bookstore code finds paperback books. The bookstore code has no knowledge of what processing is done on the paperback books after it finds them. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;// bookstore.cs&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;using System;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;// A set of classes for handling a bookstore:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;namespace Bookstore &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;using System.Collections;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// Describes a book in the book list:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public struct Book&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public string Title;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// Title of the book.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public string Author;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// Author of the book.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public decimal Price;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// Price of the book.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public bool Paperback;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// Is it paperback?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public Book(string title, string author, decimal price, bool paperBack)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Title = title;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Author = author;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Price = price;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Paperback = paperBack;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// Declare a delegate type for processing a book:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public delegate void ProcessBookDelegate(Book book);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// Maintains a book database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public class BookDB&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// List of all books in the database:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ArrayList list = new ArrayList();&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// Add a book to the database:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public void AddBook(string title, string author, decimal price, bool paperBack)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;list.Add(new Book(title, author, price, paperBack));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// Call a passed-in delegate on each paperback book to process it: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public void ProcessPaperbackBooks(ProcessBookDelegate processBook)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;foreach (Book b in list) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&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;if (b.Paperback)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// Calling the delegate:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&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; &lt;/span&gt;processBook(b);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;// Using the Bookstore classes:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;namespace BookTestClient&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;using Bookstore;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// Class to total and average prices of books:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;class PriceTotaller&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;int countBooks = 0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;decimal priceBooks = 0.0m;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;internal void AddBookToTotal(Book book)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;countBooks += 1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;priceBooks += book.Price;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;internal decimal AveragePrice()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;return priceBooks / countBooks;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// Class to test the book database:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;class Test&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// Print the title of the book.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;static void PrintTitle(Book b)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Console.WriteLine(&quot;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{0}&quot;, b.Title);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// Execution starts here.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;static void &lt;/span&gt;&lt;st1:place&gt;&lt;span style=&quot;color: black;&quot;&gt;Main&lt;/span&gt;&lt;/st1:place&gt;&lt;span style=&quot;color: black;&quot;&gt;()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;BookDB bookDB = new BookDB();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// Initialize the database with some books:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;AddBooks(bookDB);&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// Print all the titles of paperbacks:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Console.WriteLine(&quot;Paperback Book Titles:&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// Create a new delegate object associated with the static &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// method Test.PrintTitle:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;bookDB.ProcessPaperbackBooks(new ProcessBookDelegate(PrintTitle));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// Get the average price of a paperback by using&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// a PriceTotaller object:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;PriceTotaller totaller = new PriceTotaller();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// Create a new delegate object associated with the nonstatic &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// method AddBookToTotal on the object totaller:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;bookDB.ProcessPaperbackBooks(new ProcessBookDelegate(totaller.AddBookToTotal));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Console.WriteLine(&quot;Average Paperback Book Price: ${0:#.##}&quot;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&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;totaller.AveragePrice());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// Initialize the book database with some test books:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;static void AddBooks(BookDB bookDB)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;bookDB.AddBook(&quot;The C Programming Language&quot;, &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&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;&quot;Brian W. Kernighan and Dennis M. Ritchie&quot;, 19.95m, true);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;bookDB.AddBook(&quot;The Unicode Standard 2.0&quot;, &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&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;&quot;The Unicode Consortium&quot;, 39.95m, true);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;bookDB.AddBook(&quot;The MS-DOS Encyclopedia&quot;, &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&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;&quot;Ray Duncan&quot;, 129.95m, false);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;bookDB.AddBook(&quot;Dogbert&#39;s Clues for the Clueless&quot;, &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&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;&quot;Scott Adams&quot;, 12.00m, true);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;HTMLPreformatted1&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/2020429086938287313/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allinterview-question.blogspot.com/2011/07/delegate-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/2020429086938287313'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/2020429086938287313'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/2011/07/delegate-in-c.html' title='A delegate in C#'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5307194740548566318.post-4103536543774727825</id><published>2011-07-20T02:29:00.002-07:00</published><updated>2011-07-20T02:29:47.864-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Caching in ASP.NET"/><title type='text'>Caching in ASP.NET</title><content type='html'>&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Verdana; font-size: 8.0pt;&quot;&gt;Page Output Caching&lt;br /&gt;
&lt;br /&gt;
Page Fragment Caching&lt;br /&gt;
&lt;br /&gt;
Data Caching&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: blue; font-family: Verdana; font-size: 8.0pt;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Page Output Caching&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
This is a concept by virtue of which the output of pages is cached using an Output Cache engine and all subsequent requests are served from the cache. Whenever a new request comes, this engine would check if there is a corresponding cache entry for this page. If there is a cache hit, i.e., if the engine finds a corresponding cache entry for this page, the page is rendered from the cache, else, the page being requested is rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
This is particularly useful for pages that are static and thus do not change for a considerable period of time. &lt;br /&gt;
&lt;br /&gt;
Page output caching can be implemented in either of the following two ways:&lt;br /&gt;
&lt;br /&gt;
· At design time using the OutputCache directive&lt;br /&gt;
&lt;br /&gt;
· At runtime using the HttpPolicy class&lt;br /&gt;
&lt;br /&gt;
The following is the complete syntax of page output caching directive&lt;br /&gt;
&lt;br /&gt;
&amp;lt;%@ OutputCache Duration=&quot;no of seconds&quot;&lt;br /&gt;
Location=&quot;Any | Client | Downstream | Server | None&quot;&lt;br /&gt;
VaryByControl=&quot;control&quot; &lt;br /&gt;
VaryByCustom=&quot;browser |customstring&quot;&lt;br /&gt;
VaryByHeader=&quot;headers&quot;&lt;br /&gt;
VaryByParam=&quot;parameter&quot; %&amp;gt;The following statement is used to implement output caching in an aspx page at design time. The directive is placed at the top of the .aspx page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;%@OutputCache Duration=&quot;30&quot;&lt;br /&gt;
VaryByParam=&quot;none&quot; %&amp;gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue; font-family: Verdana; font-size: 8.0pt;&quot;&gt;&lt;br /&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Page Fragment Caching&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
This allows specific portions of the page to be cached rather than caching the whole page. This is useful in situations where we can have a page that contains both static and dynamic content. The following code depicts how this can be accomplished.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;%@ OutputCache Duration=&quot;15&quot;&lt;br /&gt;
VaryByControl=&quot;EmpID;DeptID&quot; VaryByParam=&quot;*&quot;%&amp;gt; This directive is placed at the top of any User Control (.axcx file).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;br /&gt;
Data Caching&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
The following code is an implementation of On-Demand caching. The method GetUserInfo checks to see if the data exists in the cache. If it is present, it is returned from the cache, else, the GetUserInfoFromDatabase method fills the DataSet from the database and then populates the Cache. &lt;br /&gt;
&lt;br /&gt;
public DataSet GetUserInfo() &lt;br /&gt;
{ &lt;br /&gt;
string cacheKey = &quot;UserInfo&quot;; &lt;br /&gt;
DataSet ds = Cache[cacheKey] as DataSet; &lt;br /&gt;
if (ds == null) &lt;br /&gt;
{ &lt;br /&gt;
ds = GetUserInfoFromDatabase(); &lt;br /&gt;
Cache.Insert(cacheKey, ds, null, NoAbsoluteExpiration, &lt;br /&gt;
TimeSpan.FromHours(15),CacheItemPriority.High, null); &lt;br /&gt;
} &lt;br /&gt;
return ds; &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
DataSet GetUserInfoFromDatabase() { &lt;br /&gt;
// Usual code to populate a data set from thedatabase. This data set &lt;br /&gt;
// object is then returned. &lt;br /&gt;
}&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/4103536543774727825/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allinterview-question.blogspot.com/2011/07/caching-in-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/4103536543774727825'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/4103536543774727825'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/2011/07/caching-in-aspnet.html' title='Caching in ASP.NET'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5307194740548566318.post-7654921969806982725</id><published>2011-07-20T02:29:00.000-07:00</published><updated>2011-07-20T02:29:04.517-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ACID"/><title type='text'>SQL SERVER – ACID (Atomicity, Consistency, Isolation, Durability)</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;&lt;span lang=&quot;EN&quot; style=&quot;mso-ansi-language: EN;&quot;&gt;ACID&lt;/span&gt;&lt;/strong&gt;&lt;span lang=&quot;EN&quot; style=&quot;mso-ansi-language: EN;&quot;&gt; (an acronymn for Atomicity Consistency Isolation Durability) is a concept that Database Professionals generally look for when evaluating databases and application architectures. For a reliable database all this four attributes should be achieved.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;&lt;span lang=&quot;EN&quot; style=&quot;mso-ansi-language: EN;&quot;&gt;Atomicity&lt;/span&gt;&lt;/strong&gt;&lt;span lang=&quot;EN&quot; style=&quot;mso-ansi-language: EN;&quot;&gt; is an all-or-none proposition.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;&lt;span lang=&quot;EN&quot; style=&quot;mso-ansi-language: EN;&quot;&gt;Consistency&lt;/span&gt;&lt;/strong&gt;&lt;span lang=&quot;EN&quot; style=&quot;mso-ansi-language: EN;&quot;&gt; guarantees that a transaction never leaves your database in a half-finished state.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;&lt;span lang=&quot;EN&quot; style=&quot;mso-ansi-language: EN;&quot;&gt;Isolation&lt;/span&gt;&lt;/strong&gt;&lt;span lang=&quot;EN&quot; style=&quot;mso-ansi-language: EN;&quot;&gt; keeps transactions separated from each other until they’re finished.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;&lt;span lang=&quot;EN&quot; style=&quot;mso-ansi-language: EN;&quot;&gt;Durability&lt;/span&gt;&lt;/strong&gt;&lt;span lang=&quot;EN&quot; style=&quot;mso-ansi-language: EN;&quot;&gt; guarantees that the database will keep track of pending changes in such a way that the server can recover from an abnormal termination.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;span lang=&quot;EN&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 12.0pt; mso-ansi-language: EN; mso-bidi-language: AR-SA; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-US;&quot;&gt;Above four rules are very important for any developers dealing with databases&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/7654921969806982725/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allinterview-question.blogspot.com/2011/07/sql-server-acid-atomicity-consistency.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/7654921969806982725'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/7654921969806982725'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/2011/07/sql-server-acid-atomicity-consistency.html' title='SQL SERVER – ACID (Atomicity, Consistency, Isolation, Durability)'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5307194740548566318.post-2176114738703168117</id><published>2011-04-22T23:06:00.001-07:00</published><updated>2011-04-22T23:06:29.240-07:00</updated><title type='text'>What is Option Strict used for?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Option Strict On&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt; enables            type checking at design time and&lt;/span&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;prevents            type mismatch bugs.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/2176114738703168117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/what-is-option-strict-used-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/2176114738703168117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/2176114738703168117'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/what-is-option-strict-used-for.html' title='What is Option Strict used for?'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5307194740548566318.post-7340509165964367674</id><published>2011-04-22T23:05:00.001-07:00</published><updated>2011-04-22T23:05:54.180-07:00</updated><title type='text'>What is the transport protocol you use to call a Web service?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;SOAP&amp;nbsp;(Simple Object Access Protocol) is the preferred protocol.&amp;nbsp;         &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/7340509165964367674/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/what-is-transport-protocol-you-use-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/7340509165964367674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/7340509165964367674'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/what-is-transport-protocol-you-use-to.html' title='What is the transport protocol you use to call a Web service?'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5307194740548566318.post-8012039071948320452</id><published>2011-04-22T03:48:00.000-07:00</published><updated>2011-04-22T03:48:01.284-07:00</updated><title type='text'>how does the cookies work in asp.net?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;we know Http is an state-less protocol which is required for interaction between clinet and server .&lt;br /&gt;
&lt;br /&gt;
so there is an need to remeber state of request raised by an&amp;nbsp;web browser&amp;nbsp;so that&lt;br /&gt;
web server&amp;nbsp;can recognize you have already previously visited or not.&lt;br /&gt;
&lt;br /&gt;
There are two types of&amp;nbsp;state management&amp;nbsp;techniques:&lt;br /&gt;
a) Client side&amp;nbsp;state management&lt;br /&gt;
b) Server - side statemanagement&lt;br /&gt;
&lt;br /&gt;
Using cookies comes under clinet side statemanagement .In HttpResponse we write&lt;br /&gt;
Cookie containing sessionId and other information within it.&lt;br /&gt;
&lt;br /&gt;
when a browser made a request to the&amp;nbsp;web server&amp;nbsp;the same cookie is sent  to the server where server recognize the session id and get other  information stored to it previously. &lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/8012039071948320452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/how-does-cookies-work-in-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/8012039071948320452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/8012039071948320452'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/how-does-cookies-work-in-aspnet.html' title='how does the cookies work in asp.net?'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5307194740548566318.post-4760924082987598466</id><published>2011-04-22T03:47:00.001-07:00</published><updated>2011-04-22T03:47:34.441-07:00</updated><title type='text'>How do you apply Themes to an entire application?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;span style=&quot;line-height: 115%;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;By specifying the theme in the web.config file. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;Eg: &amp;lt;configuration&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&amp;lt;system.web&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&amp;lt;pages theme=”BlueMoon” /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&amp;lt;/system.web&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&amp;lt;/configuration&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/4760924082987598466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/how-do-you-apply-themes-to-entire.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/4760924082987598466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/4760924082987598466'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/how-do-you-apply-themes-to-entire.html' title='How do you apply Themes to an entire application?'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5307194740548566318.post-865202141474446049</id><published>2011-04-22T03:46:00.000-07:00</published><updated>2011-04-22T03:46:09.857-07:00</updated><title type='text'>Which dll handles the request of .aspx page?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;When the Internet Information Service process (inetinfo.exe) receives an HTTP request, it uses the filename extension of the requested resource to determine which Internet Server Application Programming Interface (ISAPI) program to run to process the request. When the request is for an ASP.NET page (.aspx file), IIS passes the request to the ISAPI DLL capable of handling the request for ASP.NET pages, which is aspnet_isapi.dll.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/865202141474446049/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/which-dll-handles-request-of-aspx-page.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/865202141474446049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/865202141474446049'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/which-dll-handles-request-of-aspx-page.html' title='Which dll handles the request of .aspx page?'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5307194740548566318.post-2833507138876035641</id><published>2011-04-21T02:57:00.001-07:00</published><updated>2011-04-21T02:57:19.486-07:00</updated><title type='text'>What is marshalling? Explain types of marshalling.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Marshaling is a process of transforming or serializing data from one application           domain and exporting it to another application domain.&lt;br /&gt;
&lt;strong&gt;Two types of marshalling &lt;/strong&gt;         &lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;            &lt;strong&gt;Marshal by value:&lt;/strong&gt;           a copy of an object is created by the server and is passed and used by the            client.           &lt;/li&gt;
&lt;li&gt;            &lt;strong&gt;Marshal by reference:&lt;/strong&gt; the client creates a proxy to access the             object.&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/2833507138876035641/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/what-is-marshalling-explain-types-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/2833507138876035641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/2833507138876035641'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/what-is-marshalling-explain-types-of.html' title='What is marshalling? Explain types of marshalling.'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5307194740548566318.post-3263217015615527419</id><published>2011-04-21T02:56:00.000-07:00</published><updated>2011-04-21T02:56:02.793-07:00</updated><title type='text'>singleton architecture of Remoting -</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Singleton architecture is to be used when all the applications have to use or           share same data.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/3263217015615527419/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/singleton-architecture-of-remoting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/3263217015615527419'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/3263217015615527419'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/singleton-architecture-of-remoting.html' title='singleton architecture of Remoting -'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5307194740548566318.post-1387216713611780161</id><published>2011-04-21T02:54:00.000-07:00</published><updated>2011-04-21T02:54:39.198-07:00</updated><title type='text'>What is an application domain</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;It&#39;s a way in CLR to maintain a boundary between various applications to ensure           that they do not interfere in working of any other application. CLR acts as a           mini operating system where a single process may have various application           domains. &lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;   An operating system process can                have many ongoing application domains. Application Domains keep an                application separate. &lt;/span&gt;&lt;/span&gt;               &lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;   All objects created within the same                application scope are created within the same application domain.                &lt;/span&gt;&lt;/span&gt;               &lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;   Multiple application domains can                exist in a single operating system process,                &lt;/span&gt;&lt;/span&gt;               &lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;   Distinct memory address space                allocation by the OS is effective but expensive and it does not                satisfy to the numbers required for large web                servers.&lt;/span&gt;&lt;/span&gt;                &lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;   However, the CLR isolates an                application by managing the memory use of code running within the                application domain due to which the code cannot access memory                outside the boundaries of the                domain.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/1387216713611780161/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/what-is-application-domain.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/1387216713611780161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/1387216713611780161'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/what-is-application-domain.html' title='What is an application domain'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5307194740548566318.post-7373798802637496823</id><published>2011-04-21T02:52:00.001-07:00</published><updated>2011-04-21T02:52:30.595-07:00</updated><title type='text'>What is the Pre-Compilation feature of ASP.NET 2.0</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Previously, in ASP.NET, the pages and the code used to be compiled dynamically           and then cached so as to make the requests to access the page extremely           efficient. In ASP.NET 2.0, the pre-compilation feature is used with which an           entire site is precompiled before it is made available to users.&lt;br /&gt;
&amp;nbsp;There is a pre-defined folder structure for enabling the pre-compilation           feature:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;          App_Code: stores classes          &lt;/li&gt;
&lt;li&gt;          App_Themes: stores CSS files, Images, etc.          &lt;/li&gt;
&lt;li&gt;          App_Data: stores XML files, Text Files, etc.          &lt;/li&gt;
&lt;li&gt;          App_GlobalResources: stores all the resources at global level E.g. resx files,           etc          &lt;/li&gt;
&lt;li&gt;           App_LocalResources: stores all the resources at local/Page level&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/7373798802637496823/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/what-is-pre-compilation-feature-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/7373798802637496823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/7373798802637496823'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/what-is-pre-compilation-feature-of.html' title='What is the Pre-Compilation feature of ASP.NET 2.0'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5307194740548566318.post-3936154904358924678</id><published>2011-04-21T02:51:00.001-07:00</published><updated>2011-04-21T02:51:27.072-07:00</updated><title type='text'>What is the difference between URL and URI</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;A &lt;i&gt;URL &lt;/i&gt;(Uniform Resource Locator) is the address of some resource on the Web. A           resource is nothing but a page of a site. There are other type of resources           than Web pages, but that&#39;s the easiest conceptually.&amp;nbsp;&lt;br /&gt;
A &lt;i&gt;URI&lt;/i&gt; is a unique identifier to usually a namespace.          &lt;br /&gt;
Though it looks like a URL but it doesn’t have to necessarily locate any           resource on the web.         &lt;br /&gt;
URI is a generic term. URL is a type of URI.&lt;br /&gt;
&lt;br /&gt;
______________&lt;br /&gt;
&lt;strong&gt;URI &lt;/strong&gt;- Uniform Resource Identifier: it’s a string and its           responsibility is to identify a resource by meta-information. It gives           information about only one resource.         &lt;br /&gt;
&lt;strong&gt;URL&lt;/strong&gt; - Uniform Resource Locator: identifies the resource on the           net and tells it is obtainable using what protocols.         &lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/3936154904358924678/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/what-is-difference-between-url-and-uri.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/3936154904358924678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/3936154904358924678'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/what-is-difference-between-url-and-uri.html' title='What is the difference between URL and URI'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5307194740548566318.post-5021732093713454487</id><published>2011-04-21T02:50:00.001-07:00</published><updated>2011-04-21T02:50:34.322-07:00</updated><title type='text'>Difference between src and Code-Behind</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Src: is a way mention the name of the code-behind class to dynamically compile           on the request for a page.         &lt;br /&gt;
Code-behind: is the logic written behind the UI design file. It specifies the          name of the compiled file that contains the class. Code-behind attribute is          only used for.Net.         &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/5021732093713454487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/difference-between-src-and-code-behind.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/5021732093713454487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/5021732093713454487'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/difference-between-src-and-code-behind.html' title='Difference between src and Code-Behind'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5307194740548566318.post-6448585743286647965</id><published>2011-04-21T02:49:00.000-07:00</published><updated>2011-04-21T02:49:11.801-07:00</updated><title type='text'>What is a ViewState?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;b&gt;Viewstate&lt;/b&gt; is used to maintain or retain values on postback. It helps in           preserving a page. Viewstate is internally maintained as a hidden field in           encrypted form along with a key.&lt;br /&gt;
&lt;strong&gt;Advantages:&lt;/strong&gt;&lt;br /&gt;
i) No server resources.&lt;br /&gt;
ii) Viewstate ensures security because it stores the data in encrypted format.&lt;br /&gt;
iii) Viewstates are simple. They are used by enabling or disabling the           viewstate properties.&lt;br /&gt;
iv) It is based on the wish of developer that they want to implement it at the           page level or at control level.&lt;br /&gt;
&lt;strong&gt;Disadvantages:&lt;/strong&gt;&lt;br /&gt;
i) If large amount of data is stored on the page, then page load might cause a           problem.          &lt;br /&gt;
ii) Does not track across pages. Viewstate information does not automatically           transfer from page to page.         &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/6448585743286647965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/what-is-viewstate.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/6448585743286647965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/6448585743286647965'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/what-is-viewstate.html' title='What is a ViewState?'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5307194740548566318.post-3146046220187753856</id><published>2011-04-21T02:48:00.000-07:00</published><updated>2011-04-21T02:48:20.170-07:00</updated><title type='text'>How to pass a querystring from an .asp page to aspx page</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Consider the following URL:&lt;br /&gt;
&lt;br /&gt;
http:// localhost/form.aspx?param1=career&amp;amp;param2=ride&lt;br /&gt;
This html addresses use QueryString property to pass values between pages.         &lt;br /&gt;
From the URL above the information obtained is:&lt;br /&gt;
form.aspx: which is the destination page for your browser.&lt;br /&gt;
Param1 is the first parameter, the value of which is set to career&lt;br /&gt;
Param2 is the first parameter, the value of which is set to ride&lt;br /&gt;
The ‘?’ marks the beginning of the QueryString&lt;br /&gt;
‘&amp;amp;’ is used as a separator between parameters.         &lt;br /&gt;
private void formButtonSubmit_Click(object sender, System.EventArgs e)&lt;br /&gt;
{&lt;br /&gt;
Response.Redirect(&quot;form.aspx?Param1=&quot; +&lt;br /&gt;
this.formTextfieldParam1.Text + &quot;&amp;amp;Param2=&quot; +&lt;br /&gt;
this. formTextfieldParam2.Text);&lt;br /&gt;
}         &lt;br /&gt;
The above code is a submit button event handler and it sends the values of the           query string to the second page.&lt;br /&gt;
The following code demonstrates how to retrieve these valus on the second page:&lt;br /&gt;
private void Page_Load(object sender, System.EventArgs e)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.form2TextField1.Text =           Request.QueryString[&quot;Param1&quot;];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this. form2TextField2.Text =           Request.QueryString[&quot;Param2&quot;];&lt;br /&gt;
}          &lt;br /&gt;
&lt;br /&gt;
You can also use the following method to retrieve the parameters in the string:&lt;br /&gt;
&lt;br /&gt;
for (int i =0;i &amp;lt; Request.QueryString.Count;i++)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;           Response.Write(Request.QueryString[i]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;i style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;From HTML in asp page: &amp;lt;ahref=&quot;abc.aspx?qstring1=test&quot;&amp;gt;Test Query           String&amp;lt;/a&amp;gt;&lt;br /&gt;
From server side code: &amp;lt;%response.redirect &quot;webform1.aspx?id=11&quot;%&amp;gt;&lt;/i&gt; &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allinterview-question.blogspot.com/feeds/3146046220187753856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/how-to-pass-querystring-from-asp-page.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/3146046220187753856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5307194740548566318/posts/default/3146046220187753856'/><link rel='alternate' type='text/html' href='http://allinterview-question.blogspot.com/2011/04/how-to-pass-querystring-from-asp-page.html' title='How to pass a querystring from an .asp page to aspx page'/><author><name>kamlesh</name><uri>http://www.blogger.com/profile/08808099516149243939</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>