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

<channel>
	<title>Solomon &#187; Interview Questions &#8211; ASP.NET</title>
	<atom:link href="http://www.ms.oyangudi.com/blog/category/interview-questions-aspnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ms.oyangudi.com/blog</link>
	<description>from Oyangudi...</description>
	<lastBuildDate>Tue, 18 Oct 2011 02:38:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ASP.NET 2.0 Interview Questions #3</title>
		<link>http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-3/</link>
		<comments>http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-3/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 03:48:35 +0000</pubDate>
		<dc:creator>Solomon</dc:creator>
				<category><![CDATA[Interview Questions - ASP.NET]]></category>

		<guid isPermaLink="false">http://www.ms.oyangudi.com/blog/?p=16</guid>
		<description><![CDATA[Collected from the internet: 1.&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process. inetinfo.exe is theMicrosoft IIS server running, handling ASP.NET requests among other things.When an ASP.NET request is received (usually a file with .aspx extension), the ISAPI filter aspnet_isapi.dll takes care of it by passing the request tothe actual worker [...]]]></description>
			<content:encoded><![CDATA[<div class="simplesocialbuttons">
<div class="simplesocialbutton ssb-button-googleplus"><!-- Google Plus One--><g:plusone size="medium" count="true" href="http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-3/"></g:plusone></div>
<div class="simplesocialbutton ssb-button-fblike"><!-- Facebook like--><div id="fb-root"></div><fb:like href="http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-3/" send="false" layout="button_count" width="100" show_faces="false" action="like" font=""></fb:like></div>
<div class="simplesocialbutton ssb-buttom-twitter"><!-- Twitter--><a name="twitter_share" data-count="horizontal" href="http://twitter.com/share" data-text="ASP.NET 2.0 Interview Questions #3" data-url="http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-3/" class="twitter-share-button" rel="nofollow"></a></div>
</div>
<p><b>Collected from the internet:</b>     <br /><b>1.&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Describe the role of <i>inetinfo.exe, aspnet_isapi.dll </i>and<i>aspnet_wp.exe</i> in the page loading process</b>.     <br />inetinfo.exe is theMicrosoft IIS server running, handling ASP.NET requests among other things.When an ASP.NET request is received (usually a file with .aspx extension), the ISAPI filter aspnet_isapi.dll takes care of it by passing the request tothe actual worker process aspnet_wp.exe.     <br /><b>2.&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; What&#8217;s the difference between Response.Write() andResponse.Output.Write()?      <br /></b>Response.Output.Write() allows you to write formatted output.&#160; <br /><b>3.&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; What methods are fired during the page load?      <br /></b>Init() &#8211; when the page is instantiated     <br />Load() &#8211; when the page is loaded into server memory     <br />PreRender() &#8211; the brief moment before the page is displayed to the user as HTML     <br />Unload() &#8211; when page finishes loading.&#160; <br /><b>4.&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; When during the page processing cycle is ViewState available?</b>     <br />After the Init() and before the Page_Load(), or OnLoad() for a control.&#160; <br /><b>5.&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; What namespace does the Web page belong in the .NET Framework class hierarchy?      <br /></b>System.Web.UI.Page&#160; <br /><b>6.&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Where do you store the information about the user&#8217;s locale?      <br /></b>System.Web.UI.Page.Culture&#160; <br /><b>7.&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; What&#8217;s the difference between Codebehind=&quot;MyCode.aspx.cs&quot; andSrc=&quot;MyCode.aspx.cs&quot;?      <br /></b>CodeBehind is relevant to Visual Studio.NET only.&#160; <br /><b>8.&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; What&#8217;s a bubbled event?      <br /></b>When you have a complex control, like DataGrid, writing an event processing routine for each object (cell, button, row, etc.) is quite tedious. The controls can bubble up their eventhandlers, allowing the main DataGrid event handler to take care of its constituents.&#160; <br /><b>9.&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Suppose you want a certain </b><b>ASP.NET</b> function executed on MouseOver for a certain button.&#160; Where do you add an event handler?     <br />Add an OnMouseOver attribute to the button.&#160; Example: btnSubmit.Attributes.Add(&quot;onmouseover&quot;,&quot;someClientCodeHere();&quot;);&#160; <br /><b>10.&#160;&#160;&#160;&#160;&#160; What data types do the RangeValidator control support?      <br /></b>Integer, String, and Date.&#160; <br /><b>11.&#160;&#160;&#160;&#160;&#160; Explain the differences between Server-side and Client-side code?      <br /></b>Server-side code executes on the server.&#160; Client-side code executes in the client&#8217;s browser.&#160; <br /><b>12.&#160;&#160;&#160;&#160;&#160; What type of code (server or client) is found in a Code-Behind class?      <br /></b>The answer is server-side code since code-behind is executed on the server.&#160; However, during the code-behind&#8217;s execution on the server, it can render client-side code such as JavaScript to be processed in the clients browser.&#160; But just to be clear, code-behind executes on the server, thus making it server-side code.&#160; <br /><b>13.&#160;&#160;&#160;&#160;&#160; Should user input data validation occur server-side or client-side?&#160; Why?      <br /></b>All user input data validation should occur on the server at a minimum.&#160; Additionally, client-side validation can be performed where deemed appropriate and feasable to provide a richer, more responsive experience for the user.&#160; <br /><b>14.&#160;&#160;&#160;&#160;&#160; What is the difference between Server.Transfer and Response.Redirect?&#160; Why would I choose one over the other?      <br /></b>Server.Transfer transfers page processing from one page directly to the next page without making a round-trip back to the client&#8217;s browser.&#160; This provides a faster response with a little less overhead on the server.&#160; Server.Transfer does not update the clients url history list or current url.&#160; Response.Redirect is used to redirect the user&#8217;s browser to another page or site.&#160; This performas a trip back to the client where the client&#8217;s browser is redirected to the new page.&#160; The user&#8217;s browser history list is updated to reflect the new address.&#160; <br /><b>15.&#160;&#160;&#160;&#160;&#160; Can you explain the difference between an </b><b>ADO.NET</b> Dataset and an ADO Recordset?     <br />Valid answers are:     <br />·&#160; A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.     <br />·&#160; A DataSet is designed to work without any continuing connection to the original data source.     <br />·&#160; Data in a DataSet is bulk-loaded, rather than being loaded on demand.     <br />·&#160; There&#8217;s no concept of cursor types in a DataSet.     <br />·&#160; DataSets have no current record pointer You can use For Each loops to move through the data.     <br />·&#160; You can store many edits in a DataSet, and write them to the original data source in a single operation.     <br />·&#160; Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.&#160; <br /><b>16.&#160;&#160;&#160;&#160;&#160; What is the Global.asax used for?      <br /></b>The Global.asax (including the Global.asax.cs file) is used to implement application and session level events.&#160; <br /><b>17.&#160;&#160;&#160;&#160;&#160; What are the Application_Start and Session_Start subroutines used for?      <br /></b>This is where you can set the specific variables for the Application and Session objects.&#160; <br /><b>18.&#160;&#160;&#160;&#160;&#160; Can you explain what inheritance is and an example of when you might use it?      <br /></b>When you want to inherit (use the functionality of) another class.&#160; Example: With a base class named Employee, a Manager class could be derived from the Employee base class.&#160; <br /><b>19.&#160;&#160;&#160;&#160;&#160; Whats an assembly?      <br /></b>Assemblies are the building blocks of the .NET framework.<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconassembliesoverview.asp"> Overview of assemblies from MSDN </a>    <br /><b>20.&#160;&#160;&#160;&#160;&#160; Describe the difference between inline and code behind.      <br /></b>Inline code written along side the html in a page. Code-behind is code written in a separate file and referenced by the .aspx page.&#160; <br /><b>21.&#160;&#160;&#160;&#160;&#160; Explain what a diffgram is, and a good use for one?      <br /></b>The DiffGram is one of the two XML formats that you can use to render DataSet object contents to XML.&#160; A good use is reading database data to an XML file to be sent to a Web Service.&#160; <br /><b>22.&#160;&#160;&#160;&#160;&#160; Whats MSIL, and why should my developers need an appreciation of it if at all?      <br /></b>MSIL is the Microsoft Intermediate Language. All .NET compatible languages will get converted to MSIL.&#160; MSIL also allows the .NET Framework to JIT compile the assembly on the installed computer.&#160; <br /><b>23.&#160;&#160;&#160;&#160;&#160; Which method do you invoke on the DataAdapter control to load your generated dataset with data?      <br /></b>The Fill() method.&#160; <br /><b>24.&#160;&#160;&#160;&#160;&#160; Can you edit data in the Repeater control?      <br /></b>No, it just reads the information from its data source<b>.</b>     <br /><b>25.&#160;&#160;&#160;&#160;&#160; Which template must you provide, in order to display data in a Repeater control?      <br /></b>ItemTemplate.&#160; <br /><b>26.&#160;&#160;&#160;&#160;&#160; How can you provide an alternating color scheme in a Repeater control?      <br /></b>Use the AlternatingItemTemplate<b>.</b>     <br /><b>27.&#160;&#160;&#160;&#160;&#160; What property must you set, and what method must you call in your code, in order to bind the data from a data source to the Repeater control?      <br /></b>You must set the DataSource property and call the DataBind method.&#160; <br /><b>28.&#160;&#160;&#160;&#160;&#160; What base class do all Web Forms inherit from?      <br /></b>The Page class.&#160; <br /><b>29.&#160;&#160;&#160;&#160;&#160; Name two properties common in every validation control?      <br /></b>ControlToValidate property and Text property.&#160; <br /><b>30.&#160;&#160;&#160;&#160;&#160; Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box?      <br /></b>DataTextField property.&#160; <br /><b>31.&#160;&#160;&#160;&#160;&#160; Which control would you use if you needed to make sure the values in two different controls matched?      <br /></b>CompareValidator control.&#160; <br /><b>32.&#160;&#160;&#160;&#160;&#160; How many classes can a single .NET DLL contain?      <br /></b>It can contain many classes.     <br />Web Service Questions     <br /><b>1.&#160;&#160; What is the transport protocol you use to call a Web service?      <br /></b>SOAP (Simple Object Access Protocol) is the preferred protocol.&#160; <br /><b>2.&#160;&#160; True or False: A Web service can only be written in .NET?      <br /></b>False<b>      <br /></b><b>3.&#160;&#160; What does WSDL stand for?      <br /></b>Web Services Description Language.&#160; <br /><b>4.&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Where on the Internet would you look for Web services?      <br /></b><a href="http://www.uddi.org/">http://www.uddi.org</a>     <br /><b>5.&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; True or False: To test a Web service you must create a Windows application or Web application to consume this service?      <br /></b>False, the web service comes with a test page and it provides HTTP-GET method to test.     <br />State Management Questions     <br /><b>1.&#160;&#160; What is ViewState?      <br /></b>ViewState allows the state of objects (serializable) to be stored in a hidden field on the page.&#160; ViewState is transported to the client and back to the server, and is not stored on the server or any other external source.&#160; ViewState is used the retain the state of server-side objects between postabacks.&#160; <br /><b>2.&#160;&#160; What is the lifespan for items stored in ViewState?      <br /></b>Item stored in ViewState exist for the life of the current page.&#160; This includes postbacks (to the same page).&#160; <br /><b>3.&#160;&#160; What does the &quot;EnableViewState&quot; property do?&#160; Why would I want it on or off?      <br /></b>It allows the page to save the users input on a form across postbacks.&#160; It saves the server-side values for a given control into ViewState, which is stored as a hidden value on the page before sending the page to the clients browser.&#160; When the page is posted back to the server the server control is recreated with the state stored in viewstate.&#160; <br /><b>4.&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; What are the different types of Session state management options available with </b><b>ASP.NET</b>?     <br />ASP.NET provides In-Process and Out-of-Process state management.&#160; In-Process stores the session in memory on the web server.&#160; This requires the a &quot;sticky-server&quot; (or no load-balancing) so that the user is always reconnected to the same web server.&#160; Out-of-Process Session state management stores data in an external data source.&#160; The external data source may be either a SQL Server or a State Server service.&#160; Out-of-Process state management requires that all objects stored in session are serializable. </p>
<div class="simplesocialbuttons">
<div class="simplesocialbutton ssb-button-googleplus"><!-- Google Plus One--><g:plusone size="medium" count="true" href="http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-3/"></g:plusone></div>
<div class="simplesocialbutton ssb-button-fblike"><!-- Facebook like--><div id="fb-root"></div><fb:like href="http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-3/" send="false" layout="button_count" width="100" show_faces="false" action="like" font=""></fb:like></div>
<div class="simplesocialbutton ssb-buttom-twitter"><!-- Twitter--><a name="twitter_share" data-count="horizontal" href="http://twitter.com/share" data-text="ASP.NET 2.0 Interview Questions #3" data-url="http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-3/" class="twitter-share-button" rel="nofollow"></a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET 2.0 Interview Questions #2</title>
		<link>http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-2/</link>
		<comments>http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-2/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 03:47:57 +0000</pubDate>
		<dc:creator>Solomon</dc:creator>
				<category><![CDATA[Interview Questions - ASP.NET]]></category>

		<guid isPermaLink="false">http://www.ms.oyangudi.com/blog/?p=15</guid>
		<description><![CDATA[Collected from the internet: Q1. What is Dynamic Compilation? A1. When an asp.net page is compiled for the first time, a copy of the compiled assembly is saved in the Temporary ASP.NET Files folder. This compiled page is of the type system.web.ui.page and includes all contents of the page (including html &#38; scripts). When it [...]]]></description>
			<content:encoded><![CDATA[<div class="simplesocialbuttons">
<div class="simplesocialbutton ssb-button-googleplus"><!-- Google Plus One--><g:plusone size="medium" count="true" href="http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-2/"></g:plusone></div>
<div class="simplesocialbutton ssb-button-fblike"><!-- Facebook like--><div id="fb-root"></div><fb:like href="http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-2/" send="false" layout="button_count" width="100" show_faces="false" action="like" font=""></fb:like></div>
<div class="simplesocialbutton ssb-buttom-twitter"><!-- Twitter--><a name="twitter_share" data-count="horizontal" href="http://twitter.com/share" data-text="ASP.NET 2.0 Interview Questions #2" data-url="http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-2/" class="twitter-share-button" rel="nofollow"></a></div>
</div>
<p><b>Collected from the internet:</b></p>
<p><b>Q1. What is Dynamic Compilation?</b>     <br />A1. When an asp.net page is compiled for the first time, a copy of the compiled assembly is saved in the Temporary ASP.NET Files folder. This compiled page is of the type system.web.ui.page and includes all contents of the page (including html &amp; scripts).     <br />When it is compiled a second time, a precompiled version is accessed from this location, thus speeding up the process. In case the source is changed, the assembly in the Temporary ASP.NET Files folder gets deleted, and thus re-compilation occurs. This process is called Dynamic Compilation.     <br />Compilation may be enabled or disabled at page level by setting the CompilationMode attribute in the Page Directive of the page. </p>
<p><b>Q2. How to set Dynamic Compilation for an entire website?      <br /></b>A2. In web.config, in pages element, add the attribute     <br />CompilationMode=&quot;Auto&quot;. </p>
<p><b>Q3. Why do we sometimes need to disable compilation?</b>     <br />A3. In case of big sites with many pages, and we dont want to load an assembly into the memory for every page. We set CompilationMode=&quot;Never&quot;.     <br />The pages are interpreted at runtime. </p>
<p><b>Q4. What is the FindControl method?      <br /></b>A4. A method that searches for a control, with a specific ID inside a container and get a reference to it. Its just like the     <br />getElementById in javascript. </p>
<p><b>Q5. What is a partial class? Whats the advantage of using it?      <br /></b>A5. In ASP.NET 2.0, a class may be written at several places, and at the time of compilation, all these classes (having the same name) get compiled as one single class. Hence these classes are called Partial Classes.     <br />Advantage, for example, Any change in Code-Behind page gets reflected in the Presentation Page(inline code) and vice versa, because of the partial class mechanism. Compare this with the older ASP.NET 1.1, whenever a change was made to Code Behind, change got reflected in Presentation page but the reverse threw an error. So for any change in the presentation page, like addition of a new control, we need to specifically add a reference of that control in the Code-Behind page. The concept of partial classes in <a href="http://asp.net/">ASP.NET</a> 2 eliminates this problem. </p>
<div class="simplesocialbuttons">
<div class="simplesocialbutton ssb-button-googleplus"><!-- Google Plus One--><g:plusone size="medium" count="true" href="http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-2/"></g:plusone></div>
<div class="simplesocialbutton ssb-button-fblike"><!-- Facebook like--><div id="fb-root"></div><fb:like href="http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-2/" send="false" layout="button_count" width="100" show_faces="false" action="like" font=""></fb:like></div>
<div class="simplesocialbutton ssb-buttom-twitter"><!-- Twitter--><a name="twitter_share" data-count="horizontal" href="http://twitter.com/share" data-text="ASP.NET 2.0 Interview Questions #2" data-url="http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-2/" class="twitter-share-button" rel="nofollow"></a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ASP.NET 2.0 Interview Questions #1</title>
		<link>http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-1/</link>
		<comments>http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-1/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 03:46:14 +0000</pubDate>
		<dc:creator>Solomon</dc:creator>
				<category><![CDATA[Interview Questions - ASP.NET]]></category>

		<guid isPermaLink="false">http://www.ms.oyangudi.com/blog/?p=14</guid>
		<description><![CDATA[Collected from the internet: Q1.what are the new features in ASP.NET 2.0? A1. ASP.NET is a programming framework built on the common language runtime that can be used on a server to build powerful Web applications. The first version of ASP.NET offered several important advantages over previous Web development models. ASP.NET 2.0 improves upon that [...]]]></description>
			<content:encoded><![CDATA[<div class="simplesocialbuttons">
<div class="simplesocialbutton ssb-button-googleplus"><!-- Google Plus One--><g:plusone size="medium" count="true" href="http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-1/"></g:plusone></div>
<div class="simplesocialbutton ssb-button-fblike"><!-- Facebook like--><div id="fb-root"></div><fb:like href="http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-1/" send="false" layout="button_count" width="100" show_faces="false" action="like" font=""></fb:like></div>
<div class="simplesocialbutton ssb-buttom-twitter"><!-- Twitter--><a name="twitter_share" data-count="horizontal" href="http://twitter.com/share" data-text="ASP.NET 2.0 Interview Questions #1" data-url="http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-1/" class="twitter-share-button" rel="nofollow"></a></div>
</div>
<p><b>Collected from the internet:</b></p>
<p><b>Q1.what are the new features in </b><b>ASP.NET</b> 2.0?     <br /><b>A1.</b> ASP.NET is a programming framework built on the common language runtime that can be used on a server to build powerful Web applications. The first version of ASP.NET offered several important advantages over previous Web development models. ASP.NET 2.0 improves upon that foundation by adding support for several new and exciting features in the areas of developer productivity, administration and management, extensibility, and performance.     <br /><b>1) New Server Controls:</b> ASP.NET 2.0 introduces many new server controls that enable powerful declarative support for data access, login security, wizard navigation, menus, treeviews, portals, and more. Many of these controls take advantage of core application services in ASP.NET for scenarios like data access, membership and roles, and personalization.     <br /><b>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; * Data Controls: </b>gridview, detailsview, and formview     <br /><b>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; * Navigation Controls:</b> treeview, menu, and sitemappath     <br /><b>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; * Login Controls:</b>&#160; login forms, create user forms, password retrieval, and custom UI for logged in users or roles     <br /><b>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; * Web Part Controls </b>    <br /><b>2) Master Pages:</b> This feature provides the ability to define common structure and interface elements for your site, such as a page header, footer, or navigation bar, in a common location called a &quot;master page&quot;, to be shared by many pages in your site.     <br />In one simple place you can control the look, feel, and much of functionality for an entire Web site. This improves the maintainability of your site and avoids unnecessary duplication of code for shared site structure or behavior.     <br /><b>3) Themes and Skins.</b> The themes and skins features in ASP.NET 2.0 allow for easy customization of your site&#8217;s look-and-feel. You can define style information in a common location called a &quot;theme&quot;, and apply that style information globally to pages or controls in your site. Like Master Pages, this improves the maintainability of your site and avoid unnecessary duplication of code for shared styles.     <br /><b>4) Personalization</b>. Using the new personalization services in ASP.NET 2.0 you can easily create customized experiences within Web applications. The Profile object enables developers to easily build strongly-typed, sticky data stores for user accounts and build highly customized, relationship based experiences. At the same time, a developer can leverage Web Parts and the personalization service to enable Web site visitors to completely control the layout and behavior of the site, with the knowledge that the site is completely customized for them. Personalizaton scenarios are now easier to build than ever before and require significantly less code and effort to implement.     <br /><b>5) Localization. </b>Enabling globalization and localization in Web sites today is difficult, requiring large amounts of custom code and resources. ASP.NET 2.0 and Visual Studio 2005 provide tools and infrastructure to easily build Localizable sites including the ability to auto-detect incoming locale&#8217;s and display the appropriate locale based UI. Visual Studio 2005 includes built-in tools to dynamically generate resource files and localization references. Together, building localized applications becomes a simple and integrated part of the development experience.     <br /><b>6) Administration and Management </b>&#8211; New tools like Configuration API, ASP.NET MMC Admin Tool, Pre-compilation Tool, Health Monitoring and Tracing have been introduced. </p>
<p><b>Q2. What is Visual Web Developer? Is it Different from Visual Studio 2005?</b>     <br /><b>A2. </b>Visual Web Developer 2005 Express Edition is part of the Microsoft Visual Studio 2005 family, and is the best development tool for building data driven web applications with ASP.NET 2.0. As part of the Express family, Visual Web Developer provides a seamless upgrade path to Visual Studio Standard, Professional, and Team System.     <br /><b>Yes</b> its different from Visual Studio 2005, this one is available as a free download while Visual Studio 2005 has several versions that may be purchased from MS.&#160;&#160; </p>
<p><b>Q3. What are features of Visual Web Developer?</b>     <br /><b>A3. </b>Intellisense Everywhere &#8211; the popup code hints which appear while you type &#8212; has a dramatic impact on your productivity as a developer. While support for Intellisense in Visual Studio .NET 2003 is excellent today, support for Intellisense in Visual Web Developer gets even better.     <br />In Visual Web Developer, <b>Intellisense pops up everywhere</b>. For example, you can take full advantage of Intellisense within the script blocks in single file ASP.NET pages. In addition, Visual Web Developer also supports Intellisense for ASP.NET Page Directives and for inline CSS style attributes within a page.     <br />Visual Web Developer also provides Intellisense for all sections within a Web.Config configuration file, as well as any generic XML file that contains a DTD or XML Schema reference.     <br /><b>HTML Source Preservation      <br /></b>Visual Web Developer respects your HTML. The formatting of your HTML markup &#8212; including all white space, casing, indention, carriage returns, and word wrapping &#8212; is now preserved exactly as originally written, even when switching back and forth between the design view and source view of the page. You can completely trust Visual Web Developer to never modify your markup.     <br /><b>HTML Formatting Options </b>    <br />Visual Web Developer enables you to precisely control the format of all HTML and ASP.NET Server Control markup generated using the WYSIWYG designer.&#160; You can now configure the tag casing, attribute quotation, indention style and word wrap characteristics of every html or server control tag in a page.&#160; You can set these formatting options as defaults for all markup, as well as optionally override each formatting option on a per tag/control basis.&#160; This provides you with the flexibility to fully control exactly how you want your markup to be generated.     <br /><b>Tag Navigator</b>     <br />The HTML source editor within Visual Web Developer ships with a new Tag Navigator feature that enables developers to easily track their location and navigate within a complicated HTML document. The Tag Navigator displays the current &quot;path&quot; within the source of an HTML page by displaying a list of all the HTML tags which contain the tag where your cursor is currently located. Clicking on any of the nodes enables developers to optionally change the source level selection, and quickly move up and down a deep HTML hierarchy.     <br /><b>Tag Outlining</b>     <br />Tag Outlining enables you to work more effectively with large HTML documents. With Tag Outlining, you can right-click any HTML tag in the source editor and select Collapse Tag to hide the entire contents of the tag. Collapsing different regions of the HTML source code contained in a page makes it easier to focus on the particular region of the page which you need to edit.     <br /><b>Flexible Browser Targeting and Validation</b>     <br />Visual Web Developer enables you to easily target a specific HTML standard or browser when writing your HTML pages. For example, you can target your HTML pages to work with a particular browser such as Netscape Navigator 4.0 or Internet     <br />Explorer 6.0. Alternatively, you can target a particular HTML standard such as XHTML 1.0 Strict or XHTML 1.0 Transitional. </p>
<p><b>Q4. What is Code Refactoring?</b>     <br /><b>A4. </b>Its a feature of Visual Web Express &amp; Visual Studio 2005. Code Refactoring     <br />Code Refactoring enables you to easily and systematically make changes to your code. Code Refactoring is supported everywhere that you can write code including both code-behind and single-file ASP.NET pages. For example, you can use Code Refactoring to automatically promote a public field to a full property. </p>
<p><b>Q5. What is Intellitask?</b>     <br />A5. Intellitask is like a super smart clipboard designed for working with code. Intellitask improves your productivity by enabling you to easily apply standard code snippets anywhere within the source editor. Simply by right-clicking, you can inject common code into your pages. Visual Web Developer will ship with more than 200 web specific Intellitask code snippets out of the box.&#160; Better yet, you can add your own code templates to Intellitask so that you can quickly modify your code in the future. </p>
<p><b>Q6. How to we edit templates &amp; tables while developing applications in </b><b>ASP.NET</b> 2.0?     <br /><b>A6. </b>Visual Web Developer has better designer support for editing templates. You can take advantage of the new template editing features when working with data controls such as the DataList and GridView controls.     <br />When adding a control to a template in the designer, you can easily specify the databound expressions to associate with the control properties. For example, if you drag a TextBox control onto a template, you can bind the TextBox control&#8217;s Text property to a particular field from the data control&#8217;s data source. The Edit Databindings dialog box provided by the Visual Web Developer template editing designer enables you to easily bind particular fields by name.     <br />Visual Web Developer has better HTML table editing features. The improved Insert Table dialog box enables you to quickly control the look and feel of the new table when it is added to the designer surface. In addition, Visual Web Developer provides the ability to resize tables, table columns and table rows graphically within the designer surface (just click and hold down the appropriate element to size it). </p>
<p><b>Q7. Do we need FrontPage Server Extensions with </b><b>ASP.NET</b> 2.0 applications?     <br /><b>A7. </b>When we create ASP.NET 2.0 applications on Visual Web Developer OR Visual Studio 2005, We dont need Frontpage Server Extensions as we required in ASP.NET 1.1. When you create a new IIS project, you can now view all of the Web sites and applications configured on your machine. You can even create new IIS Web applications or virtual directories directly from the New Web Site dialog box.&#160; <br />Frontpage Server Extensions (FPSE) are <b>no longer required for locally developed IIS web applications</b>. You can create and fully manage your websites without having to install or configure them. </p>
<p><b>Q8. Can we develop web pages directly on an FTP server?</b>     <br /><b>A8. </b>Yes. Visual Web Developer now has built-in support for editing and updating remote web projects using the standard File Transfer Protocol (FTP). You can quickly connect to a remote Web site using FTP within the New Web Site and Open Web Site dialog box. </p>
<p><b>Q9. What is precompilation in </b><b>ASP.NET</b> 2.0? What is a pre-compiled website?     <br />A9. When the first request arrives at your web application there is a mind-numbing amount of work to do. The worker process starts, the runtime initializes, ASPX pages are parsed and compiled to intermediate language, methods are just-in-time compiled to native code &#8211; and the list goes on and on. If you want to cut out some of the overhead and improve the startup time of your application, then you&#8217;ll want to look at the precompile features in ASP.NET 2.0.     <br />Although pre-compilation will give our site a performance boost, the difference in speed will only be noticeable during the first request to each folder. Perhaps a more important benefit is the new deployment option made available by the precompile &#8211; the option to deploy a site without copying any of the original source code to the server. This includes the code and markup in aspx, ascx, and master files.     <br /><b>There are 2 types of pre-compilation:      <br />(i) In Place Precompilation       <br />(ii) Precompilation for Deployment</b>     <br /><b>In Place Precompilation&#160; -&gt; </b>By default, ASP.NET dynamically parses and compiles all the ASPX pages in a folder when the first request arrives for a page inside that folder. ASP.NET also needs to compile applicable files in the special folders, like App_Code, on the first request, and any code-behind files associated with ASPX and ASCX files. The runtime caches all the compilation results in order to quickly process later requests, and does not need to recompile again unless someone edits a file. This behavior gives us a great deal of flexibility, including the flexibility to change code and markup and instantly have the changes reflected in the next browser request.     <br />The price for this flexibility is the performance hit on the first request. Some people have found their ASP.NET applications to be slow starters. These people usually work in the sales department and perform software demos in front of customers. In place pre-compilation makes the &quot;first hit&quot; to a web application and forces all pages and code in the application to compile.     <br />The tool to use for pre-compilation is the aspnet_compiler executable, which you can find in the %WINDIR%\Microsoft.NET\Framework\v2.x.xxxx directory. If we have a web application in the WebSite1 virtual directory under IIS, we could use the following command line to compile the pplication.     <br /><b>C:\Windows\Microsoft.NET\Framework\v2.0.50215&gt;aspnet_compiler -v /Website1</b>     <br />The <b>–v</b> parameter specifies that we are passing a virtual path to our web site. On servers with multiple websites you may need     <br />to use the –m parameter and specify the full IIS metabase path to the application (-m /LM/W3SVC/1/Root/WebSite1).     <br />The pre-compiled code will end up inside of the Temporary ASP.NET File directory, just as it would when the runtime compiles files for a browser request. Inside of the bin directory for the compiled site, you&#8217;ll find the assemblies (dll files). The compiler generates special filenames to avoid naming collisions. In the shot below, the dll starting with App_Code contains the code from the App_Code directory – not too surprising. Each folder containing aspx, or ascx files will compile into a dll prefixed with App_Web. The files with a .compiled extension contain XML with information about which original source code file maps to which assembly.     <br />You may find these files in the following location of your computer.     <br /><b>C:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary </b><b>ASP.NET</b> Files     <br />With the compiled files in place your web application should have a slightly better startup time, but a primary benefit to in place pre-compilation will be the ability to ensure the web application is error free. If you happen to modify a class or web form and leave an error in the file, the aspnet_compiler will fail and display the compiler error. The tool will also display any warnings, but warning will not stop compilation.     <br /><b>Pre-compilation For Deployment &#8211;&gt; </b>Pre-compilation for deployment creates an &#8216;executable&#8217; (no source code) version of your web application. With pre-compilation for deployment you give the aspnet_compiler the path to your source code, and the path to a target directory for the compilation results, like below.     <br /><b>aspnet_compiler -p &quot;C:\MyDevelopment\WebSite1&quot; -v / C:\MyStage</b>     <br />This command will compile the site and place the result in C:\Staging. You must still specify –v as a parameter, even though we are not using a virtual path as either a source or a destination. Instead, the compiler will use this parameter to resolve application root references (~).     <br />The pre-compilation for deployment step will recreate your web site&#8217;s folder structure in the destination directory. All of the static files (HTML files, image files, configuration files) are copied into the folder structure exactly as they appear in the source folder hierarchy. A bin directory will appear in the target directory with all of the assemblies and .compiled files.     <br />The target directory will contain no source code. All of the classes in the App_Code folder are now compiled into one or more assemblies in the bin directory, and no .cs or .vb files will exist in the target directory. Master page files will also compile to the bin directory and not exist. All the code and markup in ASPX, ASCX, and ASHX files, along with any associated code-behind files, will live inside of one or more assemblies in the bin directory, although these files will still exist in the target directory, they exist as nearly empty &#8216;marker&#8217; files. If you open an ASPX file in a pre-compiled target directory you&#8217;ll see the following content:     <br /><b>This is a marker file generated by the precompilation tool, and should not be deleted!</b>     <br />Once the application finishes compiling you can FTP or XCOPY the target directory to a web server (or map a virtual directory to the target directory), and the application will be ready to run. A benefit to pre-compilation for deployment is that no one can make changes to the web application by tweaking the source code – no source code exists! In fact, you can&#8217;t even place a new ASPX file into the existing application directory structure without causing an error.     <br /><b>Q10. If a web application is pre-compiled, How do you make changes to it?</b>     <br /><b>A10. </b>Making a change to your site will require you to make a change in the original source code, pre-compile the application again, and redeploy all files to the server.     <br />When we recompile an already pre-compiled website, what should be kept in mind?     <br />Pre-compilation generates unique filenames for some assemblies in the bin folder, and these filenames will change each time the pre-compiler executes. The first time you run aspnet_compiler you might see App_Web_murhs6vm.dll in the bin directory, the next time you might see App_Web_gvohdjw.dll with the same compiled code, even though no source file has changed. This means you might have unneeded dlls in your bin directory if you keep repeatedly copy files to the server without cleanup.&#160; <br /><b>Update: use the -fixednames switch to generate repeatable assembly names.      <br />Q11. Is Visual Web Developer XHTML compliant?       <br />A11.</b> Yes.     <br /><b>     <br />Q12. What are server controls?       <br />A12. </b>ASP.NET pages can contain server controls, which are programmable server-side objects that typically represent a UI element in the page, such as a textbox or image. Server controls participate in the execution of the page and produce their own markup rendering to the client. The principle advantage of server controls is that they enable developers to get complex rendering and behaviors from simple building-block components, dramatically reducing the amount of code it takes to produce a dynamic Web page. Another advantage of server controls is that it is easy to customize their rendering or behavior. Server controls expose properties that can be set either declaratively (on the tag) or programmatically (in code). Server controls (and the page itself) also expose events that developers can handle to perform specific actions during the page execution or in response to a client-side action that posts the page back to the server (a &quot;postback&quot;). Server controls also simplify the problem of retaining state across round-trips to the server, automatically retaining their values across successive postbacks.     <br />Server controls are declared within an .aspx file using custom tags or intrinsic HTML tags that contain a runat=&quot;server&quot; attribute value. Intrinsic HTML tags are handled by one of the controls in the System.Web.UI.HtmlControls namespace. Any tag that doesn&#8217;t explicitly map to one of the controls is assigned the type of System.Web.UI.HtmlControls.HtmlGenericControl.     <br /><b>Q13. How do server control handle events?</b>     <br /><b>A13. </b>ASP.NET server controls can optionally expose and raise server events, which can be handled by page developers. A page developer may accomplish this by declaratively wiring an event to a control (where the attribute name of an event wireup indicates the event name and the attribute value indicates the name of a method to call).     <br />Sub EnterBtn_Click(Sender As Object, E As EventArgs)     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Message.Text = &quot;Hi &quot; &amp; Name.Text &amp; &quot;, wazzup there!&quot;     <br />End Sub </p>
<p><b>Q14. How to Navigate to another page?</b>     <br /><b>A14.</b> The following sample demonstrates how to use the <b>&lt;asp:hyperlink runat=server&gt;</b> control to navigate to another page (passing custom query string parameters along the way). The sample then demonstrates how to easily get access to these query string parameters from the target page.     <br />&lt;asp:hyperlink id=&quot;hl_Link&quot; runat=server text=&quot;click here&quot; NavigateUrl=&quot;www.somelink.com &quot;&gt;     <br />&lt;/asp:hyperlink&gt;     <br />This navigation triggers when a click is made on the hyperlink. If we want navigation to trigger through code, we may use response.redirect(URL) or server.transfer(URL) </p>
<p><b>Q15. What is Simplified Code Behind Model in </b><b>ASP.NET</b> 2.0?     <br /><b>A15. </b>ASP.NET 2.0 introduces an improved runtime for code-behind pages that simplifies the connections between the page and code. In this new code-behind model, the page is declared as a partial class, which enables both the page and code files to be compiled into a single class at runtime. The page code refers to the code-behind file in the CodeFile attribute of the &lt;%@ Page %&gt; directive, specifying the class name in the Inherits attribute. Note that members of the code behind class must be either public or protected (they cannot be private).     <br />Example     <br /><b>Codebehind</b></p>
<div>
<div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   1:</span> Partial <span style="color: #0000ff">Class</span> CodeBehind_vb_aspx </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   2:</span> <span style="color: #0000ff">Inherits</span> System.Web.UI.Page </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   3:</span>     <span style="color: #0000ff">Protected</span> <span style="color: #0000ff">Sub</span> Button1_Click(<span style="color: #0000ff">ByVal</span> sender <span style="color: #0000ff">As</span> <span style="color: #0000ff">Object</span>, <span style="color: #0000ff">ByVal</span> e <span style="color: #0000ff">As</span> System.EventArgs)</pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   4:</span>         Label1.Text = <span style="color: #006080">&quot;Hello &quot;</span> &amp; TextBox1.Text</pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   5:</span>     <span style="color: #0000ff">End</span> <span style="color: #0000ff">Sub</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   6:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">Class</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   7:</span> Inline </pre>
</p></div>
</div>
<p><b>Code</b> </p>
<p><b></b></p>
<div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px">
<div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   1:</span> <span style="background-color: #ffff00">&lt;%@ page language=&quot;VB&quot; CodeFile=&quot;CodeBehind_vb.aspx.vb&quot; Inherits=&quot;CodeBehind_vb_aspx&quot; %&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   2:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">html</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   3:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">head</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   4:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">title</span><span style="color: #0000ff">&gt;</span>ASP.NET CodeBehind Pages<span style="color: #0000ff">&lt;/</span><span style="color: #800000">title</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   5:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">head</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   6:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">body</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   7:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">form</span> <span style="color: #ff0000">runat</span><span style="color: #0000ff">=&quot;server&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   8:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">h1</span><span style="color: #0000ff">&gt;</span>Welcome to ASP.NET 2.0!<span style="color: #0000ff">&lt;/</span><span style="color: #800000">h1</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   9:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">b</span><span style="color: #0000ff">&gt;</span>Enter Your Name:<span style="color: #0000ff">&lt;/</span><span style="color: #800000">b</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  10:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:TextBox</span> <span style="color: #ff0000">ID</span><span style="color: #0000ff">=&quot;TextBox1&quot;</span> <span style="color: #ff0000">Runat</span><span style="color: #0000ff">=&quot;server&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  11:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:Button</span> <span style="color: #ff0000">ID</span><span style="color: #0000ff">=&quot;Button1&quot;</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;Click Me&quot;</span> <span style="color: #ff0000">OnClick</span><span style="color: #0000ff">=&quot;Button1_Click&quot;</span> <span style="color: #ff0000">Runat</span><span style="color: #0000ff">=&quot;server&quot;</span><span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  12:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">br</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  13:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">br</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  14:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:Label</span> <span style="color: #ff0000">ID</span><span style="color: #0000ff">=&quot;Label1&quot;</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;Hello&quot;</span> <span style="color: #ff0000">Runat</span><span style="color: #0000ff">=&quot;server&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  15:</span>     <span style="color: #0000ff">&lt;/</span><span style="color: #800000">form</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  16:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">body</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  17:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">html</span><span style="color: #0000ff">&gt;</span></pre>
</p></div>
</div>
<p><b>Q16. Whats the advantage of Simplified Code Behind model?</b> </p>
<p><b>A16.</b> The advantage of the simplified code-behind model over previous versions is that you do not need to maintain separate declarations of server control variables in the code-behind class. Using partial classes (new in 2.0) allows the server control IDs of the ASPX page to be accessed directly in the code-behind file. This greatly simplifies the maintenance of code-behind pages. </p>
<p><b>Q17. Whats the use of App_Code directory in </b><b>ASP.NET</b> 2.0? </p>
<p><b>A17.</b> Just as pages can be compiled dynamically at runtime, so can arbitrary code files (for example .cs or .vb files). ASP.NET 2.0 introduces the App_Code directory, which can contain standalone files that contain code to be shared across several pages in your application. Unlike ASP.NET 1.x, which required these files to be precompiled to the Bin directory, any code files in the App_Code directory will be dynamically compiled at runtime and made available to the application. It is possible to place files of more than one language under the App_Code directory, provided they are partitioned in subdirectories (registered with a particular language in Web.config). </p>
<p><b>Q18. Can we put code created in different languages in the same App_Code directory?</b> </p>
<p><b>A18. </b>By default, the App_Code directory can only contain files of the same language. However, you may partition the App_Code directory into subdirectories (each containing files of the same language) in order to contain multiple languages under the </p>
<p>App_Code directory. To do this, you need to register each subdirectory in the Web.config file for the application. </p>
<div>
<div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">configuration</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   2:</span>   <span style="color: #0000ff">&lt;</span><span style="color: #800000">system.web</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   3:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">compilation</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   4:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">codeSubDirectories</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   5:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">add</span> <span style="color: #ff0000">directoryName</span><span style="color: #0000ff">=&quot;Subdirectory&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   6:</span>       <span style="color: #0000ff">&lt;/</span><span style="color: #800000">codeSubDirectories</span><span style="color: #0000ff">&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   7:</span>     <span style="color: #0000ff">&lt;/</span><span style="color: #800000">compilation</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   8:</span>   <span style="color: #0000ff">&lt;/</span><span style="color: #800000">system.web</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   9:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">configuration</span><span style="color: #0000ff">&gt;</span> </pre>
</p></div>
</div>
<p><b>Q19. Whats the difference between Bin folder and App_Code folder?</b> </p>
<p><b>A19. </b>The Bin directory is like the Code directory, except it can contain precompiled assemblies. This is useful when you need to use code that is possibly written by someone other than yourself, where you don&#8217;t have access to the source code (VB or C# file) but you have a compiled DLL instead. Simply place the assembly in the Bin directory to make it available to your site. </p>
<p>By default, all assemblies in the Bin directory are automatically loaded in the app and made accessible to pages. You may need to Import specific namespaces from assemblies in the Bin directory using the @Import directive at the top of the page.&#160;&#160; <br />&lt;@ Import Namespace=&quot;MyCustomNamespace&quot;&gt; </p>
<p><b>Q20. How to register Assemblies in GAC (Global Assembly Cache)?</b> </p>
<p><b>A20. </b>The .NET Framework 2.0 includes a number of assemblies that represent the various parts of the Framework. These assemblies are stored in the global assembly cache, which is a versioned repository of assemblies made available to all applications on the machine (not just a specific application, as is the case with Bin and App_Code). Several assemblies in the Framework are automatically made available to ASP.NET applications. You can register additional assemblies by registration in a Web.config file in your application. </p>
<div>
<div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">configuration</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   2:</span>    <span style="color: #0000ff">&lt;</span><span style="color: #800000">compilation</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   3:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">assemblies</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   4:</span>          <span style="color: #0000ff">&lt;</span><span style="color: #800000">add</span> <span style="color: #ff0000">assembly</span><span style="color: #0000ff">=&quot;System.Data, Version=1.0.2411.0, </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   5:</span>                         Culture=neutral, </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   6:</span>                         PublicKeyToken=b77a5c561934e089&quot;</span><span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   7:</span>       <span style="color: #0000ff">&lt;/</span><span style="color: #800000">assemblies</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   8:</span>    <span style="color: #0000ff">&lt;/</span><span style="color: #800000">compilation</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   9:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">configuration</span><span style="color: #0000ff">&gt;</span> </pre>
</p></div>
</div>
<p>Note that you still need to use an @Import directive to make the namespaces in these assemblies available to individual pages. </p>
<p><b>Q21. Can we bind data to Server Controls without writing code in </b><b>ASP.NET</b> 2.0? </p>
<p><b>A21. </b>Yes. ASP.NET 2.0 enables a declarative solution for data binding which requires no code at all for the most common data scenarios, such as: </p>
<p><b>Selecting and displaying data<br />
    <br />Sorting, Paging and Caching Data </p>
<p>Updating, Inserting and Deleting Data </p>
<p>Filtering or Master-Details Using Parameters </b></p>
<p>ASP.NET 2.0 introduces two types of server controls that participate in this declarative data binding model. These two types of data controls handle the complexity of the stateless Web model for data scenarios, so developers don&#8217;t need to understand page request lifecycle events just to perform data binding. Another benefit of this control-based model is that it can be easily extended to support additional data access storage providers. </p>
<p><b>Q22. What are data source controls?</b> </p>
<p><b>A22. </b>Data source controls have no rendering, but instead represent a particular backend data store, for example a database, business object, XML file, or XML Web Service. Data source controls also enable rich capabilities over data &#8211; such as sorting, paging, filtering, updating, deleting, and inserting &#8211; that data-bound UI controls can automatically use. ASP.NET includes the following server controls out-of-the-box: </p>
<p><b>SqlDataSource</b> Enables binding to a SQL database represented by an ADO.NET provider, such as Microsoft™ SQL Server, OLEDB, ODBC, or Oracle. </p>
<p><b>ObjectDataSource</b> Enables binding to a middle-tier object such as a data access layer or business component. </p>
<p><b>AccessDataSource</b> Enables binding to a Microsoft™ Access (Jet) database. </p>
<p><b>SiteMapDataSource</b> Enables binding to the hierarchy exposed by an ASP.NET 2.0 site navigation provider. </p>
<p><b>XmlDataSource </b>Enables binding to an XML file or document. </p>
<p><b>Q23. What are data bound controls?</b> </p>
<p><b>A23. </b>Data-bound controls are UI controls that render data as markup to the requesting client device or browser. A data-bound control can auto-bind to data exposed from a data source and will fetch data at the appropriate time in the page request lifecycle. These controls can optionally take advantage of data source capabilities such as sorting, paging, filtering, updating, deleting, and inserting. A data-bound control connects to a data source control through its DataSourceID property. </p>
<p>You may be familiar with some of the data-bound controls in ASP.NET v1.x, such as <b>DataGrid, DataList, Repeater, and list controls like DropDownList</b>. ASP.NET 2.0 contains several new data-bound controls as well, such as: </p>
<p><b>GridView</b> Renders data in a grid format. This control is an evolution of the DataGrid control, and can automatically take advantage of data source capabilities. </p>
<p><b>DetailsView</b> Renders a single data item in a table of label/value pairs, similar to the form view in Microsoft™ Access. This control can also automatically take advantage of data source capabilities. </p>
<p><b>FormView </b>Renders a single data item at a time in a form defined by a custom template. Renders a single data item in a table of label/value pairs, similar to the form view in Microsoft™ Access. This control can also automatically take advantage of data source capabilities. </p>
<p><b>TreeView</b> Renders data in a hierarchical tree view of expandable nodes. </p>
<p><b>Menu</b> Renders data in a hierarchical dynamic menu (including flyouts). </p>
<p><b>Q24. What is a Master Page? How do we use it?</b> </p>
<p><b>A24. </b>A Master Page is a page that contains markup and controls that should be shared across multiple pages in your site. For example, if all of your pages should have the same header and footer banners or the same navigation menu, you could define this in a Master Page once, and then all pages associated to this Master Page would inherit those common elements. The advantage of defining the header, footer, and navigation in a Master Page is that these elements need only be defined once, instead of multiple times in duplicate code across the pages in your site. </p>
<p>Defining a Master Page is just like defining a normal page. Master Pages can contain markup, controls, or code, or any combination of these elements. However, a Master Page can contain a special type of control, called a <b>ContentPlaceHolder</b> control. A ContentPlaceHolder defines a region of the master page rendering that can be substituted with content from a page associated to the master. A ContentPlaceHolder can also contain default content, just in case the derive page does not need to override this content. The syntax of a ContentPlaceHolder control is given below: </p>
<div>
<div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   1:</span> <span style="background-color: #ffff00">&lt;%</span>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   1:</span> -- ContentPlaceHolder control --</pre>
<p><span style="background-color: #ffff00">%&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   2:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:contentplaceholder</span> <span style="color: #ff0000">id</span><span style="color: #0000ff">=&quot;FlowerText&quot;</span> <span style="color: #ff0000">runat</span><span style="color: #0000ff">=&quot;server&quot;</span><span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   3:</span> <span style="background-color: #ffff00">&lt;%</span>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   1:</span> -- ContentPlaceHolder with <span style="color: #0000ff">default</span> content --</pre>
<p><span style="background-color: #ffff00">%&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   4:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:contentplaceholder</span> <span style="color: #ff0000">id</span><span style="color: #0000ff">=&quot;FlowerText&quot;</span> <span style="color: #ff0000">runat</span><span style="color: #0000ff">=&quot;server&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   5:</span>   <span style="color: #0000ff">&lt;</span><span style="color: #800000">h3</span><span style="color: #0000ff">&gt;</span>Welcome to my florist website!<span style="color: #0000ff">&lt;/</span><span style="color: #800000">h3</span><span style="color: #0000ff">&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   6:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">asp:contentplaceholder</span><span style="color: #0000ff">&gt;</span> </pre>
</p></div>
</div>
<p>To differentiate a Master Page from a normal page, a Master Page is saved under the <b>.master</b> file extension. A page can derive from a Master Page by defining a MasterPageFile attribute on its Page directive, as demonstrated below. A page that is associated to a Master Page is called a Content Page. </p>
<p>&lt;%@ Page MasterPageFile=&quot;Site.master&quot; %&gt; </p>
<p><b>Q25. What is a Content Page? How do we use it?</b> </p>
<p><b>A25. </b>A Content Page can declare Content controls that specifically override content placeholder sections in the Master Page. A Content control is associated to a particular ContentPlaceHolder control through its ContentPlaceHolderID property. A Content Page may only contain markup and controls inside Content controls; it cannot have any top-level content of its own. It can, however, have directives or server-side code. </p>
<div>
<div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   1:</span> <span style="background-color: #ffff00">&lt;%@ Page MasterPageFile=&quot;Site.master&quot; %&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   2:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:content</span> <span style="color: #ff0000">id</span><span style="color: #0000ff">=&quot;Content1&quot;</span> <span style="color: #ff0000">contentplaceholderid</span><span style="color: #0000ff">=&quot;FlowerText&quot;</span> <span style="color: #ff0000">runat</span><span style="color: #0000ff">=&quot;server&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   3:</span>     Santa Clause will definitely meet you this Christmas! <span style="color: #0000ff">&lt;/</span><span style="color: #800000">asp:content</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   4:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:content</span> <span style="color: #ff0000">id</span><span style="color: #0000ff">=&quot;Content2&quot;</span> <span style="color: #ff0000">contentplaceholderid</span><span style="color: #0000ff">=&quot;FlowerPicture&quot;</span> <span style="color: #ff0000">runat</span><span style="color: #0000ff">=&quot;server&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   5:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:Image</span> <span style="color: #ff0000">id</span><span style="color: #0000ff">=&quot;image1&quot;</span> <span style="color: #ff0000">imageurl</span><span style="color: #0000ff">=&quot;~/images/santa.jpg&quot;</span> <span style="color: #ff0000">runat</span><span style="color: #0000ff">=&quot;server&quot;</span><span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   6:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">asp:content</span><span style="color: #0000ff">&gt;</span> </pre>
</p></div>
</div>
<p><b>Q26. How does Content page access a master page?</b> </p>
<p><b>A26. </b>In addition to overriding content, it is possible for a Content Page to programmatically access its Master Page. A Content Page creates a strongly-typed reference to the Master Page using the &lt;%@ MasterType %&gt; directive, specifying the virtual path to the master page: </p>
<p>&lt;%@ MasterType VirtualPath=&quot;Site.master&quot; %&gt; </p>
<p>The Content Page can then reference the Master Page using the Master property of the Page class: </p>
<p>Master.FooterText = &quot;This is my custom footer&quot; </p>
<p>Dim adr As AdRotator = Master.FindControl(&quot;MyAdRotator&quot;) </p>
<p>In the code example above, FooterText is a public property exposed on the Master Page, while MyAdRotator is a control on the Master Page. </p>
<p><b>Q27. Can we have multiple number of Master pages in an </b><b>ASP.NET</b> 2.0 web application? </p>
<p><b>A27.</b> Yes. </p>
<p><b>Q28. Can we have multiple SiteMapPath controls in an </b><b>ASP.NET</b> 2.0 web application? </p>
<p><b>A28.</b> Yes. </p>
<p><b>Q29. How to create a read-only Data Report using GridView?<br />
    <br />A29.</b> The simplest type of data-driven page is a read-only report, which displays data but does not allow the user to manipulate the presentation or modify the data. To create a read-only report against a SQL database, first configure a SqlDataSource on the page and then connect a data-bound control such as GridView to the data source by specifying its DataSourceID property. The example below shows a GridView control associated to a SqlDataSource control. </p>
<div>
<div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">form</span> <span style="color: #ff0000">runat</span><span style="color: #0000ff">=&quot;server&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   2:</span>   <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:GridView</span> <span style="color: #ff0000">ID</span><span style="color: #0000ff">=&quot;GridView1&quot;</span> <span style="color: #ff0000">DataSourceID</span><span style="color: #0000ff">=&quot;SqlDataSource1&quot;</span> <span style="color: #ff0000">runat</span><span style="color: #0000ff">=&quot;server&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   3:</span>   <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:SqlDataSource</span> <span style="color: #ff0000">ID</span><span style="color: #0000ff">=&quot;SqlDataSource1&quot;</span> <span style="color: #ff0000">runat</span><span style="color: #0000ff">=&quot;server&quot;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   4:</span>     <span style="color: #ff0000">SelectCommand</span><span style="color: #0000ff">=&quot;SELECT [au_id], [au_lname], [au_fname] FROM [authors]&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   5:</span>     <span style="color: #ff0000">ConnectionString</span><span style="color: #0000ff">=&quot;&lt;%$ ConnectionStrings:Pubs %&gt;&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   6:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">form</span><span style="color: #0000ff">&gt;</span> </pre>
</p></div>
</div>
<p>The SqlDataSource ConnectionString property specifies the connection string to the database and the SelectCommand property specifies the query to execute to retrieve data. The connection string can be specified literally in the page, but in this case the property is assigned using a new expression syntax that retrieves the value from Web.config.&#160; </p>
<div>
<div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">configuration</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   2:</span>   <span style="color: #0000ff">&lt;</span><span style="color: #800000">connectionStrings</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   3:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">add</span> <span style="color: #ff0000">name</span><span style="color: #0000ff">=&quot;Pubs&quot;</span> <span style="color: #ff0000">connectionString</span><span style="color: #0000ff">=&quot;Server=(local);Integrated  Security=True;Database=UrDatabaseName;&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   4:</span>       <span style="color: #ff0000">providerName</span><span style="color: #0000ff">=&quot; System.Data.SqlClient&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   5:</span>   <span style="color: #0000ff">&lt;/</span><span style="color: #800000">connectionStrings</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   6:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">configuration</span><span style="color: #0000ff">&gt;</span></pre>
</p></div>
</div>
<p><b>Q30. How do we sort data in a GridView?<br />
    <br />A30. </b>The SqlDataSource control supports sorting when its DataSourceMode property is set to &quot;DataSet&quot;. To enable the sorting UI in the GridView, set the AllowSorting property to true. This causes the GridView to render link buttons for its column headers that can be clicked to sort a column. The GridView control passes the SortExpression associated with the column field to the data source control, which returns the sorted data to the GridView. </p>
<p><b>Q31. Can we sort data from a SQLDataSource when mode is set to DataReader?<br />
    <br />A31. </b>No. Sorting is only supported by SqlDataSource when in DataSet mode. </p>
<p>Inline Code looks like this&#8230;</p>
<div>
<div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:GridView</span> <span style="color: #ff0000">ID</span><span style="color: #0000ff">=&quot;GridView1&quot;</span> <span style="color: #ff0000">AllowSorting</span><span style="color: #0000ff">=&quot;true&quot;</span> <span style="color: #ff0000">runat</span><span style="color: #0000ff">=&quot;server&quot;</span> <span style="color: #ff0000">DataSourceID</span><span style="color: #0000ff">=&quot;SqlDataSource1&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   2:</span>       <span style="color: #ff0000">AutoGenerateColumns</span><span style="color: #0000ff">=&quot;False&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   3:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">Columns</span><span style="color: #0000ff">&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   4:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;ID&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;au_id&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;au_id&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   5:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;Last Name&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;au_lname&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;au_lname&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   6:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;First Name&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;au_fname&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;au_fname&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   7:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;Phone&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;phone&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;phone&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   8:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;Address&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;address&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;address&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   9:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;City&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;city&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;city&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  10:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;State&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;state&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;state&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  11:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;Zip Code&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;zip&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;zip&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  12:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:CheckBoxField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;Contract&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;contract&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;contract&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  13:</span>       <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Columns</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  14:</span>     <span style="color: #0000ff">&lt;/</span><span style="color: #800000">asp:GridView</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  15:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:SqlDataSource</span> <span style="color: #ff0000">ID</span><span style="color: #0000ff">=&quot;SqlDataSource1&quot;</span> <span style="color: #ff0000">runat</span><span style="color: #0000ff">=&quot;server&quot;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  16:</span>       <span style="color: #ff0000">SelectCommand</span><span style="color: #0000ff">=&quot;SELECT [au_id], [au_lname], [au_fname], [phone], [address], [city], [state], [zip], [contract] FROM [authors]&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  17:</span>       <span style="color: #ff0000">ConnectionString</span><span style="color: #0000ff">=&quot;&lt;%$ ConnectionStrings:Pubs %&gt;&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
</p></div>
</div>
<p><b>Q32. How do we enable paging in a GridView?<br />
    <br />A32. </b>You can enable paging UI in the GridView by setting the AllowPaging property to true. The GridView can automatically page over any return value from a data source that supports the ICollection interface. The DataView returned by SqlDataSource when in DataSet mode supports this interface, so GridView can page over the result. When in DataReader mode, the GridView cannot page over the data returned by SqlDataSource. </p>
<p>Inline Code looks like this&#8230;</p>
<div>
<div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:GridView</span> <span style="color: #ff0000">ID</span><span style="color: #0000ff">=&quot;GridView1&quot;</span> <span style="color: #ff0000">AllowSorting</span><span style="color: #0000ff">=&quot;true&quot;</span> <span style="color: #ff0000">AllowPaging</span><span style="color: #0000ff">=&quot;true&quot;</span> <span style="color: #ff0000">PageSize</span><span style="color: #0000ff">=&quot;3&quot;</span> <span style="color: #ff0000">runat</span><span style="color: #0000ff">=&quot;server&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   2:</span>       <span style="color: #ff0000">DataSourceID</span><span style="color: #0000ff">=&quot;SqlDataSource1&quot;</span> <span style="color: #ff0000">AutoGenerateColumns</span><span style="color: #0000ff">=&quot;False&quot;</span><span style="color: #0000ff">&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   3:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">PagerSettings</span> <span style="color: #ff0000">Mode</span><span style="color: #0000ff">=&quot;NextPreviousFirstLast&quot;</span> <span style="color: #ff0000">Position</span><span style="color: #0000ff">=&quot;TopAndBottom&quot;</span> <span style="color: #ff0000">FirstPageImageUrl</span><span style="color: #0000ff">=&quot;~/Images/First.gif&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   4:</span>         <span style="color: #ff0000">LastPageImageUrl</span><span style="color: #0000ff">=&quot;~/Images/Last.gif&quot;</span> <span style="color: #ff0000">NextPageImageUrl</span><span style="color: #0000ff">=&quot;~/Images/Next.gif&quot;</span> <span style="color: #ff0000">PreviousPageImageUrl</span><span style="color: #0000ff">=&quot;~/Images/Prev.gif&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   5:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">PagerStyle</span> <span style="color: #ff0000">ForeColor</span><span style="color: #0000ff">=&quot;White&quot;</span> <span style="color: #ff0000">HorizontalAlign</span><span style="color: #0000ff">=&quot;Right&quot;</span> <span style="color: #ff0000">BackColor</span><span style="color: #0000ff">=&quot;#284775&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   6:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">Columns</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   7:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;ID&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;au_id&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;au_id&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   8:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;Last Name&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;au_lname&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;au_lname&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   9:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;First Name&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;au_fname&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;au_fname&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  10:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;Phone&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;phone&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;phone&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  11:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;Address&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;address&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;address&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  12:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;City&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;city&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;city&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  13:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;State&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;state&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;state&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  14:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;Zip Code&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;zip&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;zip&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  15:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:CheckBoxField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;Contract&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;contract&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;contract&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  16:</span>       <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Columns</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  17:</span>     <span style="color: #0000ff">&lt;/</span><span style="color: #800000">asp:GridView</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  18:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:SqlDataSource</span> <span style="color: #ff0000">ID</span><span style="color: #0000ff">=&quot;SqlDataSource1&quot;</span> <span style="color: #ff0000">runat</span><span style="color: #0000ff">=&quot;server&quot;</span> <span style="color: #ff0000">SelectCommand</span><span style="color: #0000ff">=&quot;SELECT [au_id], [au_lname], [au_fname], [phone], [address], [city], [state], [zip], [contract] FROM [authors]&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  19:</span>       <span style="color: #ff0000">ConnectionString</span><span style="color: #0000ff">=&quot;&lt;%$ ConnectionStrings:Pubs %&gt;&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
</p></div>
</div>
<p><b>Q33. How do we set the number of Records in a GridView to display?<br />
    <br />A33. </b>Use the PageSize property. It Gets or sets the number of records to display on a page in a GridView control. </p>
<p><b>Q34. What is the TopPagerRow property of a GridView?<br />
    <br />A34. </b>Gets a GridViewRow object that represents the top pager row in a GridView control. </p>
<p><b>Q35. Describe the Hotspot class?<br />
    <br />A35. </b>It implements the basic functionality common to all hot spot shapes. Its Namespace: System.Web.UI.WebControls </p>
<p>You cannot directly create instances of the abstract HotSpot class. Instead, this class is inherited by the CircleHotSpot, RectangleHotSpot, and PolygonHotSpot classes to provide the common basic functionality for a hot spot. You must derive from the HotSpot class to create a custom hot spot class that represents a unique shape that you define. However, you can define most shapes using the CircleHotSpot, RectangleHotSpot, and PolygonHotSpot classes. Its used in an ImageMap control. </p>
<p><b>Q36. What is ImageMap Control?<br />
    <br />A36. </b>It is a control that displays an image on a page. When a hot spot region that is defined within the ImageMap control is clicked, the control either generates a postback to the server or navigates to a specified URL. </p>
<p>Inline code example&#8230; </p>
<p><b></b></p>
<div>
<div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:ImageMap</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   2:</span>     <span style="color: #ff0000">AccessKey</span><span style="color: #0000ff">=&quot;string&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   3:</span>     <span style="color: #ff0000">AlternateText</span><span style="color: #0000ff">=&quot;string&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   4:</span>     <span style="color: #ff0000">BackColor</span><span style="color: #0000ff">=&quot;color name|#dddddd&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   5:</span>     <span style="color: #ff0000">BorderColor</span><span style="color: #0000ff">=&quot;color name|#dddddd&quot;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   6:</span>     <span style="color: #ff0000">BorderStyle</span><span style="color: #0000ff">=&quot;NotSet|None|Dotted|Dashed|Solid|Double|Groove|Ridge|</pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   7:</span>         Inset|Outset&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   8:</span>     <span style="color: #ff0000">BorderWidth</span><span style="color: #0000ff">=&quot;size&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   9:</span>     <span style="color: #ff0000">CssClass</span><span style="color: #0000ff">=&quot;string&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  10:</span>     <span style="color: #ff0000">DescriptionUrl</span><span style="color: #0000ff">=&quot;uri&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  11:</span>     <span style="color: #ff0000">Enabled</span><span style="color: #0000ff">=&quot;True|False&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  12:</span>     <span style="color: #ff0000">EnableTheming</span><span style="color: #0000ff">=&quot;True|False&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  13:</span>     <span style="color: #ff0000">EnableViewState</span><span style="color: #0000ff">=&quot;True|False&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  14:</span>     <span style="color: #ff0000">ForeColor</span><span style="color: #0000ff">=&quot;color name|#dddddd&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  15:</span>     <span style="color: #ff0000">GenerateEmptyAlternateText</span><span style="color: #0000ff">=&quot;True|False&quot;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  16:</span>     <span style="color: #ff0000">Height</span><span style="color: #0000ff">=&quot;size&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  17:</span>     <span style="color: #ff0000">HotSpotMode</span><span style="color: #0000ff">=&quot;NotSet|Navigate|PostBack|Inactive&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  18:</span>     <span style="color: #ff0000">ID</span><span style="color: #0000ff">=&quot;string&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  19:</span>     <span style="color: #ff0000">ImageAlign</span><span style="color: #0000ff">=&quot;NotSet|Left|Right|Baseline|Top|Middle|Bottom|</pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  20:</span>         AbsBottom|AbsMiddle|TextTop&quot;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  21:</span>     <span style="color: #ff0000">ImageUrl</span><span style="color: #0000ff">=&quot;uri&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  22:</span>     <span style="color: #ff0000">OnClick</span><span style="color: #0000ff">=&quot;Click event handler&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  23:</span>     <span style="color: #ff0000">OnDataBinding</span><span style="color: #0000ff">=&quot;DataBinding event handler&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  24:</span>     <span style="color: #ff0000">OnDisposed</span><span style="color: #0000ff">=&quot;Disposed event handler&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  25:</span>     <span style="color: #ff0000">OnInit</span><span style="color: #0000ff">=&quot;Init event handler&quot;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  26:</span>     <span style="color: #ff0000">OnLoad</span><span style="color: #0000ff">=&quot;Load event handler&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  27:</span>     <span style="color: #ff0000">OnPreRender</span><span style="color: #0000ff">=&quot;PreRender event handler&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  28:</span>     <span style="color: #ff0000">OnUnload</span><span style="color: #0000ff">=&quot;Unload event handler&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  29:</span>     <span style="color: #ff0000">runat</span><span style="color: #0000ff">=&quot;server&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  30:</span>     <span style="color: #ff0000">SkinID</span><span style="color: #0000ff">=&quot;string&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  31:</span>     <span style="color: #ff0000">Style</span><span style="color: #0000ff">=&quot;string&quot;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  32:</span>     <span style="color: #ff0000">TabIndex</span><span style="color: #0000ff">=&quot;integer&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  33:</span>     <span style="color: #ff0000">Target</span><span style="color: #0000ff">=&quot;string&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  34:</span>     <span style="color: #ff0000">ToolTip</span><span style="color: #0000ff">=&quot;string&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  35:</span>     <span style="color: #ff0000">Visible</span><span style="color: #0000ff">=&quot;True|False&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  36:</span>     <span style="color: #ff0000">Width</span><span style="color: #0000ff">=&quot;size&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  37:</span> <span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  38:</span>             <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:CircleHotSpot</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  39:</span>                 <span style="color: #ff0000">AccessKey</span><span style="color: #0000ff">=&quot;string&quot;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  40:</span>                 <span style="color: #ff0000">AlternateText</span><span style="color: #0000ff">=&quot;string&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  41:</span>                 <span style="color: #ff0000">HotSpotMode</span><span style="color: #0000ff">=&quot;NotSet|Navigate|PostBack|Inactive&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  42:</span>                 <span style="color: #ff0000">NavigateUrl</span><span style="color: #0000ff">=&quot;uri&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  43:</span>                 <span style="color: #ff0000">PostBackValue</span><span style="color: #0000ff">=&quot;string&quot;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  44:</span>                 <span style="color: #ff0000">Radius</span><span style="color: #0000ff">=&quot;integer&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  45:</span>                 <span style="color: #ff0000">TabIndex</span><span style="color: #0000ff">=&quot;integer&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  46:</span>                 <span style="color: #ff0000">Target</span><span style="color: #0000ff">=&quot;string|_blank|_parent|_search|_self|_top&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  47:</span>                 <span style="color: #ff0000">X</span><span style="color: #0000ff">=&quot;integer&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  48:</span>                 <span style="color: #ff0000">Y</span><span style="color: #0000ff">=&quot;integer&quot;</span>            <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  49:</span>             <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:PolygonHotSpot</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  50:</span>                 <span style="color: #ff0000">AccessKey</span><span style="color: #0000ff">=&quot;string&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  51:</span>                 <span style="color: #ff0000">AlternateText</span><span style="color: #0000ff">=&quot;string&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  52:</span>                 <span style="color: #ff0000">Coordinates</span><span style="color: #0000ff">=&quot;string&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  53:</span>                 <span style="color: #ff0000">HotSpotMode</span><span style="color: #0000ff">=&quot;NotSet|Navigate|PostBack|Inactive&quot;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  54:</span>                 <span style="color: #ff0000">NavigateUrl</span><span style="color: #0000ff">=&quot;uri&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  55:</span>                 <span style="color: #ff0000">PostBackValue</span><span style="color: #0000ff">=&quot;string&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  56:</span>                 <span style="color: #ff0000">TabIndex</span><span style="color: #0000ff">=&quot;integer&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  57:</span>                 <span style="color: #ff0000">Target</span><span style="color: #0000ff">=&quot;string|_blank|_parent|_search|_self|_top&quot;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  58:</span>             <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  59:</span>             <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:RectangleHotSpot</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  60:</span>                 <span style="color: #ff0000">AccessKey</span><span style="color: #0000ff">=&quot;string&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  61:</span>                 <span style="color: #ff0000">AlternateText</span><span style="color: #0000ff">=&quot;string&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  62:</span>                 <span style="color: #ff0000">Bottom</span><span style="color: #0000ff">=&quot;integer&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  63:</span>                 <span style="color: #ff0000">HotSpotMode</span><span style="color: #0000ff">=&quot;NotSet|Navigate|PostBack|Inactive&quot;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  64:</span>                 <span style="color: #ff0000">Left</span><span style="color: #0000ff">=&quot;integer&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  65:</span>                 <span style="color: #ff0000">NavigateUrl</span><span style="color: #0000ff">=&quot;uri&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  66:</span>                 <span style="color: #ff0000">PostBackValue</span><span style="color: #0000ff">=&quot;string&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  67:</span>                 <span style="color: #ff0000">Right</span><span style="color: #0000ff">=&quot;integer&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  68:</span>                 <span style="color: #ff0000">TabIndex</span><span style="color: #0000ff">=&quot;integer&quot;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  69:</span>                 <span style="color: #ff0000">Target</span><span style="color: #0000ff">=&quot;string|_blank|_parent|_search|_self|_top&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  70:</span>                 <span style="color: #ff0000">Top</span><span style="color: #0000ff">=&quot;integer&quot;</span>            <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  71:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">asp:ImageMap</span><span style="color: #0000ff">&gt;</span> </pre>
</p></div>
</div>
<p><b>Q37. How do we Update &amp; Delete data in a GridView?<br />
    <br />A37. </b>GridView control can automatically render UI for modifying data through Update and Delete operations, provided the associated data source is configured to support these capabilities. The SqlDataSource control supports Update operations when its UpdateCommand property is set and Delete operations when its DeleteCommand property is set to a valid update or delete command or stored procedure. The UpdateCommand or DeleteCommand should contain parameter placeholders for each value that will be passed by the GridView control (more on this below). You can also specify an UpdateParameters or DeleteParameters collection to set properties for each parameter, such as the parameter data type, input/output direction, or default value. </p>
<p></p>
<div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px">
<div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:SqlDataSource</span> <span style="color: #ff0000">ID</span><span style="color: #0000ff">=&quot;SqlDataSource1&quot;</span> <span style="color: #ff0000">runat</span><span style="color: #0000ff">=&quot;server&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   2:</span>   <span style="color: #ff0000">ConnectionString</span><span style="color: #0000ff">=&quot;&lt;%$ ConnectionStrings:Pubs %&gt;&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   3:</span>   <span style="color: #ff0000">SelectCommand</span><span style="color: #0000ff">=&quot;SELECT [au_id], [au_lname], [au_fname], [state] FROM [authors]&quot;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   4:</span>   <span style="color: #ff0000">UpdateCommand</span><span style="color: #0000ff">=&quot;UPDATE [authors] SET [au_lname] = @au_lname, [au_fname] = @au_fname, [state] = @state WHERE [au_id] = @au_id&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   5:</span>   <span style="color: #ff0000">DeleteCommand</span><span style="color: #0000ff">=&quot;DELETE FROM [authors] WHERE [au_id] = @au_id&quot;</span><span style="color: #0000ff">/&gt;</span> </pre>
</p></div>
</div>
<p>To enable the UI in the GridView for Updates or Deletes, you can either set the AutoGenerateEditButton and AutoGenerateDeleteButton properties to true, or you can add a CommandField to the GridView control and enable its ShowEditButton and ShowDeleteButton properties. The GridView supports editing or deleting one row at a time. For editing, the user places the row in edit mode by clicking the Edit button, and then confirms the Update by clicking the Update button while the row is in edit mode. The user can also click the Cancel button to abort the edit operation and return to read-only mode.<br />
  <br />Inline code example&#8230;</p>
<div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px">
<div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:GridView</span> <span style="color: #ff0000">ID</span><span style="color: #0000ff">=&quot;GridView1&quot;</span> <span style="color: #ff0000">AllowSorting</span><span style="color: #0000ff">=&quot;true&quot;</span> <span style="color: #ff0000">AllowPaging</span><span style="color: #0000ff">=&quot;true&quot;</span> <span style="color: #ff0000">Runat</span><span style="color: #0000ff">=&quot;server&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   2:</span>         <span style="color: #ff0000">DataSourceID</span><span style="color: #0000ff">=&quot;SqlDataSource1&quot;</span> <span style="color: #ff0000">AutoGenerateEditButton</span><span style="color: #0000ff">=&quot;true&quot;</span> <span style="color: #ff0000">DataKeyNames</span><span style="color: #0000ff">=&quot;au_id&quot;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   3:</span>         <span style="color: #ff0000">AutoGenerateColumns</span><span style="color: #0000ff">=&quot;False&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   4:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">Columns</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   5:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">ReadOnly</span><span style="color: #0000ff">=&quot;true&quot;</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;ID&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;au_id&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;au_id&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   6:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;Last Name&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;au_lname&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;au_lname&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   7:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;First Name&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;au_fname&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;au_fname&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   8:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;Phone&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;phone&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;phone&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   9:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;Address&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;address&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;address&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  10:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;City&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;city&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;city&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  11:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;State&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;state&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;state&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  12:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;Zip Code&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;zip&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;zip&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  13:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:CheckBoxField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;Contract&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;contract&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;contract&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  14:</span>         <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Columns</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  15:</span>       <span style="color: #0000ff">&lt;/</span><span style="color: #800000">asp:GridView</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  16:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:SqlDataSource</span> <span style="color: #ff0000">ID</span><span style="color: #0000ff">=&quot;SqlDataSource1&quot;</span> <span style="color: #ff0000">Runat</span><span style="color: #0000ff">=&quot;server&quot;</span> <span style="color: #ff0000">SelectCommand</span><span style="color: #0000ff">=&quot;SELECT [au_id], [au_lname], [au_fname], [phone], [address], [city], [state], [zip], [contract] FROM [authors]&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  17:</span>         <span style="color: #ff0000">UpdateCommand</span><span style="color: #0000ff">=&quot;UPDATE [authors] SET [au_lname] = @au_lname, [au_fname] = @au_fname, [phone] = @phone, [address] = @address, [city] = @city, [state] = @state, [zip] = @zip, [contract] = @contract WHERE [au_id] = @au_id&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  18:</span>         <span style="color: #ff0000">ConnectionString</span><span style="color: #0000ff">=&quot;&lt;%$ ConnectionStrings:Pubs %&gt;&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
</p></div>
</div>
<p>Notice the naming convention for parameters in the Update statement assigned to UpdateCommand. The automatic capability of GridView and other data-bound controls to invoke the Update operation relies on this naming convention in order to work.<br />
  <br />Parameters are expected to be named the same as the associated field values returned by the SelectCommand. Using this naming convention makes it possible to align the values passed by the data-bound control to the data source with the parameters in the SQL update statement. </p>
<p><b>Q38. What is the DataKeyNames property?<br />
    <br />A38. </b>An important property that plays a special role in Update and Delete operations is the DataKeyNames property. This property is typically set to the names of fields from the data source that are part of a primary key used to match a given row in the data source. Multiple keys are comma-separated when specifying this property declaratively, although it is common to only have one primary key field. The values of fields specified by the DataKeyNames property are round-tripped in viewstate for the sake of retaining original values to pass to an Update or Delete operation, even if that field is not rendered as one of the columns in the GridView control. When the GridView invokes the data source Update or Delete operation, it passes the values of these fields to the data source in a special Keys dictionary, separate from the Values dictionary that contains new values entered by the user while the row is in edit mode (for update operations). The contents of the Values dictionary are obtained from the input controls rendered for the row in edit mode. To exclude a value from this dictionary, set the ReadOnly property to true on the corresponding BoundField in the Columns collection. If you are using the GridView designer in Visual Studio, the ReadOnly property is set to true for primary key fields by default. </p>
<p><b>Q39. How do we filter GridView data in </b><b>ASP.NET</b> 2.0 as compared to Datagrid in <b>ASP.NET</b> 1.1? </p>
<p><b>A39. </b>A common scenario in data-driven pages is the ability to filter data in a report. For example, suppose the user could select from a set of field values in a DropDownList to filter the report grid to only display rows with a matching field value. In ASP.NET v1.x, you would have needed to perform the following steps in code: </p>
<p><b>Cancel databinding in Page_Load if the request is a postback<br />
    <br />Handle SelectedIndexChanged event </p>
<p>Add DropDownList SelectedValue to command&#8217;s Parameters collection </p>
<p>Execute the command and call DataBind </b></p>
<p>In ASP.NET 2.0, this code is eliminated through the use of declarative Data Parameter objects. A data parameter allows external values to be declaratively associated with data source operations. These parameters are usually associated with a variable in a command expression or property, for example a parameter in a SQL statement or stored procedure for </p>
<p>SqlDataSource. Data source controls expose parameter collection properties that can contain parameter objects for each supported data operation. For example: </p>
<p></p>
<div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px">
<div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:DropDownList</span> <span style="color: #ff0000">ID</span><span style="color: #0000ff">=&quot;DropDownList1&quot;</span> ... <span style="color: #ff0000">runat</span><span style="color: #0000ff">=&quot;server&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   2:</span> ...</pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   3:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:SqlDataSource</span> <span style="color: #ff0000">ID</span><span style="color: #0000ff">=&quot;SqlDataSource1&quot;</span> <span style="color: #ff0000">runat</span><span style="color: #0000ff">=&quot;server&quot;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   4:</span>   <span style="color: #ff0000">ConnectionString</span><span style="color: #0000ff">=&quot;&lt;%$ ConnectionStrings:Pubs %&gt;&quot;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   5:</span>   <span style="color: #ff0000">SelectCommand</span><span style="color: #0000ff">=&quot;SELECT [au_id], [au_lname], [au_fname], [state] FROM [authors] WHERE [state] = @state&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   6:</span>   <span style="color: #0000ff">&lt;</span><span style="color: #800000">SelectParameters</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   7:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:ControlParameter</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;state&quot;</span> <span style="color: #ff0000">ControlID</span><span style="color: #0000ff">=&quot;DropDownList1&quot;</span> <span style="color: #ff0000">PropertyName</span><span style="color: #0000ff">=&quot;SelectedValue&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   8:</span>   <span style="color: #0000ff">&lt;/</span><span style="color: #800000">SelectParameters</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   9:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">asp:SqlDataSource</span><span style="color: #0000ff">&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  10:</span> Inline code example...</pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  11:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:GridView</span> <span style="color: #ff0000">ID</span><span style="color: #0000ff">=&quot;GridView1&quot;</span> <span style="color: #ff0000">AllowSorting</span><span style="color: #0000ff">=&quot;True&quot;</span> <span style="color: #ff0000">AllowPaging</span><span style="color: #0000ff">=&quot;True&quot;</span> <span style="color: #ff0000">Runat</span><span style="color: #0000ff">=&quot;server&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  12:</span>         <span style="color: #ff0000">DataSourceID</span><span style="color: #0000ff">=&quot;SqlDataSource1&quot;</span> <span style="color: #ff0000">AutoGenerateEditButton</span><span style="color: #0000ff">=&quot;True&quot;</span> <span style="color: #ff0000">DataKeyNames</span><span style="color: #0000ff">=&quot;au_id&quot;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  13:</span>         <span style="color: #ff0000">AutoGenerateColumns</span><span style="color: #0000ff">=&quot;False&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  14:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">Columns</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  15:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">ReadOnly</span><span style="color: #0000ff">=&quot;true&quot;</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;ID&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;au_id&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;au_id&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  16:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;Last Name&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;au_lname&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;au_lname&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  17:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;First Name&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;au_fname&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;au_fname&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  18:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;Phone&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;phone&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;phone&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  19:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;Address&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;address&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;address&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  20:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;City&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;city&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;city&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  21:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;State&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;state&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;state&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  22:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;Zip Code&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;zip&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;zip&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  23:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:CheckBoxField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;Contract&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;contract&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;contract&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  24:</span>         <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Columns</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  25:</span>       <span style="color: #0000ff">&lt;/</span><span style="color: #800000">asp:GridView</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  26:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:SqlDataSource</span> <span style="color: #ff0000">ID</span><span style="color: #0000ff">=&quot;SqlDataSource1&quot;</span> <span style="color: #ff0000">Runat</span><span style="color: #0000ff">=&quot;server&quot;</span> <span style="color: #ff0000">SelectCommand</span><span style="color: #0000ff">=&quot;SELECT [au_id], [au_lname], [au_fname], [phone], </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  27:</span> [address], [city], [state], [zip], [contract] FROM [authors] WHERE [state] = @state&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  28:</span>         <span style="color: #ff0000">UpdateCommand</span><span style="color: #0000ff">=&quot;UPDATE [authors] SET [au_lname] = @au_lname, [au_fname] = @au_fname, [phone] = @phone, [address] = </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  29:</span> @address, [city] = @city, [state] = @state, [zip] = @zip, [contract] = @contract WHERE [au_id] = @au_id&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  30:</span>         <span style="color: #ff0000">ConnectionString</span><span style="color: #0000ff">=&quot;&lt;%$ ConnectionStrings:Pubs %&gt;&quot;</span><span style="color: #0000ff">&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  31:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">SelectParameters</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  32:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:QueryStringParameter</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;state&quot;</span> <span style="color: #ff0000">QueryStringField</span><span style="color: #0000ff">=&quot;state&quot;</span> <span style="color: #ff0000">DefaultValue</span><span style="color: #0000ff">=&quot;CA&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  33:</span>         <span style="color: #0000ff">&lt;/</span><span style="color: #800000">SelectParameters</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  34:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">UpdateParameters</span><span style="color: #0000ff">&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  35:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:Parameter</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;au_lname&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  36:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:Parameter</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;au_fname&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  37:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:Parameter</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;phone&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  38:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:Parameter</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;address&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  39:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:Parameter</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;city&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  40:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:Parameter</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;state&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  41:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:Parameter</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;zip&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  42:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:Parameter</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;contract&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  43:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:Parameter</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;au_id&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  44:</span>         <span style="color: #0000ff">&lt;/</span><span style="color: #800000">UpdateParameters</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  45:</span>       <span style="color: #0000ff">&lt;/</span><span style="color: #800000">asp:SqlDataSource</span><span style="color: #0000ff">&gt;</span> </pre>
</p></div>
</div>
<p><b>Q40. How do we enabling Caching for a DataSource Control?</b> </p>
<p><b>A40. </b>To enable caching for the SqlDataSource control (and also ObjectDataSource), set the EnableCaching property to true. You can specify the length of time (in seconds) to store an entry in the cache using the CacheDuration property. You can also set the CacheExpirationPolicy property to either Sliding or Absolute just as you can do from the cache API. Caching is only supported on the SqlDataSource control when the DataSourceMode property is set to &quot;DataSet&quot;. For example, if you set CacheDuration to 5 and SlidingExpiration to Absolute, the SqlDataSource will retrieve data from the database on the first request to the page and store this data in the cache. For subsequent requests, the SqlDataSource will attempt to retrieve the cache entry to serve the request without going back to the original database. After 5 seconds (or perhaps earlier, if cache memory pressure is high), the cache entry will be purged and a subsequent request to the page causes SqlDataSource to go back to the database again (repeating the caching process with the new data). </p>
<p>If you instead set CacheDuration to 5 and SlidingExpiration to Sliding, the cached data will have its time-to-live periodically refreshed as long as the data source requests the cached data once every 5 seconds. If a page requests the cached data at least once every 5 seconds, and there is no cache memory pressure, the cached data effectively remains in the cache forever. On the other hand, if no requests are made for the cached data within a 5 second time period, then the cached item is purged and the next time a request occurs the SqlDataSource control will go back to the original database again. </p>
<p>The example below demonstrates caching with the SqlDataSource control. The TimeStamp column updates each time the query is executed, so you can see how often the data is retrieved from the database versus retrieved from the cache. Note that approximately every five seconds, the TimeStamp updates. </p>
<p>Inline Code Example of Caching&#8230;</p>
<div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px">
<div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:DropDownList</span> <span style="color: #ff0000">ID</span><span style="color: #0000ff">=&quot;DropDownList1&quot;</span> <span style="color: #ff0000">DataSourceID</span><span style="color: #0000ff">=&quot;SqlDataSource2&quot;</span> <span style="color: #ff0000">AutoPostBack</span><span style="color: #0000ff">=&quot;true&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   2:</span>         <span style="color: #ff0000">DataTextField</span><span style="color: #0000ff">=&quot;state&quot;</span> <span style="color: #ff0000">Runat</span><span style="color: #0000ff">=&quot;server&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   3:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:SqlDataSource</span> <span style="color: #ff0000">ID</span><span style="color: #0000ff">=&quot;SqlDataSource2&quot;</span> <span style="color: #ff0000">Runat</span><span style="color: #0000ff">=&quot;server&quot;</span> <span style="color: #ff0000">SelectCommand</span><span style="color: #0000ff">=&quot;SELECT DISTINCT [state] FROM [authors]&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   4:</span>         <span style="color: #ff0000">ConnectionString</span><span style="color: #0000ff">=&quot;&lt;%$ ConnectionStrings:Pubs %&gt;&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   5:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">br</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   6:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">br</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   7:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:GridView</span> <span style="color: #ff0000">ID</span><span style="color: #0000ff">=&quot;GridView1&quot;</span> <span style="color: #ff0000">AllowSorting</span><span style="color: #0000ff">=&quot;True&quot;</span> <span style="color: #ff0000">AllowPaging</span><span style="color: #0000ff">=&quot;True&quot;</span> <span style="color: #ff0000">Runat</span><span style="color: #0000ff">=&quot;server&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   8:</span>         <span style="color: #ff0000">DataSourceID</span><span style="color: #0000ff">=&quot;SqlDataSource1&quot;</span> <span style="color: #ff0000">AutoGenerateEditButton</span><span style="color: #0000ff">=&quot;True&quot;</span> <span style="color: #ff0000">DataKeyNames</span><span style="color: #0000ff">=&quot;au_id&quot;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   9:</span>         <span style="color: #ff0000">AutoGenerateColumns</span><span style="color: #0000ff">=&quot;False&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  10:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">Columns</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  11:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;TimeStamp&quot;</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;TimeStamp&quot;</span> <span style="color: #ff0000">ReadOnly</span><span style="color: #0000ff">=&quot;True&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  12:</span>             <span style="color: #0000ff">&lt;</span><span style="color: #800000">ItemStyle</span> <span style="color: #ff0000">Font-Bold</span><span style="color: #0000ff">=&quot;True&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  13:</span>           <span style="color: #0000ff">&lt;/</span><span style="color: #800000">asp:BoundField</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  14:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">ReadOnly</span><span style="color: #0000ff">=&quot;True&quot;</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;ID&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;au_id&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;au_id&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  15:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;Last Name&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;au_lname&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;au_lname&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  16:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;First Name&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;au_fname&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;au_fname&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  17:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;Phone&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;phone&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;phone&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  18:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;Address&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;address&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;address&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  19:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;City&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;city&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;city&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  20:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;State&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;state&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;state&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  21:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;Zip Code&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;zip&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;zip&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  22:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:CheckBoxField</span> <span style="color: #ff0000">HeaderText</span><span style="color: #0000ff">=&quot;Contract&quot;</span> <span style="color: #ff0000">SortExpression</span><span style="color: #0000ff">=&quot;contract&quot;</span> <span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&quot;contract&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  23:</span>         <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Columns</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  24:</span>       <span style="color: #0000ff">&lt;/</span><span style="color: #800000">asp:GridView</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  25:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:SqlDataSource</span> <span style="color: #ff0000">ID</span><span style="color: #0000ff">=&quot;SqlDataSource1&quot;</span> <span style="color: #ff0000">Runat</span><span style="color: #0000ff">=&quot;server&quot;</span> <span style="color: #ff0000">SelectCommand</span><span style="color: #0000ff">=&quot;SELECT DatePart(second, GetDate()) As TimeStamp, </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  26:</span> [au_id], [au_lname], [au_fname], [phone], [address], [city], [state], [zip], [contract] FROM [authors] WHERE [state] = </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  27:</span> @state&quot;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  28:</span>         <span style="color: #ff0000">UpdateCommand</span><span style="color: #0000ff">=&quot;UPDATE [authors] SET [au_lname] = @au_lname, [au_fname] = @au_fname, [phone] = @phone, [address] = @address, [city] = @city, [state] = @state, [zip] = @zip, [contract] = @contract WHERE [au_id] = @au_id&quot;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  29:</span>         <span style="color: #ff0000">ConnectionString</span><span style="color: #0000ff">=&quot;&lt;%$ ConnectionStrings:Pubs %&gt;&quot;</span> <span style="color: #ff0000">CacheDuration</span><span style="color: #0000ff">=&quot;5&quot;</span> <span style="color: #ff0000">EnableCaching</span><span style="color: #0000ff">=&quot;True&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  30:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">SelectParameters</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  31:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:ControlParameter</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;state&quot;</span> <span style="color: #ff0000">ControlID</span><span style="color: #0000ff">=&quot;DropDownList1&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  32:</span>         <span style="color: #0000ff">&lt;/</span><span style="color: #800000">SelectParameters</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  33:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">UpdateParameters</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  34:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:Parameter</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;au_lname&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  35:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:Parameter</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;au_fname&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  36:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:Parameter</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;phone&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  37:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:Parameter</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;address&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  38:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:Parameter</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;city&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  39:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:Parameter</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;state&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  40:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:Parameter</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;zip&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  41:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:Parameter</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;contract&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  42:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:Parameter</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;au_id&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  43:</span>         <span style="color: #0000ff">&lt;/</span><span style="color: #800000">UpdateParameters</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  44:</span>       <span style="color: #0000ff">&lt;/</span><span style="color: #800000">asp:SqlDataSource</span><span style="color: #0000ff">&gt;</span> </pre>
</p></div>
</div>
<p><b>Q41. How to do a language switch in the Masterpage?</b> </p>
<p><b>A41. </b>Declare a dropdown as usual in the master page. Instead of overriding the InitializeCulture() place the same code in the Application_BeginRequest event handler in the global.asax. It is very similar to InitializeCulture() in the sense that it occurs early and no controls are ready yet. We have a little problem though, now the control is declared in a template and its name and id attributes rendered differently. </p>
<p>Another collection like the form variables collection that is also not originally server collection is the cookies collection. I use the cookie but it can be any of the ways for cross page communication that do not depend on server controls, like profile, session, querystring etc. We cannot use a cookie to carry the culture name value which comes from the dropdown selected item value, because the culture would always be a step behind. It would be set early on but later the dropdown selection change it but the resources for the previous culture come up. So normally only the page containing the dropdown would be a step behind, but because the dropdown is in the master page it appears that the whole site is ALWAYS ONE STEP BEHIND. </p>
<p>If, however, in the cookie, we pass the control name (which is information that never changes, so we can never be behind), instead of the culture name( which we can never keep up with), and then use that key to get the form variable value, we have pieced ourselves a workaround. </p>
<p><b>in the master page:</b></p>
<div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px">
<div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:DropDownList</span> <span style="color: #ff0000">runat</span><span style="color: #0000ff">=&quot;server&quot;</span> <span style="color: #ff0000">ID</span><span style="color: #0000ff">=&quot;DropDownList1&quot;</span> <span style="color: #ff0000">AutoPostBack</span><span style="color: #0000ff">=&quot;true&quot;</span> <span style="color: #ff0000">OnSelectedIndexChanged</span><span style="color: #0000ff">=&quot;DropDownList1_SelectedIndexChanged&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   2:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:ListItem</span> <span style="color: #ff0000">Value</span><span style="color: #0000ff">=&quot;en&quot;</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;English&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   3:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:ListItem</span> <span style="color: #ff0000">Value</span><span style="color: #0000ff">=&quot;fr&quot;</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;French&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   4:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:ListItem</span> <span style="color: #ff0000">Value</span><span style="color: #0000ff">=&quot;de&quot;</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;German&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   5:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">asp:DropDownList</span><span style="color: #0000ff">&gt;</span> </pre>
</p></div>
</div>
<p>&#160;</p>
<div>
<div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   1:</span> <span style="color: #0000ff">protected</span> <span style="color: #0000ff">void</span> DropDownList1_SelectedIndexChanged(<span style="color: #0000ff">object</span> sender, EventArgs e){</pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   2:</span>    HttpCookie cookie = <span style="color: #0000ff">new</span> HttpCookie(<span style="color: #006080">&quot;DropDownName&quot;</span>);</pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   3:</span>    cookie.Value=DropDownList1.UniqueID ;</pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   4:</span>    Response.SetCookie(cookie);</pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   5:</span> } </pre>
</p></div>
</div>
<p><b>In global.asax</b></p>
<div>
<div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   1:</span> <span style="color: #0000ff">void</span> Application_BeginRequest(Object sender, EventArgs e){</pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   2:</span>       <span style="color: #0000ff">string</span> lang = <span style="color: #0000ff">string</span>.Empty;<span style="color: #008000">//default to the invariant culture</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   3:</span>       HttpCookie cookie = Request.Cookies[<span style="color: #006080">&quot;DropDownName&quot;</span>]; </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   4:</span>       <span style="color: #0000ff">if</span> (cookie != <span style="color: #0000ff">null</span> &amp;&amp; cookie.Value != <span style="color: #0000ff">null</span>)</pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   5:</span>          lang = Request.Form[cookie.Value]; </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   6:</span>       Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(lang);</pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   7:</span>       Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(lang);</pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   8:</span> } </pre>
</p></div>
</div>
<p>Notice, there is absolutely no code in any of the content pages. Thats it ten lines of code and we are done for the whole site. This is not complete code, just a tip and trick of using master page and the .net event model to globalize code. </p>
<p><b>Q42. How to send a mail using System.Net.Mail? </b></p>
<p><b>(This question is answered by Ryan Olshan) </b><a href="http://community.strongcoders.com/blogs/ryan/"><b>Ryan Olshan&#8217;s Blog</b></a> </p>
<p><b>A42. </b>Here is the code&#8230;</p>
<div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px">
<div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   1:</span> <span style="color: #0000ff">Imports</span> System.Net.Mail </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   2:</span>&#160; </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   3:</span> <span style="color: #0000ff">Public</span> <span style="color: #0000ff">Class</span> MailHelper</pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   4:</span>    <span style="color: #008000">''' &lt;summary&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   5:</span>    <span style="color: #008000">''' Sends an mail message</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   6:</span>    <span style="color: #008000">''' &lt;/summary&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   7:</span>    <span style="color: #008000">''' &lt;param name=&quot;from&quot;&gt;Sender address&lt;/param&gt; </span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   8:</span>    <span style="color: #008000">''' &lt;param name=&quot;recepient&quot;&gt;Recepient address&lt;/param&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   9:</span>    <span style="color: #008000">''' &lt;param name=&quot;bcc&quot;&gt;Bcc recepient&lt;/param&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  10:</span>    <span style="color: #008000">''' &lt;param name=&quot;cc&quot;&gt;Cc recepient&lt;/param&gt; </span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  11:</span>    <span style="color: #008000">''' &lt;param name=&quot;subject&quot;&gt;Subject of mail message&lt;/param&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  12:</span>    <span style="color: #008000">''' &lt;param name=&quot;body&quot;&gt;Body of mail message&lt;/param&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  13:</span>    <span style="color: #0000ff">Public</span> <span style="color: #0000ff">Shared</span> <span style="color: #0000ff">Sub</span> SendMailMessage(<span style="color: #0000ff">ByVal</span> from <span style="color: #0000ff">As</span> <span style="color: #0000ff">String</span>, <span style="color: #0000ff">ByVal</span> recepient <span style="color: #0000ff">As</span> <span style="color: #0000ff">String</span>, <span style="color: #0000ff">ByVal</span> bcc <span style="color: #0000ff">As</span> <span style="color: #0000ff">String</span>, <span style="color: #0000ff">ByVal</span> cc <span style="color: #0000ff">As</span> <span style="color: #0000ff">String</span>, <span style="color: #0000ff">ByVal</span> subject <span style="color: #0000ff">As</span> <span style="color: #0000ff">String</span>, <span style="color: #0000ff">ByVal</span> body <span style="color: #0000ff">As</span> <span style="color: #0000ff">String</span>)</pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  14:</span>       <span style="color: #008000">' Instantiate a new instance of MailMessage</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  15:</span>       <span style="color: #0000ff">Dim</span> mMailMessage <span style="color: #0000ff">As</span> <span style="color: #0000ff">New</span> MailMessage() </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  16:</span>       <span style="color: #008000">' Set the sender address of the mail message </span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  17:</span>       mMailMessage.From = <span style="color: #0000ff">New</span> MailAddress(from)</pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  18:</span>       <span style="color: #008000">' Set the recepient address of the mail message</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  19:</span>       mMailMessage.<span style="color: #0000ff">To</span>.Add(<span style="color: #0000ff">New</span> MailAddress(recepient)) </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  20:</span>       <span style="color: #008000">' Check if the bcc value is nothing or an empty string</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  21:</span>       <span style="color: #0000ff">If</span> <span style="color: #0000ff">Not</span> bcc <span style="color: #0000ff">Is</span> <span style="color: #0000ff">Nothing</span> <span style="color: #0000ff">And</span> bcc &lt;&gt; <span style="color: #0000ff">String</span>.Empty <span style="color: #0000ff">Then</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  22:</span>          <span style="color: #008000">' Set the Bcc address of the mail message </span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  23:</span>          mMailMessage.Bcc.Add(<span style="color: #0000ff">New</span> MailAddress(bcc))</pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  24:</span>       <span style="color: #0000ff">End</span> <span style="color: #0000ff">If</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  25:</span>       <span style="color: #008000">' Check if the cc value is nothing or an empty value</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  26:</span>       <span style="color: #0000ff">If</span> <span style="color: #0000ff">Not</span> cc <span style="color: #0000ff">Is</span> <span style="color: #0000ff">Nothing</span> <span style="color: #0000ff">And</span> cc &lt;&gt; <span style="color: #0000ff">String</span>.Empty <span style="color: #0000ff">Then</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  27:</span>          <span style="color: #008000">' Set the CC address of the mail message</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  28:</span>          mMailMessage.CC.Add(<span style="color: #0000ff">New</span> MailAddress(cc))</pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  29:</span>       <span style="color: #0000ff">End</span> <span style="color: #0000ff">If</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  30:</span>       <span style="color: #008000">' Set the subject of the mail message</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  31:</span>       mMailMessage.Subject = subject</pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  32:</span>       <span style="color: #008000">' Set the body of the mail message</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  33:</span>       mMailMessage.Body = body </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  34:</span>       <span style="color: #008000">' Set the format of the mail message body as HTML</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  35:</span>       mMailMessage.IsBodyHtml = <span style="color: #0000ff">True</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  36:</span>       <span style="color: #008000">' Set the priority of the mail message to normal</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  37:</span>       mMailMessage.Priority = MailPriority.Normal </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  38:</span>       <span style="color: #008000">' Instantiate a new instance of SmtpClient</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  39:</span>       <span style="color: #0000ff">Dim</span> mSmtpClient <span style="color: #0000ff">As</span> <span style="color: #0000ff">New</span> SmtpClient()</pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  40:</span>       <span style="color: #008000">' Send the mail message</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  41:</span>       mSmtpClient.Send(mMailMessage)</pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  42:</span>    <span style="color: #0000ff">End</span> <span style="color: #0000ff">Sub</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  43:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">Class</span> </pre>
</p></div>
</div>
<p><b>Web.config</b></p>
<div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px">
<div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;?</span><span style="color: #800000">xml</span> <span style="color: #ff0000">version</span><span style="color: #0000ff">=&quot;1.0&quot;</span>?<span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   2:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">configuration</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   3:</span>    <span style="color: #0000ff">&lt;</span><span style="color: #800000">system.net</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   4:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">mailSettings</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   5:</span>          <span style="color: #0000ff">&lt;</span><span style="color: #800000">smtp</span> <span style="color: #ff0000">from</span><span style="color: #0000ff">=&quot; defaultEmail@yourdomain.com&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   6:</span>             <span style="color: #0000ff">&lt;</span><span style="color: #800000">network</span> <span style="color: #ff0000">host</span><span style="color: #0000ff">=&quot;smtp.yourdomain.com&quot;</span> <span style="color: #ff0000">port</span><span style="color: #0000ff">=&quot;25&quot;</span> <span style="color: #ff0000">userName</span><span style="color: #0000ff">=&quot;yourUserName&quot;</span> <span style="color: #ff0000">password</span><span style="color: #0000ff">=&quot;yourPassword&quot;</span><span style="color: #0000ff">/&gt;</span> </pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   7:</span>          <span style="color: #0000ff">&lt;/</span><span style="color: #800000">smtp</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   8:</span>       <span style="color: #0000ff">&lt;/</span><span style="color: #800000">mailSettings</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   9:</span>    <span style="color: #0000ff">&lt;/</span><span style="color: #800000">system.net</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  10:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">configuration</span><span style="color: #0000ff">&gt;</span> </pre>
</p></div>
</div>
<p><b>Q43. Does the </b><b>ASP.NET</b> Development Server support running web pages from a computer other than the local computer? </p>
<p><b>A43</b>. No. It will not serve pages to another computer. Additionally, it will not serve files that are outside of the application scope. The ASP.NET Development Server provides an efficient way to test pages locally before you publish the pages to a production server running IIS. </p>
<p><b>Q44.</b> Whats the difference between running pages on ASP.NET Development Server and IIS? </p>
<p><b>A44.</b> An important difference between the ASP.NET Development Server and IIS is the security context in which the respective servers run your ASP.NET pages. This difference can affect your testing because of differences in how the pages run. </p>
<p>When you run a page using the ASP.NET Development Server, the page runs in the context of your current user account. For example, if you are running as an administrator-level user, a page running in the ASP.NET Development Server will have administrator-level privileges. In contrast, in IIS, ASP.NET by default runs in the context of the special user (ASPNET or NETWORK SERVICES) that typically has limited privileges. The ASPNET or NETWORK SERVICES accounts are local to the server computer (not domain accounts), which restricts access to resources on other computers. </p>
<p>If you are simply reading and running the code in ASP.NET pages, this difference is not very important. However, the different security contexts for the two Web servers can affect your testing of the following: </p>
<p><b>Access to other resources that the page requires</b>&#160;&#160; This can include reading and writing files other than Web pages, reading and writing the Windows registry, and so on. </p>
<p><b>Database access</b>&#160;&#160; When working with the ASP.NET Development Server, you can typically rely on Windows Integrated authentication to access SQL Server. However, when the same page runs in IIS under the ASPNET or NETWORK SERVICES account, the page is running in the context of a local user, and you often have to configure the page to use a connection string that includes information about a user and password. </p>
<p><b>Code access security</b>&#160;&#160; If your page involves access to resources that are protected under different zones, the page might run differently under the ASP.NET Development Server and IIS. </p>
<div class="simplesocialbuttons">
<div class="simplesocialbutton ssb-button-googleplus"><!-- Google Plus One--><g:plusone size="medium" count="true" href="http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-1/"></g:plusone></div>
<div class="simplesocialbutton ssb-button-fblike"><!-- Facebook like--><div id="fb-root"></div><fb:like href="http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-1/" send="false" layout="button_count" width="100" show_faces="false" action="like" font=""></fb:like></div>
<div class="simplesocialbutton ssb-buttom-twitter"><!-- Twitter--><a name="twitter_share" data-count="horizontal" href="http://twitter.com/share" data-text="ASP.NET 2.0 Interview Questions #1" data-url="http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-1/" class="twitter-share-button" rel="nofollow"></a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.ms.oyangudi.com/blog/interview-questions-aspnet/asp-net-2-0-interview-questions-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

