<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-6408364537482106644</atom:id><lastBuildDate>Tue, 31 Jan 2012 06:10:32 +0000</lastBuildDate><category>Host</category><category>Assembly</category><category>Page Directive</category><category>DNS</category><category>Asp.net Directives</category><category>Web Space</category><category>Page directives</category><category>Dedicated server</category><category>directives</category><category>shared server</category><category>ketan</category><category>custom error log</category><category>Error log asp.net2.0</category><category>Web Host</category><category>Master Page Directive</category><category>PreviousPageDirective</category><category>.NET Application performance Tips and Tricks</category><category>Outputcache</category><category>create error log</category><category>Asp.net tips and tricks</category><title>Techincal Fruits</title><description /><link>http://ketan-technical-fruits.blogspot.com/</link><managingEditor>noreply@blogger.com (ketan raval)</managingEditor><generator>Blogger</generator><openSearch:totalResults>15</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/KetanRavalTechFruits" /><feedburner:info uri="ketanravaltechfruits" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:browserFriendly></feedburner:browserFriendly><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6408364537482106644.post-590138162779171547</guid><pubDate>Wed, 13 Aug 2008 07:43:00 +0000</pubDate><atom:updated>2008-08-12T01:39:31.081-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Asp.net Directives</category><category domain="http://www.blogger.com/atom/ns#">PreviousPageDirective</category><title>Asp.net Directvies  Previouspagetype</title><description>As Name suggest PreviousPageType directive is used to access previous page in currently executing page.PreviousPageType is a new directive makes excellence in asp.net 2.0 pages. The concept of cross-page posting between Asp.Net pages is achieved by this directive.&lt;br /&gt;&lt;br /&gt;it has 2 Attributes&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;TagName:&lt;/strong&gt; Sets the name of the derived class from which the postback                             will occur.                          &lt;br /&gt;                       &lt;br /&gt;And&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;VirutalPath:&lt;/strong&gt; sets the location of the posting page from which                             the postback will occur.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6408364537482106644-590138162779171547?l=ketan-technical-fruits.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://ketan-technical-fruits.blogspot.com/2008/08/aspnet-directviaes-previouspagetype.html</link><author>noreply@blogger.com (ketan raval)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6408364537482106644.post-8774549274687524735</guid><pubDate>Tue, 12 Aug 2008 06:28:00 +0000</pubDate><atom:updated>2008-08-12T00:03:32.048-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Asp.net Directives</category><category domain="http://www.blogger.com/atom/ns#">Page Directive</category><title>Asp.net Directive :Page</title><description>Page Directive defines Page specific attributes, which help to get command over customization of .aspx page.
&lt;br /&gt;
&lt;br /&gt;Main Attributes are
&lt;br /&gt;
&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Async&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;  Makes page enable for asynchronous  handler. Default value is false.
&lt;br /&gt;
&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;AsyncTimeOut&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;  It defines the time-out (in seconds) used for asynchronous processes. The default time out  is 45 seconds.Value must be in integer.
&lt;br /&gt;
&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;AspCompat  &lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;  A the page to be executed on a single-threaded apartment (STA) thread. This allows the page to call STA components, such as a component developed with Microsoft Visual Basic 6.0. Setting this attribute to true also allows the page to call COM+ version 1.0 components that require access to unmanaged Active Server Pages (ASP) built-in objects. default is false.
&lt;br /&gt;
&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;AutoEventWireup&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;  Indicates whether the page's events are autowired. true if event autowiring is enabled; otherwise, false.               
&lt;br /&gt;&lt;span sdata="langKeyword" value="ClassName"&gt;&lt;span class="keyword"&gt;
&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ClassName
&lt;br /&gt;
&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;   A string that specifies the name of the page class that will be dynamically compiled when the page is requested. &lt;span sdata="langKeyword" value="CodeFile"&gt;&lt;span class="keyword"&gt;
&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;
&lt;br /&gt;CodeFile &lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;S&lt;/span&gt;&lt;/span&gt;pecifies a path to the referenced code-behind file for the page.
&lt;br /&gt;&lt;span sdata="langKeyword" value="Culture"&gt;&lt;span class="keyword"&gt;
&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Culture&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;p&gt; Indicates the culture setting for the page. The value of this attribute must be a valid culture ID.&lt;/p&gt;&lt;dl class="authored"&gt;&lt;dt style="font-weight: bold;"&gt;&lt;span sdata="langKeyword" value="Debug"&gt;&lt;span class="keyword"&gt;Debug&lt;/span&gt;&lt;/span&gt;&lt;/dt&gt;&lt;dt style="font-weight: bold;"&gt;&lt;span style="font-weight: normal;"&gt;  Indicates whether the page should be compiled with debug symbols.&lt;/span&gt;&lt;/dt&gt;&lt;dd&gt;
&lt;br /&gt;&lt;/dd&gt;&lt;dt style="font-weight: bold;"&gt;&lt;span sdata="langKeyword" value="EnableEventValidation"&gt;&lt;span class="keyword"&gt;EnableEventValidation&lt;/span&gt;&lt;/span&gt;&lt;/dt&gt;&lt;dt&gt;
&lt;br /&gt;&lt;span sdata="langKeyword" value="EnableEventValidation"&gt;&lt;span class="keyword"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/dt&gt;&lt;dt&gt;   Validate  events in postback and callback scenarios. &lt;span sdata="langKeyword" value="true"&gt;&lt;span class="keyword"&gt;true&lt;/span&gt;&lt;/span&gt; if events are being validated; otherwise, &lt;span sdata="langKeyword" value="false"&gt;&lt;span class="keyword"&gt;false&lt;/span&gt;&lt;/span&gt;. The default is &lt;span sdata="langKeyword" value="true"&gt;&lt;span class="keyword"&gt;true&lt;/span&gt;&lt;/span&gt;.&lt;/dt&gt;&lt;dd&gt;
&lt;br /&gt;&lt;/dd&gt;&lt;dt&gt;  It reduces the risk of unauthorized postback requests and callbacks. When the &lt;span sdata="langKeyword" value="enableEventValidation"&gt;&lt;span class="keyword"&gt;enableEventValidation&lt;/span&gt;&lt;/span&gt; property is set to &lt;span sdata="langKeyword" value="true"&gt;&lt;span class="keyword"&gt;true&lt;/span&gt;&lt;/span&gt;, ASP.NET allows only the events that can be raised on the control during a postback request or callback.&lt;/dt&gt;&lt;dd&gt;
&lt;br /&gt;&lt;/dd&gt;&lt;dt style="font-weight: bold;"&gt;&lt;span sdata="langKeyword" value="EnableSessionState"&gt;&lt;span class="keyword"&gt;EnableSessionState&lt;/span&gt;&lt;/span&gt;&lt;/dt&gt;&lt;dt&gt;
&lt;br /&gt;&lt;span sdata="langKeyword" value="EnableSessionState"&gt;&lt;span class="keyword"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/dt&gt;&lt;dt&gt;    Defines session-state requirements for the page. &lt;span sdata="langKeyword" value="true"&gt;&lt;span class="keyword"&gt;true&lt;/span&gt;&lt;/span&gt; if session state is enabled; &lt;span sdata="langKeyword" value="ReadOnly"&gt;&lt;span class="keyword"&gt;ReadOnly&lt;/span&gt;&lt;/span&gt; if session state can be read but not changed; otherwise, &lt;span sdata="langKeyword" value="false"&gt;&lt;span class="keyword"&gt;false&lt;/span&gt;&lt;/span&gt;. The default is &lt;span sdata="langKeyword" value="true"&gt;&lt;span class="keyword"&gt;true&lt;/span&gt;&lt;/span&gt;.&lt;/dt&gt;&lt;/dl&gt;&lt;span style="font-weight: bold;" sdata="langKeyword" value="EnableTheming"&gt;&lt;span class="keyword"&gt;EnableTheming&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;&lt;dl class="authored"&gt;&lt;dt&gt;   Indicates whether themes are used on the page. &lt;span sdata="langKeyword" value="true"&gt;&lt;span class="keyword"&gt;true&lt;/span&gt;&lt;/span&gt; if themes are used; otherwise, &lt;span sdata="langKeyword" value="false"&gt;&lt;span class="keyword"&gt;false&lt;/span&gt;&lt;/span&gt;. The default is &lt;span sdata="langKeyword" value="true"&gt;&lt;span class="keyword"&gt;true&lt;/span&gt;&lt;/span&gt;.&lt;/dt&gt;&lt;dd&gt;
&lt;br /&gt;&lt;/dd&gt;&lt;dt style="font-weight: bold;"&gt;&lt;span sdata="langKeyword" value="EnableViewState"&gt;&lt;span class="keyword"&gt;EnableViewState&lt;/span&gt;&lt;/span&gt;&lt;/dt&gt;&lt;dd&gt;
&lt;br /&gt;&lt;/dd&gt;&lt;dt&gt;   Indicates whether view state is maintained across page requests. &lt;span sdata="langKeyword" value="true"&gt;&lt;span class="keyword"&gt;true&lt;/span&gt;&lt;/span&gt; if view state is maintained; otherwise, &lt;span sdata="langKeyword" value="false"&gt;&lt;span class="keyword"&gt;false&lt;/span&gt;&lt;/span&gt;. The default is &lt;span sdata="langKeyword" value="true"&gt;&lt;span class="keyword"&gt;true&lt;/span&gt;&lt;/span&gt;.                 &lt;/dt&gt;&lt;dt&gt;
&lt;br /&gt;&lt;span sdata="langKeyword" value="EnableViewStateMac"&gt;&lt;span class="keyword"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/dt&gt;&lt;dt style="font-weight: bold;"&gt;&lt;span sdata="langKeyword" value="EnableViewStateMac"&gt;&lt;span class="keyword"&gt;EnableViewStateMac&lt;/span&gt;&lt;/span&gt;&lt;/dt&gt;&lt;dt&gt;
&lt;br /&gt;&lt;span sdata="langKeyword" value="EnableViewStateMac"&gt;&lt;span class="keyword"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/dt&gt;&lt;dt&gt;    Indicates that ASP.NET should run a machine authentication check (MAC) on the page's view state when the page is posted back from the client. &lt;span sdata="langKeyword" value="true"&gt;&lt;span class="keyword"&gt;true&lt;/span&gt;&lt;/span&gt; if view state should be MAC checked; otherwise, &lt;span sdata="langKeyword" value="false"&gt;&lt;span class="keyword"&gt;false&lt;/span&gt;&lt;/span&gt;. The default is &lt;span sdata="langKeyword" value="true"&gt;&lt;span class="keyword"&gt;true&lt;/span&gt;&lt;/span&gt;.                 &lt;/dt&gt;&lt;dt&gt;    A view-state MAC is an encrypted version of the hidden variable that a page's view state is persisted to when sent to the browser. When you set this attribute to &lt;span sdata="langKeyword" value="true"&gt;&lt;span class="keyword"&gt;true&lt;/span&gt;&lt;/span&gt;, the encrypted view state is checked to verify that it has not been tampered with on the client. Note that setting this attribute to &lt;span sdata="langKeyword" value="true"&gt;&lt;span class="keyword"&gt;true&lt;/span&gt;&lt;/span&gt; affects performance, because the variable value must be decrypted and encrypted for each round trip of the page.&lt;/dt&gt;&lt;/dl&gt;&lt;span style="font-weight: bold;" sdata="langKeyword" value="ErrorPage"&gt;&lt;span class="keyword"&gt;ErrorPage&lt;/span&gt;&lt;/span&gt;&lt;p&gt;   Defines a target URL for redirection if an unhandled page exception occurs.                 &lt;/p&gt;&lt;span style="font-weight: bold;" sdata="langKeyword" value="MaintainScrollPositionOnPostback"&gt;&lt;span class="keyword"&gt;MaintainScrollPositionOnPostback&lt;/span&gt;&lt;/span&gt;&lt;p&gt;  Maintain user at  same position in the client browser after postback. &lt;span sdata="langKeyword" value="true"&gt;&lt;span class="keyword"&gt;true&lt;/span&gt;&lt;/span&gt; if users should be returned to the same position; otherwise, &lt;span sdata="langKeyword" value="false"&gt;&lt;span class="keyword"&gt;false&lt;/span&gt;&lt;/span&gt;.&lt;/p&gt;&lt;dl style="font-weight: bold;" class="authored"&gt;&lt;dt&gt;&lt;span sdata="langKeyword" value="SmartNavigation"&gt;&lt;span class="keyword"&gt;SmartNavigation&lt;/span&gt;&lt;/span&gt;&lt;/dt&gt;&lt;/dl&gt;&lt;dl&gt;&lt;dt&gt;   Indicates whether the page supports the smart navigation feature of Internet Explorer 5.5 or later. &lt;span sdata="langKeyword" value="true"&gt;&lt;span class="keyword"&gt;true&lt;/span&gt;&lt;/span&gt; if smart navigation is enabled; otherwise, &lt;span sdata="langKeyword" value="false"&gt;&lt;span class="keyword"&gt;false&lt;/span&gt;&lt;/span&gt;. The default is &lt;span sdata="langKeyword" value="false"&gt;&lt;span class="keyword"&gt;false&lt;/span&gt;&lt;/span&gt;.                   &lt;/dt&gt;&lt;/dl&gt;&lt;dl class="authored"&gt;&lt;dt style="font-weight: bold;"&gt;&lt;span sdata="langKeyword" value="Theme"&gt;&lt;span class="keyword"&gt;Theme&lt;/span&gt;&lt;/span&gt;&lt;/dt&gt;&lt;dt&gt;
&lt;br /&gt;&lt;/dt&gt;&lt;dt&gt;   Specifies a valid theme identifier to use on the page. When the &lt;span sdata="langKeyword" value="Theme"&gt;&lt;span class="keyword"&gt;Theme&lt;/span&gt;&lt;/span&gt; attribute is set without using the &lt;span sdata="langKeyword" value="StyleSheetTheme"&gt;&lt;span class="keyword"&gt;StyleSheetTheme&lt;/span&gt;&lt;/span&gt; attribute, it overrides individual style settings on controls, enabling you to create a unified and consistent look on a page.                 &lt;/dt&gt;&lt;/dl&gt;&lt;span style="font-weight: bold;" sdata="langKeyword" value="Title"&gt;&lt;span class="keyword"&gt;Title&lt;/span&gt;&lt;/span&gt;&lt;dl class="authored"&gt;&lt;dt&gt;   Specifies a title for the page which will  rendered as a &lt;span sdata="langKeyword" value=""&gt;html title&lt;span class="keyword"&gt;&lt;title&gt;&lt;/title&gt;&lt;/span&gt;&lt;/span&gt; tags in the response. The title can also be accessed programmatically as a property of the page.                  &lt;/dt&gt;&lt;/dl&gt;&lt;span style="font-weight: bold;" sdata="langKeyword" value="Transaction"&gt;&lt;span class="keyword"&gt;Transaction&lt;/span&gt;&lt;/span&gt;&lt;p&gt;   Tells that  transactions are supported on the page. Probable values are &lt;span sdata="langKeyword" value="Disabled"&gt;&lt;span class="keyword"&gt;Disabled&lt;/span&gt;&lt;/span&gt;, &lt;span sdata="langKeyword" value="NotSupported"&gt;&lt;span class="keyword"&gt;NotSupported&lt;/span&gt;&lt;/span&gt;, &lt;span sdata="langKeyword" value="Supported"&gt;&lt;span class="keyword"&gt;Supported&lt;/span&gt;&lt;/span&gt;, &lt;span sdata="langKeyword" value="Required"&gt;&lt;span class="keyword"&gt;Required&lt;/span&gt;&lt;/span&gt;, and &lt;span sdata="langKeyword" value="RequiresNew"&gt;&lt;span class="keyword"&gt;RequiresNew&lt;/span&gt;&lt;/span&gt;. The default is &lt;span sdata="langKeyword" value="Disabled"&gt;&lt;span class="keyword"&gt;Disabled&lt;/span&gt;&lt;/span&gt;.                 &lt;/p&gt;&lt;dl class="authored"&gt;&lt;span style="font-weight: bold;"&gt;ValidateRequest&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;   This attributes determines request validation should occur. If true, request validation ensure all input data against a hard-coded list of malicious values If a match occurs, an HttpRequestValidationException exception is thrown.
&lt;br /&gt;The default is true.                 
&lt;br /&gt;  This feature is enabled in the machine configuration file (Machine.config). You can disable it in your application configuration file (Web.config) or on the page by setting this attribute to false.&lt;dd&gt;&lt;p&gt;                 &lt;/p&gt;
&lt;br /&gt;&lt;/dd&gt;&lt;/dl&gt;I hope this will help you.
&lt;br /&gt;
&lt;br /&gt;Source :MSDN,dotnetspider,Forums.asp.net.
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6408364537482106644-8774549274687524735?l=ketan-technical-fruits.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://ketan-technical-fruits.blogspot.com/2008/08/aspnet-directive-page.html</link><author>noreply@blogger.com (ketan raval)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6408364537482106644.post-2936538887856715778</guid><pubDate>Sat, 09 Aug 2008 16:38:00 +0000</pubDate><atom:updated>2008-08-09T09:56:42.520-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Asp.net Directives</category><category domain="http://www.blogger.com/atom/ns#">Outputcache</category><title>Asp.net Directive :OutputCache</title><description>OutputCache as name suggest use to handle caching concept.&lt;br /&gt;&lt;br /&gt;It handles/control caching policies for asp.net pages or controls,&lt;br /&gt;users can handle caching programmatically also.&lt;br /&gt;&lt;br /&gt;Attributes are&lt;br /&gt;&lt;br /&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Duration&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;The time, in seconds, that the page or user control is cached. Setting this attribute on a page or user control establishes an expiration policy for HTTP responses from the object and will automatically cache the page or user control output.&lt;/dd&gt;&lt;/dl&gt;&lt;strong&gt;Location:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;To specify the location to store the output cache.&lt;br /&gt; To                             store the output cache on the browser client where the request originated set the                             value as ‘Client’.&lt;br /&gt;To store the output cache on any HTTP 1.1 cache-capable devices                             including the proxy servers and the client that made request, specify the Location                             as Downstream.&lt;br /&gt;To store the output cache on the Web server, mention the location                             as Server.&lt;br /&gt;&lt;br /&gt;                            &lt;strong&gt;VaryByControl:&lt;/strong&gt; List of strings used to vary the output cache of                             a user Control, separated with semi-colon.                            &lt;br /&gt;A semicolon-separated list of strings used to vary a user control's output cache. These strings represent the &lt;b&gt;ID&lt;/b&gt; property values of ASP.NET server controls declared in the user control.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;VaryByParam:&lt;/strong&gt; List of strings used to vary the output cache, separated                             with semi-colon.                            &lt;br /&gt;                           &lt;br /&gt;                            A semicolon-separated list of strings used to vary the output cache. By default, these strings correspond to a query string value sent with &lt;b&gt;GET&lt;/b&gt; method attributes, or a parameter sent using the &lt;b&gt;POST&lt;/b&gt; method. When this attribute is set to multiple parameters, the output cache contains a different version of the requested document for each specified parameter. Possible values include &lt;b&gt;none&lt;/b&gt;, &lt;b&gt;*&lt;/b&gt;, and any valid query string or &lt;b&gt;POST&lt;/b&gt; parameter name.&lt;br /&gt;&lt;br /&gt;                            &lt;strong&gt;VaryByCustom:&lt;/strong&gt;&lt;br /&gt;String of values, specifies the custom output caching                             requirements.                            &lt;br /&gt;                           &lt;br /&gt;                            &lt;strong&gt;VaryByHeader:&lt;/strong&gt; List of HTTP headers used to vary the output cache,                             separated with semi-colon.                            &lt;br /&gt;A semicolon-separated list of HTTP headers used to vary the output cache. When this attribute is set to multiple headers, the output cache contains a different version of the requested document for each specified header.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6408364537482106644-2936538887856715778?l=ketan-technical-fruits.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://ketan-technical-fruits.blogspot.com/2008/08/aspnet-directive-outputcache.html</link><author>noreply@blogger.com (ketan raval)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6408364537482106644.post-5142600825907432283</guid><pubDate>Fri, 08 Aug 2008 16:19:00 +0000</pubDate><atom:updated>2008-08-12T01:41:06.759-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Asp.net Directives</category><category domain="http://www.blogger.com/atom/ns#">Master Page Directive</category><title>Directives -Master</title><description>&lt;span&gt;&lt;span&gt; @Master directive                             belongs to Master Pages that is .master files.&lt;br /&gt;Master pages are use to mitigate redundant coding &amp;amp; programming.So, Master pages are use to create for integrating common code in all pages such as header footer,navigation , banners which are most common features in any web applications.&lt;br /&gt;&lt;br /&gt;This directive&lt;br /&gt;Defines master page–specific (.master file) attributes that are used by the ASP.NET page parser and compiler.&lt;br /&gt;&lt;br /&gt;Its Attributes are&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;AutoEventWireup&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To hook up event with control explicitly if it set false else  event auto-wiring is enabled;  The default is true.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ClassName&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Specifies the class name for the class that is automatically generated from the markup and compiled when the master page is processed. This value can be any valid class name and can include a namespace.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;CodeFile&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Specifies the name of a separate file that contains a partial class with the event handlers and other master page–specific code.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;CompilationMode&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Specifies whether to compile an ASP.NET master page at run time. Options are Always to always compile the page; Auto, if ASP.NET is to avoid compiling the page, if possible; and Never, to never compile the page or control. The default is Always.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;CompilerOptions&lt;/span&gt;&lt;br /&gt;Provides a string containing compiler options to use to compile the page. In C# and Microsoft Visual Basic, this is a sequence of compiler command-line switches.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Debug&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Indicates whether to compile the master page with debug symbols. true, to compile with debug symbols; otherwise, false.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Description&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Provides a text description of the master page. This value is ignored by the ASP.NET parser.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;EnableTheming&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Indicates whether the appearance of the master page and of controls on the master page can be modified, if a theme is applied. true if a theme can be applied; otherwise, false. The default is true. Setting the EnableTheming attribute is primarily useful when a page theme is defined in the Web.config file and applies to all pages, by default.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;EnableViewState&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Indicates whether view state is maintained across page requests. true to maintain view state; otherwise, false. The default is true.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Explicit&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Determines whether the page is compiled using the Visual Basic Option Explicit mode. true indicates that the Visual Basic explicit compile option is enabled and that all variables must be declared using a Dim, Private, Public, or ReDim statement; otherwise, false. The default is false.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Inherits&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Specifies a code-behind class for the page to inherit. This can be any class derived from the MasterPage class.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Language&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Specifies the language used when compiling all inline rendering (&lt;% %&gt; and &lt;%= %&gt;) and code declaration blocks within the page. Values can represent any language that is supported by the .NET Framework, including VB (Visual Basic), C#, and JScript.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;LinePragmas&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Determines whether the runtime should generate pragmas in the generated code.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;MasterPageFile&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Specifies the .master file that acts as a master page for a master page. The MasterPageFile attribute is used in a master page when defining a child master page in a nested master-page scenario.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Src&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Specifies the source file name of the code-behind class to dynamically compile when the page is requested. You can choose to include programming logic for your page either in a code-behind class or in a Code Declaration Blocks in the .aspx file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Strict&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Specifies whether to compile the page using the Visual Basic Option Strict mode. true if Option Strict is enabled; otherwise, false. The default is false.&lt;br /&gt;The Strict attribute is ignored by languages other than Visual Basic.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;WarningLevel&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It Specifies the compiler warning level at which you want the compiler to abort compilation for the page. Its Possible values are from 0 through 4.&lt;br /&gt;    &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6408364537482106644-5142600825907432283?l=ketan-technical-fruits.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://ketan-technical-fruits.blogspot.com/2008/08/directives-master.html</link><author>noreply@blogger.com (ketan raval)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6408364537482106644.post-1901010638040969638</guid><pubDate>Thu, 10 Jul 2008 09:20:00 +0000</pubDate><atom:updated>2008-07-10T02:24:52.158-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Asp.net Directives</category><category domain="http://www.blogger.com/atom/ns#">Assembly</category><title>Assembly Directive</title><description>&lt;span style="font-family:verdana;"&gt;Hi,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;strong&gt;Assembly Directive&lt;/strong&gt; used to link assembly in to our application.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;To &lt;strong&gt;Make our ASP.NET page aware of external components&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;It has following attibutes/property.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;a. &lt;strong&gt;Name&lt;/strong&gt;: Enables you specify the name of an assembly you want to attach to the page. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Here you should mention the filename without the extension. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;b. &lt;strong&gt;Src&lt;/strong&gt;: represents the name of a source code file&lt;br /&gt;&lt;%@ Assembly Name="YourAssemblyName" %&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6408364537482106644-1901010638040969638?l=ketan-technical-fruits.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://ketan-technical-fruits.blogspot.com/2008/07/assembly-directive.html</link><author>noreply@blogger.com (ketan raval)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6408364537482106644.post-1092982592040454858</guid><pubDate>Thu, 03 Jul 2008 13:03:00 +0000</pubDate><atom:updated>2008-07-03T06:05:31.339-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Asp.net Directives</category><category domain="http://www.blogger.com/atom/ns#">Page directives</category><category domain="http://www.blogger.com/atom/ns#">directives</category><title>Asp.net Directives</title><description>&lt;span style="font-family:verdana;"&gt;Directives are those things which handles the behavior of Asp.net pages.&lt;br /&gt;We have eleven directives to enrich and nurture our asp.net pages or user control. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;Directives are opened &lt;strong&gt;&lt;%@ and close with %&gt;&lt;/strong&gt;&lt;br /&gt;Developers have tendacy to decalre it on top of the page, It does not matter if you declare them at any part of  the page.&lt;br /&gt;List of directives in alphabatical order.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Assembly &lt;/strong&gt;:- Used to link assembly.Control :-  For User Control.Implements:- For &lt;strong&gt;implement&lt;/strong&gt; .Net interface.Import:- For Importing Namespace in to page or user control.&lt;br /&gt;&lt;strong&gt;Master &lt;/strong&gt;:- For Using Master page , .Master Page required.MasterType:-Associate a class name  to  get strongly typed refrences within the specfied master page.&lt;br /&gt;&lt;strong&gt;OutputCache&lt;/strong&gt;:-Controls the  Caching Mechanism.&lt;br /&gt;&lt;strong&gt;Page&lt;/strong&gt;:- Allow users to specify a page level attributes,Only can be used with Asp.net Page.&lt;br /&gt;&lt;strong&gt;PreviousPageType&lt;/strong&gt;:-Enables in asp.net Page to handles few things about previous page.&lt;br /&gt;&lt;strong&gt;Reference&lt;/strong&gt;:-Links page or user control to the current page or user control.&lt;br /&gt;&lt;strong&gt;Register&lt;/strong&gt;:-Associate aliase with namespaces and class name for notation in the custom server control.&lt;br /&gt;&lt;br /&gt;I will try to explain each useful directive one by one on my forthcoming&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt; posts.......&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6408364537482106644-1092982592040454858?l=ketan-technical-fruits.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://ketan-technical-fruits.blogspot.com/2008/07/aspnet-directives.html</link><author>noreply@blogger.com (ketan raval)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6408364537482106644.post-5615639352572566276</guid><pubDate>Sun, 29 Jun 2008 00:34:00 +0000</pubDate><atom:updated>2008-06-28T18:11:34.830-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">shared server</category><category domain="http://www.blogger.com/atom/ns#">Web Host</category><category domain="http://www.blogger.com/atom/ns#">DNS</category><category domain="http://www.blogger.com/atom/ns#">Web Space</category><category domain="http://www.blogger.com/atom/ns#">Dedicated server</category><category domain="http://www.blogger.com/atom/ns#">Host</category><title>Web Hosting and Domain</title><description>&lt;span style="font-family:verdana;font-size:85%;"&gt;Hi,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Let me share few information regarding Web hosting and DNS.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Web Host -Means Server where our website resides.This always up and connected to internet to make our web site active.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Shared Hosting:- Most of the host provides Shared Hosting , as it is meaningless to use whole server for small website which does not have very heavy traffic or not a big application.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;At that time on a on server more then one website is hosted and manged.shared hosting is widely used , it is very cost effective too.Shared hosting may not provide full access to server(it is depends upon service provider also).&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Dedicated Server:- Dedicated Server means only one particuler website or particular user owns a server.Where Owner(Person who purchase Dedicated server from host ,yes your own pc also can be a dedicated server).Owner have full access of server ,freedom of installing new s/w ,uninstall s/w.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;DNS:-Domain Name Server&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;As we all knows on back side web request is made through IPs.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;DNS :- Map the IP(where our website hosted) and Domain Name (like &lt;/span&gt;&lt;a href="http://www.google.com/"&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;www.google.com&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;).&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;As defination you can say &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;DNS is the service which translates between Internet names and Internet addresses.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt; If you are working on a Windows machine, you can view your current IP address with the command WINIPCFG.EXE (IPCONFIG.EXE for Windows 2000/XP). On a UNIX machine, type nslookup along with a machine name (such as "nslookup www.howstuffworks.com") to display the IP address of the machine (use the command hostname to learn the name of your machine).&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;DNS is such a big thing so it  can not be explained in a single post I will add more information about it.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6408364537482106644-5615639352572566276?l=ketan-technical-fruits.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://ketan-technical-fruits.blogspot.com/2008/06/web-hosting-and-domain.html</link><author>noreply@blogger.com (ketan raval)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6408364537482106644.post-6208535328257350357</guid><pubDate>Tue, 24 Jun 2008 06:20:00 +0000</pubDate><atom:updated>2008-06-23T23:35:23.067-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Error log asp.net2.0</category><category domain="http://www.blogger.com/atom/ns#">custom error log</category><category domain="http://www.blogger.com/atom/ns#">create error log</category><title>Create Error log in Asp.net2.0</title><description>&lt;span style="font-family:verdana;"&gt;Here I am simplfying error log implementaiton.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;To maintain error log its good to have log for each day for a better review .&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;so here we will create log file everyday , and when file already exist will append error entry in to it.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;"&gt;For that create one class and write following method....&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;C#&lt;br /&gt;public static void WriteError(string errorMessage)&lt;br /&gt;{&lt;br /&gt;try&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;//Specify path where log file to be created&lt;br /&gt;string logfilePath = "~/Error/" + DateTime.Today.ToString("dd-mm-yy") + ".txt";&lt;br /&gt;if (!File.Exists(System.Web.HttpContext.Current.Server.MapPath(logfilePath)))&lt;br /&gt;{&lt;br /&gt;File.Create(System.Web.HttpContext.Current.Server.MapPath(logfilePath)).Close();&lt;br /&gt;}&lt;br /&gt;using (StreamWriter wrtr = File.AppendText(System.Web.HttpContext.Current.Server.MapPath(logfilePath)))&lt;br /&gt;{&lt;br /&gt;wrtr.WriteLine("\r\nLog Entry : ");&lt;br /&gt;wrtr.WriteLine("{0}", DateTime.Now.ToString(CultureInfo.InvariantCulture));&lt;br /&gt;string err = "Error in: " + System.Web.HttpContext.Current.Request.Url.ToString() +&lt;br /&gt;". Error Message:" + errorMessage;&lt;br /&gt;wrtr.WriteLine(err);&lt;br /&gt;wrtr.WriteLine("__________________________");&lt;br /&gt;wrtr.Flush();&lt;br /&gt;wrtr.Close();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;catch (Exception ex)&lt;br /&gt;{&lt;br /&gt;WriteError(ex.Message);&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6408364537482106644-6208535328257350357?l=ketan-technical-fruits.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://ketan-technical-fruits.blogspot.com/2008/06/create-error-log-in-aspnet20.html</link><author>noreply@blogger.com (ketan raval)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6408364537482106644.post-6383182251903105000</guid><pubDate>Thu, 19 Jun 2008 05:34:00 +0000</pubDate><atom:updated>2008-12-08T21:27:40.677-08:00</atom:updated><title>Caching Concept</title><description>&lt;span style="font-family:verdana;"&gt;Here is the different kind of caching that you can use in your web applications:&lt;br /&gt;· Output Caching&lt;br /&gt;· Fragment Caching&lt;br /&gt;· Data Caching&lt;br /&gt;· Cache Configuration&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;strong&gt;Output Caching &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Performance is improved in an ASP.NET application by caching the rendered markup and serving the cached version of the markup until the cache expires. For example, if you have a page that displays user information from a database, caching will help improve performance by serving the page from memory instead of making a connection to the database on each page request.&lt;br /&gt;You can cache a page by using the OutputCache API or simply by using the @outputcache &lt;/span&gt;&lt;span style="font-family:verdana;"&gt;directive. &lt;%@ Page Language=”C#” %&gt;&lt;%@ OutputCache Duration=”15” VaryByParam=”none” %&gt;&lt;br /&gt;The above cache directive will cache the page for 15 minutes.&lt;br /&gt;So output caching is great for when you want to cache an entire page. &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-family:verdana;"&gt;&lt;strong&gt;Fragment Caching&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;In many situations caching the entire page just isn’t going to cut it, for some reason or another you require specific sections of the page to display live information. One way to improve performance is to analyze your page and identify objects that require a substantial overhead to run. You can build a list of these objects that are expensive to run, and then cache them for a period of time using fragment caching.&lt;br /&gt;For example, say your page default.aspx consists of three user controls. After looking over the code, you identified that you can cache one of them. You can simply add the caching directive to the top of the user control: &lt;%@ Control %&gt;&lt;%@ OutputCache Duration=”5” VaryByParam=”none” %&gt;&lt;br /&gt;Now keep in mind that the actual page that contains the control is not cached, only the user control. This means that the default.aspx page will be rendered each and every page request, but the user control is only ‘run’ every 15 minutes. &lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;strong&gt;Data Caching &lt;/strong&gt;&lt;br /&gt;So we know that we can cache an entire page, or a fragment of a page by caching down to the user control level. Wouldn’t it be great if we could cache down to the object level? The good news is you can with ASP.NET Data caching.&lt;br /&gt;The cache consists of a dictionary collection that is private to each application in memory. To insert items in the cache simply provide the collection with a unique name: Cache[“someKey”] = myObject;&lt;br /&gt;Retrieving the object form the cache: myObject = (MyObject)Cache[“someKey”];&lt;br /&gt;It is a good time to point out that you should always remember to check for null, and be sure to caste to your datatype.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Cache Configuration&lt;br /&gt;&lt;/strong&gt;If you are familiar with how caching worked in ASP.NET 1.0, you realize that managing all the cache directions for all your pages could potentially get out of hand. ASP.NET 2.0 introduces Cache Profiles that helps you centrally manage your cache. Cache settings can be inherited by your pages, and overridden if required by using the OutputCache directive.&lt;br /&gt;The page directive looks pretty much the same, expect this time it references a cache profile that you defined in your web.config file.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;img id="BLOGGER_PHOTO_ID_5213462370367869554" style="WIDTH: 334px; CURSOR: hand; HEIGHT: 167px" height="112" alt="" src="http://3.bp.blogspot.com/_M5bUKwTDrTE/SFnwZ1ukknI/AAAAAAAAAAc/3AoxcoAdRBU/s320/cache.GIF" width="388" border="0" /&gt;&lt;span style="font-family:verdana;"&gt;So each and every page that references the ‘myCacheProfile1’ can be centrally managed in the web.config, this means that any changes to the cache settings in the web.config file will be automatically changed on all your referenced pages. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6408364537482106644-6383182251903105000?l=ketan-technical-fruits.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://ketan-technical-fruits.blogspot.com/2008/06/caching-concept.html</link><author>noreply@blogger.com (ketan raval)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_M5bUKwTDrTE/SFnwZ1ukknI/AAAAAAAAAAc/3AoxcoAdRBU/s72-c/cache.GIF" height="72" width="72" /><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6408364537482106644.post-1074702939834041122</guid><pubDate>Wed, 18 Jun 2008 08:25:00 +0000</pubDate><atom:updated>2008-12-08T21:27:40.845-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ketan</category><title>Disable auto id’s when copying ASP.NET controls</title><description>&lt;span style="font-family:verdana;"&gt;Don’t you hate it when you copy an ASP.NET server control without an ID, only to have it add one when you paste it? &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;For example, look at this code:&lt;br /&gt;I took the first line, copied it and pasted it, and got the second line. It’s rare that I need to reference a validator in my CodeBehind.&lt;br /&gt;Here is the option to disable this functionality in the Visual Studio options&lt;br /&gt;(Tools-&gt;Options):&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://1.bp.blogspot.com/_M5bUKwTDrTE/SFjHF3iDXbI/AAAAAAAAAAM/rFvDouQQ6WY/s1600-h/disable-auto-ids-visual-studio.gif"&gt;&lt;span style="font-family:verdana;"&gt;&lt;img id="BLOGGER_PHOTO_ID_5213135472301399474" style="WIDTH: 428px; CURSOR: hand; HEIGHT: 267px" height="258" alt="" src="http://1.bp.blogspot.com/_M5bUKwTDrTE/SFjHF3iDXbI/AAAAAAAAAAM/rFvDouQQ6WY/s320/disable-auto-ids-visual-studio.gif" width="361" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;Simply uncheck the “Auto ID elements on paste in Source view” option. &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6408364537482106644-1074702939834041122?l=ketan-technical-fruits.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://ketan-technical-fruits.blogspot.com/2008/06/disable-auto-ids-when-copying-aspnet.html</link><author>noreply@blogger.com (ketan raval)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_M5bUKwTDrTE/SFjHF3iDXbI/AAAAAAAAAAM/rFvDouQQ6WY/s72-c/disable-auto-ids-visual-studio.gif" height="72" width="72" /><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6408364537482106644.post-8826285551131573472</guid><pubDate>Tue, 17 Jun 2008 10:05:00 +0000</pubDate><atom:updated>2008-06-17T03:07:47.605-07:00</atom:updated><title>Date/Time Conversions Using SQL Server</title><description>&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Verdana;font-size:78%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Verdana;font-size:78%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div align="center"&gt;&lt;table class="MsoNormalTable" style="width: 419px; height: 550px;" border="1" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;1 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;select convert(varchar, getdate(), 1) &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;01/07/08&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;2 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;select convert(varchar, getdate(), 2) &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;08.01.07 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;3 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;select convert(varchar, getdate(), 3) &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;07/01/08 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;4 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;select convert(varchar, getdate(), 4) &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;07.01.08 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;5 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;select convert(varchar, getdate(), 5) &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;07-01-08 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;6 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;select convert(varchar, getdate(), 6) &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;07 Jan 08 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;7 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;select convert(varchar, getdate(), 7) &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;Jan 07, 08 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;10 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;select convert(varchar, getdate(), 10) &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;01-07-08 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;11 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;select convert(varchar, getdate(), 11) &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;08/01/07 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;101 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;select convert(varchar, getdate(), 101) &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;01/07/2008 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;102 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;select convert(varchar, getdate(), 102) &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;2008.01.07 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;103 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;select convert(varchar, getdate(), 103) &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;07/01/2008 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;104 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;select convert(varchar, getdate(), 104) &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;07.01.2008 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;105 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;select convert(varchar, getdate(), 105) &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;07-01-2008 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;106 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;select convert(varchar, getdate(), 106) &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;07 Jan 2008 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;107 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;select convert(varchar, getdate(), 107) &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;Jan 07, 2008 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;110 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;select convert(varchar, getdate(), 110) &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;01-07-2008 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;111 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;select convert(varchar, getdate(), 111) &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;2008/01/07 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt; background: gray none repeat scroll 0% 50%; -moz-background-inline-policy: -moz-initial; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial;" colspan="3" bg="" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:78%;"&gt;&lt;b&gt;&lt;span style=";font-family:Arial;color:white;"  &gt;&lt;span style="font-weight: bold;font-family:Arial;color:white;"  &gt;TIME FORMATS&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;color:white;"   &gt;&lt;span style=";font-family:Arial;color:white;"  &gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;8 or 108 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;select convert(varchar, getdate(), 8) &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;18:12:39&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;9 or 109 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;select convert(varchar, getdate(), 9) &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;Jan 7 2008 6:13:02:140PM&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;14 or 114 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;select convert(varchar, getdate(), 14) &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;18:13:21:093&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Verdana;font-size:78%;color:black;"   &gt;&lt;span style="color:black;"&gt;You can also format the date or time without dividing characters, as well as concatenate the&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Verdana;font-size:78%;color:black;"   &gt;&lt;span style="color:black;"&gt;date and time string: &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Times New Roman;font-size:78%;"  &gt;&lt;span style="font-family:'Times New Roman';"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div align="center"&gt;&lt;table class="MsoNormalTable" style="width: 420px; height: 78px;" border="1" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:78%;"&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-weight: bold;font-family:Arial;" &gt;Sample statement&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:78%;"&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-weight: bold;font-family:Arial;" &gt;Output&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;select replace(convert(varchar, getdate(),101),'/','') &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;01072008 &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;select replace(convert(varchar, getdate(),101),'/','') + replace(convert(varchar, getdate(),108),':','') &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding: 2.25pt;" valign="top"&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:78%;"  &gt;&lt;span style="font-family:Arial;"&gt;01072008181409&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6408364537482106644-8826285551131573472?l=ketan-technical-fruits.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://ketan-technical-fruits.blogspot.com/2008/06/datetime-conversions-using-sql-server.html</link><author>noreply@blogger.com (ketan raval)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6408364537482106644.post-8995698180438211498</guid><pubDate>Tue, 17 Jun 2008 10:04:00 +0000</pubDate><atom:updated>2008-06-17T03:04:50.977-07:00</atom:updated><title>some sql commands</title><description>&lt;span style="font-size:85%;"&gt;&lt;span class="v11" id="lblDescription" style="color: darkblue; font-family: verdana;"&gt;&lt;b&gt;1. Executing a  script file from SQLCMD...&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;i. Create a script file by typing in the  following line and save it as Message.sql&lt;br /&gt;print 'Welcome today''s date is: '  + (convert(varchar, getdate()))&lt;br /&gt;&lt;br /&gt;ii. Now goto command prompt and type:  SQLCMD -i Message.sql&lt;br /&gt;here, -i is the switch to specify the input file  name.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;2. Executing series of script files (sample)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Lets  create couple of .sql files and then see how to execute them in order from  command prompt. Please note that i am just showing an example here :) there are  better methods of doing the same which I would explain later in the  series!&lt;br /&gt;&lt;br /&gt;i) Copy paste the below script and name it as  01TableCreation.sql&lt;br /&gt;&lt;br /&gt;Create table tblTest&lt;br /&gt;(&lt;br /&gt;Sno int  identity,&lt;br /&gt;FName varchar(20)&lt;br /&gt;)&lt;br /&gt;Go&lt;br /&gt;&lt;br /&gt;ii) Copy paste the below script  and name it as 02InsertRecords.sql&lt;br /&gt;Insert into tblTest (Fname) values  ('a')&lt;br /&gt;&lt;br /&gt;iii) Copy paste the below two lines and name it as  test.bat&lt;br /&gt;&lt;br /&gt;sqlcmd -U sa -P hotmail -S VADIVEL -d testbed -i "C:\Vadivel\SQL  Related\Scripts\sqlcmd\01TableCreation.sql"&lt;br /&gt;sqlcmd -U sa -P hotmail -S  VADIVEL -d testbed -i "C:\Vadivel\SQL  Related\Scripts\sqlcmd\02InsertRecords.sql"&lt;br /&gt;&lt;br /&gt;here,&lt;br /&gt;-U is SQL User  name&lt;br /&gt;-P is SQL Password&lt;br /&gt;-S is the SQL Server name&lt;br /&gt;-d is the SQL  database name&lt;br /&gt;-i is the input file to execute&lt;br /&gt;&lt;br /&gt;iv) Execute the batch  file&lt;br /&gt;&lt;br /&gt;Now goto command prompt (Start &gt;&gt; Run &gt;&gt; cmd) and  execute this batch file. The batch file would have created a table and inserted  a record into it. If you want to deploy some DB scripts on a remote box for  which you don't have access from Mgmt Studio you can follow this batch file  route. So that the ppl who are having access to that SQL box can just run this  batch file (after changing the values of the different switches, if need  be)&lt;br /&gt;&lt;br /&gt;Setting your default editor:&lt;br /&gt;&lt;br /&gt;From my previous posts one can  understand that it is possible to write SQL queries directly in command prompt  with the help of SQLCMD utility.&lt;br /&gt;&lt;br /&gt;Now let's assume we have typed a 'big'  query and there is a typo there! Instead of going back and forth to edit it in  command prompt won't it be easy if we are able to open the query in an editor  and make the corrections there?&lt;br /&gt;&lt;br /&gt;Yes its possible in SQLCMD. All we need  to do is type ed and it will open up the last command/query in a text editor.  FYI the default editor is Edit (the command line editor of MS DOS).&lt;br /&gt;&lt;br /&gt;Step  1: Open up SQLCMD and connect to your SQLServer&lt;br /&gt;Step 2: type any query of  your choice&lt;br /&gt;Step 3: type ed&lt;br /&gt;Step 4: The query would have opened in the  'EDIT' utility of DOS. Once you are done with the change, save and exit from  that.&lt;br /&gt;Step 5: type go and press enter&lt;br /&gt;&lt;br /&gt;Can I make 'ed' to open up  notepad or any editor of my choice?&lt;br /&gt;Yes it's possible.&lt;br /&gt;&lt;br /&gt;Step 1: Open  DOS prompt&lt;br /&gt;Step 2: Type set sqlcmdeditor=notepad&lt;br /&gt;Step 3: Open up SQLCMD  and connect to your SQLServer&lt;br /&gt;Step 4: type any query of your choice&lt;br /&gt;Step  5: type ed&lt;br /&gt;Step 6: The query would get opened in notepad. Once you are done  with the change, save and exit from that.&lt;br /&gt;Step 5: type go and press  enter&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6408364537482106644-8995698180438211498?l=ketan-technical-fruits.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://ketan-technical-fruits.blogspot.com/2008/06/some-sql-commands.html</link><author>noreply@blogger.com (ketan raval)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6408364537482106644.post-7185914324425205831</guid><pubDate>Tue, 17 Jun 2008 09:57:00 +0000</pubDate><atom:updated>2008-06-17T02:58:19.816-07:00</atom:updated><title>Persist the Property Values in User Controls after postbacks.</title><description>&lt;pre&gt;private String strName&lt;br /&gt;&lt;br /&gt;public String Name&lt;br /&gt;{&lt;br /&gt;get{return strName;}&lt;br /&gt;set{strName&lt;span class="v11" id="lblDescription" style="color: darkblue;"&gt;&lt;/span&gt;= value;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class="v11" id="lblDescription" style="color: darkblue;"&gt;This&lt;br /&gt;is wrong approach,It will lose your property values.  whenever&lt;br /&gt;you want to get the value of Name Property it will never get in&lt;br /&gt;postbacks and you will always get the Null Exception.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Right Way&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="v11" id="lblDescription" style="color: darkblue;"&gt;&lt;span&gt;&lt;span style="font-size: 100%; color: blue; font-family: Courier;"&gt;&lt;pre&gt;public String Name&lt;br /&gt;{&lt;br /&gt;get&lt;br /&gt;{&lt;br /&gt; Object obj = ViewState["Name"];&lt;br /&gt; if(obj == null)&lt;br /&gt; {&lt;br /&gt;  return null;&lt;br /&gt; }&lt;br /&gt; else&lt;br /&gt; {&lt;br /&gt;  return (String)obj;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;set&lt;br /&gt;{&lt;br /&gt; ViewState["Name"] = value;&lt;br /&gt;}&lt;br /&gt;}&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;You will retain property value of user control during postback too.&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6408364537482106644-7185914324425205831?l=ketan-technical-fruits.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://ketan-technical-fruits.blogspot.com/2008/06/persist-property-values-in-user.html</link><author>noreply@blogger.com (ketan raval)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6408364537482106644.post-866230504130212244</guid><pubDate>Tue, 17 Jun 2008 09:51:00 +0000</pubDate><atom:updated>2008-06-17T02:57:18.425-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET Application performance Tips and Tricks</category><title>.NET Application performance Tips and Tricks</title><description>&lt;p style="font-family: verdana;"&gt;&lt;span style="font-weight: bold;"&gt;1.Set debug=false under compilation as follows:-&lt;/span&gt; &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;&lt;compilation debug="false" defaultlanguage="c#"&gt;&lt;/compilation&gt;&lt;/p&gt; &lt;p style="font-family: verdana;"&gt;When you create the application, by default this attribute is set to "true"  which is very useful while developing. However,when you are deploying your  application, always set it to "false" &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;Setting it to "true" requires the pdb information to be inserted into the  file and this results in a comparatively larger file and hence processing will  be slow. &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;&lt;span style="font-weight: bold;"&gt;2. Turn off Tracing unless until required.&lt;/span&gt; &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;Tracing is one of the wonderful features which enable us to track the  application's trace and the sequences. However, again it is useful only for  developers and you can set this to "false" unless you require to monitor the  trace logging.&lt;br /&gt;&lt;br /&gt;Before you deploy your application, disable tracing and  debugging. Tracing and debugging may cause performance issues. Tracing and  debugging are not recommended while your application is running in production.  You can disable tracing and debugging in the Machine.config and Web.config.&lt;br /&gt;&lt;configuration&gt;&lt;system.web&gt;&lt;trace pageoutput="false" enabled="false"&gt;&lt;/trace&gt;&lt;/SYSTEM.WEB&gt;&lt;/configuration&gt;&lt;/p&gt; &lt;p style="font-family: verdana;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3. Turn off Session State, if not required.&lt;/span&gt; &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;ASP.NET Manages session state automatically. However, in case you dont  require Sessions, disabling it will help in improving the performance. &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;You may not require seesion state when ur pages r static or whn u dont need  to store infor captured in the page. &lt;/p&gt;&lt;p style="font-family: verdana;"&gt;For doing it in Page wise &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;&lt;%@ Page EnableSessionState="false" %&gt;&lt;/p&gt;  &lt;p style="font-family: verdana;"&gt;Changes ha to be Done when building .NET  Application&lt;br /&gt;---------------------------------------- &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;4. Select the Release mode before making the final Build for your  application.&lt;/p&gt;&lt;p style="font-family: verdana;"&gt; This option is available in the Top Frame just under the Window  Menu option. By default, the Mode is Debug &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;There are several things happening when you Build/Re-Build applications in  the Debug Mode. First of all, it creates an additional PDB File under your BIN  directory. This holds all the Debug information. &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;Secondly, the Timeout is very high since you require higher time out  frequency while debugging such that your process hangs on until you get to the  exact break point where error is there. &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;So, selecting Release Mode will greatly improve the performance of the  application when u deploy. &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;&lt;br /&gt;General Methods to improve the Performance of Web  Application&lt;br /&gt;-------------------------------------------------------------  &lt;/p&gt; &lt;p style="font-family: verdana; font-weight: bold;"&gt;5. Disable ViewState when not required. &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;&lt;span style="font-weight: bold;"&gt;6. Avoid Frequent round trips to the Database.&lt;/span&gt;&lt;br /&gt;Calls made to Database can  be quite expensive in terms of response time as well as resources and it can be  avoided by using Batch Processing. &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;Make calls to Database as mininal as possible and make them last even lesser  time. Use of DataAdapter wherever applicable is very useful since, it  automatically opens and closes Connection whenever required and doesnt require  user to explicitly open the connection. &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;A number of connections opened and not closed adequately can directly  influence in performance slow down. &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;7. Avoid Throwing Exceptions. It is very expensive. &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;8. Use Caching to improve the performance of your application. &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;&lt;span style="font-weight: bold;"&gt;9. Use appropriate Authentication Mechanism.&lt;/span&gt; &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;The Authentication Mechanism you choose determines the cost associated with  it and hence select the appropriate mechanism. An informal but useful order is  as follows:- &lt;/p&gt;  &lt;p style="font-family: verdana;"&gt;Authentication Modes&lt;br /&gt;1. None&lt;br /&gt;2. Windows&lt;br /&gt;3. Forms&lt;br /&gt;4. Passport &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;&lt;span style="font-weight: bold;"&gt;10. Validate all Input received from the Users.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="font-family: verdana;"&gt;Use Client Side  Validations as much as possible. However, do a check at the Server side too to  avoid the infamous&lt;br /&gt;Javascript disabled scenarios. &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;&lt;span style="font-weight: bold;"&gt;11. Use Finally Method to kill resources.&lt;/span&gt;&lt;br /&gt;In your Try..Catch.. Block,  always use the Finally method to close Open connections, Open DataReaders, Files  and other resources such that they get executed independent of whether the code  worked in Try or went to Catch. &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;&lt;span style="font-weight: bold;"&gt;12. The String and Stringbuilder Usage.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="font-family: verdana;"&gt;If you are initially creating a  string say s = "Hello". Then you are appending to it as s = s + " World"; You  are actually creating two instances of string in memory. Both the original as  well as the new string will be stored in the memory. For that matter, all the  activities you do to the string are stored in the memory as separate references  and it must be avoided as much as possible. &lt;/p&gt;  &lt;p style="font-family: verdana;"&gt;Use StringBuilder which is very useful in these kind of scenarios. For the  example above, using a StringBuilder as&lt;br /&gt;s.Append(" World"); which only  stores the value in the original string and no additional reference is created.&lt;br /&gt;Eg: &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;String Action&lt;br /&gt;--------------&lt;br /&gt;string str="";&lt;br /&gt;DateTime startTime =  DateTime.Now;&lt;br /&gt;Response.Write(("&lt;br /&gt;Start time:" +  startTime.ToString()));&lt;br /&gt;int i;&lt;br /&gt;&lt;br /&gt;for(i=0;i&lt;20000;i++)&lt;br /&gt;{&lt;br /&gt;str +=  i.ToString()+ "&lt;br /&gt;";&lt;br /&gt;} &lt;/p&gt;  &lt;p style="font-family: verdana;"&gt;DateTime EndTime= DateTime.Now;&lt;br /&gt;Response.Write(("&lt;br /&gt;End time:" +  EndTime.ToString()));&lt;br /&gt;&lt;br /&gt;Out Put: &lt;/p&gt;&lt;p style="font-family: verdana;"&gt;Start time:9/22/2007 10:23:44 AM&lt;br /&gt;End time:9/22/2007 10:25:08 AM &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;The above code took 1 minutes and 24 Seconds to complete its  operation&lt;br /&gt;&lt;/p&gt; &lt;p style="font-family: verdana;"&gt;String Builder Action&lt;br /&gt;---------------------&lt;br /&gt;StringBuilder strbuilder =  new StringBuilder();&lt;br /&gt;DateTime startTime1 =  DateTime.Now;&lt;br /&gt;Response.Write(("&lt;br /&gt;Start time:" +  startTime1.ToString()));&lt;br /&gt;int i1;&lt;br /&gt;&lt;br /&gt;for (i1 = 0; i1 &lt; 20000;  i1++)&lt;br /&gt;{&lt;br /&gt;strbuilder.Append(i1 + "&lt;br /&gt;");&lt;br /&gt;} &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;DateTime EndTime1 = DateTime.Now;&lt;br /&gt;Response.Write(("&lt;br /&gt;End time:" +  EndTime1.ToString())); &lt;/p&gt;  &lt;p style="font-family: verdana;"&gt;Out Put:&lt;br /&gt;Start time:9/22/2007 10:25:08 AM&lt;br /&gt;End time:9/22/2007 10:25:09 AM&lt;br /&gt;&lt;br /&gt;The  above code took 1 Seconds to complete its operation &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;13. Avoid Recursive Functions / Nested Loops &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;14. Enable Option Strict and Option Explicit for your pages. &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;15. Use early binding in Visual Basic or JScript code. &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;&lt;span style="font-weight: bold;"&gt;16. Use Response.Write for String concatenation:&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="font-family: verdana;"&gt;Use the  HttpResponse.Write method in your pages or user controls for string  concatenation.&lt;br /&gt;This method offers buffering and concatenation services that  are very efficient. If you are performing&lt;br /&gt;extensive concatenation, however,  the technique in the following example, using multiple calls&lt;br /&gt;to  Response.Write, is faster than concatenating a string with a single call to the  Response.Write method. &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;Response.Write("a");&lt;br /&gt;Response.Write(myString);&lt;br /&gt;Response.Write("b");&lt;br /&gt;Response.Write(myObj.ToString());&lt;br /&gt;Response.Write("c");&lt;br /&gt;Response.Write(myString2);&lt;br /&gt;Response.Write("d");  &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;&lt;span style="font-weight: bold;"&gt;17. Avoid unnecessary round trips to the server:&lt;/span&gt;&lt;br /&gt;Use Page.IsPostback  to avoid extra work on a round trip. &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;• Implement Ajax UI whenever possible. The idea is to avoid full page refresh  and only update the portion of the page that needs to be changed. I think  Scott's article gave great information on how to implement Ajax Atlas and  &lt;atlas:updatepanel&gt;control. &lt;/ATLAS:UPDATEPANEL&gt;&lt;/p&gt;  &lt;p style="font-family: verdana;"&gt;• Use Client Side Scripts. Client site validation can help reduce round trips  that are required to process user’s request. In ASP.NET you can also use client  side controls to validate user input.&lt;br /&gt;• Use Page.ISPostBack property to ensure that you only perform page  initialization logic when a page first time loaded and not in response to client  postbacks. &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;If Not IsPostBack Then&lt;br /&gt;LoadJScripts()&lt;br /&gt;End If&lt;br /&gt;• In some  situations performing postback event handling are unnecessary. You can use  client callbacks to read data from the server instead of performing a full round  trip. &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;18. Keep IO Buffer Size Between 4KB and 8KB&lt;/span&gt;&lt;br /&gt;For nearly every  application, a buffer between 4KB and 8KB will give you the maximum performance.  For very specific instances, you may be able to get an improvement from a larger  buffer (loading large images of a predictable size, for example), but in 99.99%  of cases it will only waste memory. All buffers derived from BufferedStream  allow you to set the size to anything you want, but in most cases 4 and 8 will  give you the best performance &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;&lt;span style="font-weight: bold;"&gt;19. Minimize the Use of Format()&lt;/span&gt;&lt;br /&gt;When you can, use toString() instead of  format(). In most cases, it will provide you with the functionality you need,  with much less overhead. &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;20. Optimize Assignments&lt;/p&gt;&lt;p style="font-family: verdana;"&gt;Use exp += val instead of exp = exp + val. Since  exp can be arbitrarily complex, this can result in lots of unnecessary work.  This forces the JIT to evaluate both copies of exp, and many times this is not  needed. The first statement can be optimized far better than the second, since  the JIT can avoid evaluating the exp twice. &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;21. Include Return Statements with in the Function &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;22. Use For Loops for String Iteration &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;&lt;span style="font-weight: bold;"&gt;23. Explicitly Dispose or Close all the resources:&lt;/span&gt; &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;Try&lt;br /&gt;_con.Open()&lt;br /&gt;Catch ex As Exception&lt;br /&gt;Throw ex&lt;br /&gt;Finally&lt;br /&gt;If Not  _con Is Nothing Then&lt;br /&gt;_con.Close()&lt;br /&gt;End If&lt;br /&gt;End Try &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;&lt;span style="font-weight: bold;"&gt;24. Precompiling pages and disabling AutoEventWireup:&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="font-family: verdana;"&gt;By precompiled  pages, users do not have to experience the batch compile of your ASP.NET files;  it will increase the performance that your users will experience. &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;Also setting the AutoEventWireup attribute to false in the Machine.config  file means that the page will not match method names to events and hook them up  (for example, Page_Load). If page developers want to use these events, they will  need to override the methods in the base class (for example, they will need to  override Page.OnLoad for the page load event instead of using a Page_Load  method). If you disable AutoEventWireup, your pages will get a slight  performance boost by leaving the event wiring to the page author instead of  performing it automatically. &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;Database&lt;br /&gt;--------&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1.Use the Optimal Managed Provider &lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: verdana; font-weight: bold;"&gt;2.Use Stored Procedures Whenever Possible &lt;/p&gt; &lt;p style="font-family: verdana; font-weight: bold;"&gt;3.Use SqlDataReader Instead of Dataset wherevr it is possible &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;&lt;span style="font-weight: bold;"&gt;3.Turn Off Features You Don't Use&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="font-family: verdana;"&gt;Turn off automatic transaction  enlistment if it's not needed. For the SQL Managed Provider, it's done via the  connection string: &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;SqlConnection conn = new SqlConnection("Server=mysrv01;Integrated  Security=true;Enlist=false");&lt;br /&gt;&lt;br /&gt;When filling a dataset with the data  adapter, don't get primary key information if you don't have to (e.g. don't set  MissingSchemaAction.Add with key): &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;public DataSet SelectSqlSrvRows(DataSet dataset,string connection,string  query){&lt;br /&gt;SqlConnection conn = new SqlConnection(connection);&lt;br /&gt;SqlDataAdapter  adapter = new SqlDataAdapter();&lt;br /&gt;adapter.SelectCommand = new SqlCommand(query,  conn);&lt;br /&gt;adapter.MissingSchemaAction =  MissingSchemaAction.AddWithKey;&lt;br /&gt;adapter.Fill(dataset);&lt;br /&gt;return  dataset;&lt;br /&gt;} &lt;/p&gt; &lt;p style="font-family: verdana;"&gt;&lt;span style="font-weight: bold;"&gt;4.Keep Your Datasets Lean&lt;/span&gt;&lt;br /&gt;Only put the records you need into the dataset.  Remember that the dataset stores all of its data in memory, and that the more  data you request, the longer it will take to transmit across the wire. &lt;/p&gt; &lt;p style="font-family: verdana; font-weight: bold;"&gt;5.Use Connection Pooling and Object Pooling&lt;/p&gt;&lt;br /&gt;&lt;span style="font-family: verdana; font-weight: bold;"&gt;source: code project &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6408364537482106644-866230504130212244?l=ketan-technical-fruits.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://ketan-technical-fruits.blogspot.com/2008/06/net-application-performance-tips-and.html</link><author>noreply@blogger.com (ketan raval)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6408364537482106644.post-2422679840473946573</guid><pubDate>Tue, 17 Jun 2008 09:49:00 +0000</pubDate><atom:updated>2008-06-17T02:50:17.999-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Asp.net tips and tricks</category><title>Simple ASP.NET 2.0 Tips and Tricks that You May (or may not) have Heard About</title><description>&lt;div style="font-family: verdana;" class="post-body entry-content"&gt; &lt;p&gt;&lt;span style="font-size: 100%;"&gt;&lt;span style="font-size: 100%;"&gt;&lt;span&gt;ASP.NET 2.0 is an awesome framework for developing Web applications. If you've worked with it for awhile then that's no secret. It offers some great new features that you can implement with a minimal amount of code. I wanted to start a list of some of the most simple (yet cool) things you could do with it that required little or no C#/VB.NET code. If you have other suggestions add a comment and I'll update the list if the suggestion is a simple task that can be applied easily.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 100%;"&gt;&lt;strong&gt;&lt;b&gt;&lt;span style="font-size: 100%;"&gt;&lt;span&gt;1.&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/strong&gt;  &lt;strong&gt;&lt;b&gt;Maintain the position of  the scrollbar on postbacks&lt;/b&gt;&lt;/strong&gt;: In ASP.NET 1.1 it was a pain to maintain the position of the scrollbar when doing a postback operation. This was especially true when you had a grid on the page and went to edit a specific row. Instead of staying on the desired row, the page would reload and you'd be placed back at the top and have to scroll down. In ASP.NET 2.0 you can simply add the MaintainScrollPostionOnPostBack attribute to the Page directive:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 100%;"&gt;&lt;span style="font-size: 100%;"&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;%@&lt;/span&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;  Page Language&lt;/span&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;="C#"&lt;/span&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;  MaintainScrollPositionOnPostback&lt;/span&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;="true"  &lt;/span&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;AutoEventWireup&lt;/span&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;="true"&lt;/span&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;  CodeFile&lt;/span&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;="..."&lt;/span&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;  Inherits&lt;/span&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;="..."&lt;/span&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;  %&lt;/span&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;  &lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 100%;"&gt;&lt;strong&gt;&lt;b&gt;&lt;span style="font-size: 100%;"&gt;&lt;span&gt;2. Set the default  focus to a control when the page loads&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/strong&gt;: This is another extremely simple thing that can be done without resorting to writing JavaScript. If you only have a single textbox (or two) on a page why should the user have to click in the textbox to start typing? Shouldn't the cursor already be blinking in the textbox so they can type away? Using the DefaultFocus property of the HtmlForm control you can easily do this.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 100%;"&gt;&lt;span style="font-size: 100%;"&gt;&lt;&lt;/span&gt;form id="frm" DefaultFocus="txtUserName" runat="server"&gt;&lt;br /&gt;...&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;!--&lt;/span--&gt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;&lt;span style="color: maroon;"&gt;form&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&gt;&lt;/span&gt;&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 100%;"&gt;&lt;strong&gt;&lt;b&gt;&lt;span style="font-size: 100%;"&gt;&lt;span&gt;3. Set the default  button that is triggered when the user hits the enter  key:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/strong&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt; This was a major pain point in ASP.NET 1.1 and required some JavaScript to be written to ensure that when the user hit the enter key that the appropriate button on the form triggered a "click" event on the server-side. Fortunately, you can now use the HtmlForm control's DefaultButton property to set which button should be clicked when the user hits enter. This property is also available on the Panel control in cases where different buttons should be triggered as a user moves into different Panels on a page.&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 100%;"&gt;&lt;span style="font-size: 100%; color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;&lt;span style="color: maroon;"&gt;form&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt; id&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;="frm"&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt; DefaultButton&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;="btnSubmit"&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt; runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;="server"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;...&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;!--&lt;/span--&gt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;&lt;span style="color: maroon;"&gt;form&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&gt;&lt;/span&gt;&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 100%;"&gt;&lt;strong&gt;&lt;b&gt;&lt;span style="font-size: 100%;"&gt;&lt;span&gt;4.&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/strong&gt;  &lt;strong&gt;&lt;b&gt;Locate nested controls  easily&lt;/b&gt;&lt;/strong&gt;: Finding controls within a Page's control hierarchy can be painful but if you know how the controls are nested you can use the lesser known "$" shortcut to find controls without having to write recursive code. If you're looking for a great way to recursively find a control (in cases where you don't know the exact control nesting) check out my good buddy &lt;a href="http://weblogs.asp.net/palermo4/archive/2007/04/13/recursive-findcontrol-t.aspx" target="_blank"&gt;Michael Palermo's blog&lt;/a&gt; entry. The following example shows how to use the DefaultFocus property to set the focus on a textbox that is nested inside of a FormView control. Notice that the "$" is used to delimit the nesting:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 100%;"&gt;&lt;span style="font-size: 100%; color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;&lt;span style="color: maroon;"&gt;form&lt;/span&gt;&lt;/span&gt; &lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt;id&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;="form1"&lt;/span&gt;&lt;/span&gt; &lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;="server"&lt;/span&gt;&lt;/span&gt; &lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt;DefaultFocus&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;="formVw$txtName"&gt;&lt;br /&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;&lt;span style="color: maroon;"&gt;div&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&gt;&lt;br /&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;&lt;span style="color: maroon;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;&lt;span style="color: maroon;"&gt;FormView&lt;/span&gt;&lt;/span&gt; &lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;="formVw"&lt;/span&gt;&lt;/span&gt; &lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;="server"&gt;&lt;br /&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;&lt;span style="color: maroon;"&gt;ItemTemplate&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Name:&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;&lt;span style="color: maroon;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;&lt;span style="color: maroon;"&gt;TextBox&lt;/span&gt;&lt;/span&gt; &lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;="txtName"&lt;/span&gt;&lt;/span&gt; &lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;="server"&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt;Text&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;='&lt;/span&gt;&lt;/span&gt;&lt;%# Eval("FirstName") + " " +  Eval("LastName") %&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;/&gt;&lt;br /&gt;&lt;!--&lt;/span--&gt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;&lt;span style="color: maroon;"&gt;ItemTemplate&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&gt;&lt;br /&gt;&lt;!--&lt;/span--&gt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;&lt;span style="color: maroon;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;&lt;span style="color: maroon;"&gt;FormView&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&gt;&lt;br /&gt;&lt;!--&lt;/span--&gt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;&lt;span style="color: maroon;"&gt;div&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&gt;&lt;br /&gt;&lt;!--&lt;/span--&gt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;&lt;span style="color: maroon;"&gt;form&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 100%;"&gt;&lt;span style="font-size: 100%;"&gt;&lt;span&gt;This little  trick can also be used on the server-side when calling FindControl(). &lt;a href="http://weblogs.asp.net/dwahlin/archive/2006/08/25/Finding-ASP.NET-Child-Controls_2E002E002E002E00_The-Simple-Way.aspx" target="_blank"&gt;I blogged about this&lt;/a&gt; awhile back if you'd like more details.  Here's an example:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 100%;"&gt;&lt;span style="font-size: 100%; color: black;"&gt;&lt;span style="color: black;"&gt;TextBox tb &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;= this&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="color: black;"&gt;.FindControl(&lt;/span&gt;&lt;/span&gt;&lt;span style="color: gray;"&gt;&lt;span style="color: gray;"&gt;"form1$formVw$txtName"&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="color: black;"&gt;) &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;as &lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="color: black;"&gt;TextBox&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;;&lt;br /&gt;if &lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="color: black;"&gt;(tb !&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;= null&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="color: black;"&gt;)&lt;br /&gt;{&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: darkgreen;"&gt;&lt;span style="color: darkgreen;"&gt;//Access TextBox  control&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 100%;"&gt;&lt;strong&gt;&lt;b&gt;&lt;span style="font-size: 100%;"&gt;&lt;span&gt;5.&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/strong&gt;  &lt;strong&gt;&lt;b&gt;Strongly-typed access to  cross-page postback controls:&lt;/b&gt;&lt;/strong&gt; This one is a little more involved than the others, but quite useful. ASP.NET 2.0 introduced the concept of cross-page postbacks where one page could postback information to a page other than itself. This is done by setting the PostBackUrl property of a button to the name of the page that the button should postback data to. Normally, the posted data can be accessed by doing something like PreviousPage.FindControl("ControlID"). However, this requires a cast if you need to access properties of the target control in the previous page (which you normally need to do). If you add a public property into the code-behind page that initiates the postback operation, you can access the property in a strongly-typed manner by adding the PreviousPageType directive into the target page of the postback. That may sound a little confusing if you haven't done it so let me explain a little more.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 100%;"&gt;&lt;span style="font-size: 100%;"&gt;&lt;span&gt;If you have a page called Default.aspx that exposes a public property that returns a Textbox that is defined in the page, the page that data is posted to (lets call it SearchResults.aspx) can access that property in a strongly-typed manner (no FindControl() call is necessary) by adding the PreviousPageType directive into the top of the page:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 100%;"&gt;&lt;span style="font-size: 100%; color: blue;"&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; color: maroon; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;%@&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; color: red; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;  PreviousPageType VirtualPath&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;="Default.aspx"&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; color: red; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;  %&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;  &lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 100%;"&gt;&lt;span style="font-size: 100%;"&gt;&lt;span&gt;By adding this directive, the code in SearchResults.aspx can access the TextBox defined in Default.aspx in a strongly-typed manner. The following example assumes the property defined in Default.aspx is named SearchTextBox.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 100%;"&gt;&lt;span style="font-size: 100%; color: black;"&gt;&lt;span style="color: black;"&gt;TextBox tb &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;= &lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="color: black;"&gt;PreviousPage.SearchTextBox&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 100%;"&gt;&lt;span style="font-size: 100%;"&gt;&lt;span&gt;This code obviously only works if the previous page is Default.aspx. PreviousPageType also has a TypeName property as well where you could define a base type that one or more pages derive from to make this technique work with multiple pages. You can &lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.page.previouspage.aspx" target="_blank"&gt;learn more about PreviousPageType  here&lt;/a&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 100%;"&gt;&lt;strong&gt;&lt;b&gt;&lt;span style="font-size: 100%;"&gt;&lt;span&gt;6. Strongly-typed  access to Master Pages controls:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/strong&gt; The PreviousPageType directive isn't the only one that provides strongly-typed access to controls. If you have public properties defined in a Master Page that you'd like to access in a strongly-typed manner you can add the MasterType directive into a page as shown next (note that the MasterType directive also allows a TypeName to be defined as with the PreviousPageType directive):&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 100%;"&gt;&lt;span style="font-size: 100%; color: blue;"&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; color: maroon; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;%@&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; color: red; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;  MasterType VirtualPath&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;="MasterPage.master"&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; color: red; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;  %&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;  &lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 100%;"&gt;&lt;span style="font-size: 100%;"&gt;&lt;span&gt;You can  then access properties in the target master page from a content page by writing  code like the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 100%;"&gt;&lt;span style="font-size: 100%; color: blue;"&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="color: black;"&gt;.Master.HeaderText &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;= &lt;/span&gt;&lt;/span&gt;&lt;span style="color: gray;"&gt;&lt;span style="color: gray;"&gt;"Label updated using MasterType  directive with VirtualPath attribute."&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 100%;"&gt;&lt;span style="font-size: 100%;"&gt;&lt;span&gt;You can find several other tips and tricks related to working with master pages including sharing master pages across IIS virtual directories at a &lt;a href="http://weblogs.asp.net/dwahlin/archive/2006/08/22/Master-Pages-Tips-and-Tricks.aspx" target="_blank"&gt;previous blog post I wrote&lt;/a&gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 100%;"&gt;&lt;strong&gt;&lt;b&gt;&lt;span style="font-size: 100%;"&gt;&lt;span&gt;7. Validation  groups&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/strong&gt;: You may have a page that has multiple controls and multiple buttons. When one of the buttons is clicked you want specific validator controls to be evaluated rather than all of the validators defined on the page. With ASP.NET 1.1 there wasn't a great way to handle this without resorting to some hack code. ASP.NET 2.0 adds a ValidationGroup property to all validator controls and buttons (Button, LinkButton, etc.) that easily solves the problem. If you have a TextBox at the top of a page that has a RequiredFieldValidator next to it and a Button control, you can fire that one validator when the button is clicked by setting the ValidationGroup property on the button and on the RequiredFieldValidator to the same value. Any other validators not in the defined ValidationGroup will be ignored when the button is clicked. Here's an example:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 100%;"&gt;&lt;span style="font-size: 100%; color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;&lt;span style="color: maroon;"&gt;form&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt; id&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;="form1"&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt; runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;="server"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;Search Text:  &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;&lt;span style="color: maroon;"&gt;asp:TextBox&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt; ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;="txtSearch"&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt; runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;="server"&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;/&gt;&lt;br /&gt;&lt;br /&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;&lt;span style="color: maroon;"&gt;asp:RequiredFieldValidator&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt; ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;="valSearch"&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt; runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;="Server"&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt;&lt;br /&gt;ControlToValidate&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;="txtSearch"&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt; &lt;strong&gt;&lt;b&gt;ValidationGroup&lt;/b&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;b&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;="SearchGroup"&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/strong&gt;&lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;/&gt;&lt;br /&gt;&lt;br /&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;&lt;span style="color: maroon;"&gt;asp:Button&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt; ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;="btnSearch"&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt; runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;="server"&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt; Text&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;="Search"&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt;&lt;br /&gt;&lt;strong&gt;&lt;b&gt;ValidationGroup&lt;/b&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;b&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;="SearchGroup"&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/strong&gt;&lt;span style="color: red;"&gt;&lt;span style="color: red;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;/&gt;&lt;br /&gt;....&lt;br /&gt;Other controls  with validators and buttons defined here&lt;br /&gt;&lt;!--&lt;/span--&gt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;&lt;span style="color: maroon;"&gt;form&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&gt;&lt;/span&gt;&lt;/span&gt;  &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 100%;"&gt;&lt;strong&gt;&lt;b&gt;&lt;span style="font-size: 100%;"&gt;&lt;span&gt;8. Finding  control/variable names while typing code:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/strong&gt; This tip is a bit more related to VS.NET than to ASP.NET directly, but it's definitely helpful for those of you who remember the first few characters of control variable name (or any variable for that matter) but can't remember the complete name. It also gives me the chance to mention two great downloads from Microsoft. First the tip though. After typing the first few characters of a control/variable name, hit CTRL + SPACEBAR and VS.NET will bring up a short list of matching items. Definitely a lot easier than searching for the control/variable definition. Thanks to Darryl for the tip. For those who are interested, Microsoft made all of the VS.NET keyboard shortcuts available in a nice downloadable and printable guide. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 100%;"&gt;&lt;span style="font-size: 100%;"&gt;&lt;span&gt;That's all for now. There are a lot of other things that could be mentioned and I'll try to keep this post updated. Have a great (simple) ASP.NET 2.0 tip or trick? Post the details in the comments and I'll add it if the content is appropriate for the list. Make sure to list your name so I can give proper credit.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6408364537482106644-2422679840473946573?l=ketan-technical-fruits.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://ketan-technical-fruits.blogspot.com/2008/06/simple-aspnet-20-tips-and-tricks-that.html</link><author>noreply@blogger.com (ketan raval)</author><thr:total>1</thr:total></item></channel></rss>

