<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6407056434887736567</id><updated>2025-11-14T19:42:54.232-08:00</updated><category term="asp.net"/><category term="c#"/><category term="javascript"/><category term="ajax"/><category term="html"/><category term="iis"/><category term=".net"/><category term="activex"/><category term="button"/><category term="cookies"/><category term="iis7"/><category term="management studio"/><category term="paging"/><category term="refresh"/><category term="sessionState"/><category term="sql"/><category term="sql server"/><category term="t-sql"/><category term="textbox"/><category term="visual studio"/><category term="web services"/><category term="web.config"/><category term="window open"/><category term="Server tag was not well formed"/><category term="ajaxload.info"/><category term="attributes"/><category term="autocomplete"/><category term="autocompleteextender"/><category term="code"/><category term="code behind"/><category term="column"/><category term="computer name"/><category term="controls"/><category term="cpu id"/><category term="cross-browser compatibility"/><category term="crystal reports"/><category term="ctrl-R"/><category term="custom"/><category term="databind"/><category term="datetime"/><category term="disable"/><category term="enablesession"/><category term="enter"/><category term="error"/><category term="events"/><category term="f5"/><category term="format"/><category term="function"/><category term="gif"/><category term="gridview"/><category term="ie6"/><category term="ie7"/><category term="ie8"/><category term="ietester"/><category term="inline"/><category term="insert into select"/><category term="internet explorer"/><category term="ip address"/><category term="iusr"/><category term="line numbers"/><category term="loading"/><category term="mac address"/><category term="metabase"/><category term="modal popup"/><category term="modalpopupextender"/><category term="move"/><category term="moveto"/><category term="msdn"/><category term="msg 2714"/><category term="my-debugbar"/><category term="nt authority"/><category term="onblur"/><category term="onfocus"/><category term="onload"/><category term="password"/><category term="publish"/><category term="redirect"/><category term="reload"/><category term="reportdocument"/><category term="reports"/><category term="reportviewer"/><category term="resize"/><category term="resizeto"/><category term="right-click"/><category term="scalar"/><category term="scriptmanager"/><category term="select into"/><category term="services.msc"/><category term="sorting"/><category term="stateserver"/><category term="string"/><category term="table"/><category term="updatepanel"/><category term="vista"/><category term="w3schools"/><category term="web"/><category term="web method"/><category term="windows"/><category term="windows 7"/><category term="xp"/><title type='text'>&amp;lt; Coding Resource &amp;gt;</title><subtitle type='html'>A coding (scripting) refresher for those who easily forget. Mostly C#, ASP.NET, AJAX &amp;amp; SQL Server snippets.. but who knows..</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>29</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6407056434887736567.post-4888099916092276652</id><published>2010-09-05T20:56:00.000-07:00</published><updated>2010-09-05T20:56:01.806-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".net"/><category scheme="http://www.blogger.com/atom/ns#" term="custom"/><category scheme="http://www.blogger.com/atom/ns#" term="datetime"/><category scheme="http://www.blogger.com/atom/ns#" term="format"/><category scheme="http://www.blogger.com/atom/ns#" term="string"/><title type='text'>.NET Custom DateTime Format Strings</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;To have a more flexible DateTime format the DateTime object&#39;s ToString function can be used to pass custom strings like in the following snippet:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;DateTime&lt;/span&gt;.Now.ToString(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&quot;MM/dd/yyyy hh:mm:ss tt&quot;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;The part in between the open and close parentheses can be customized depending on the requirements.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Following is the different characters available for the custom format. This can also be seen on the MSDN website:&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/8kb3ddd4(VS.71).aspx&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;http://msdn.microsoft.com/en-us/library/8kb3ddd4(VS.71).aspx&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;The following table describes the custom format specifiers and the results they produce. The output of these format specifiers is influenced by the current culture and the settings in the Regional Options control panel.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table class=&quot;dtTABLE&quot; style=&quot;border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-collapse: collapse; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px; width: 736px;&quot;&gt;&lt;tbody&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;th style=&quot;background-color: #e5e5e5; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; color: black; font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 1.077em; font-style: normal; font-weight: normal; height: 21px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left;&quot; width=&quot;25%&quot;&gt;Format specifier&lt;/th&gt;&lt;th style=&quot;background-color: #e5e5e5; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; color: black; font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 1.077em; font-style: normal; font-weight: normal; height: 21px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left;&quot; width=&quot;75%&quot;&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;d&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays the current day of the month, measured as a number between 1 and 31, inclusive. If the day is a single digit only (1-9), then it is displayed as a single digit.Note that if the &#39;d&#39; format specifier is used alone, without other custom format strings, it is interpreted as the standard short date pattern format specifier. If the &#39;d&#39; format specifier is passed with other custom format specifiers or the &#39;%&#39; character, it is interpreted as a custom format specifier.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;dd&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays the current day of the month, measured as a number between 1 and 31, inclusive. If the day is a single digit only (1-9), it is formatted with a preceding 0 (01-09).&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;ddd&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays the abbreviated name of the day for the specified&amp;nbsp;&lt;b&gt;DateTime&lt;/b&gt;. If a specific valid format provider (a non-null object that implements&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.iformatprovider(v=VS.71).aspx&quot; style=&quot;color: #1364c4; text-decoration: none;&quot;&gt;IFormatProvider&lt;/a&gt;&amp;nbsp;with the expected property) is not supplied, then the&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.globalization.datetimeformatinfo.abbreviateddaynames(v=VS.71).aspx&quot; style=&quot;color: #1364c4; text-decoration: none;&quot;&gt;AbbreviatedDayNames&lt;/a&gt;&amp;nbsp;property of the&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.datetimeformat(v=VS.71).aspx&quot; style=&quot;color: #1364c4; text-decoration: none;&quot;&gt;DateTimeFormat&lt;/a&gt;and its current culture associated with the current thread is used. Otherwise, the&lt;b&gt;AbbreviatedDayNames&lt;/b&gt;&amp;nbsp;property from the specified format provider is used.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;dddd (plus any number of additional &quot;d&quot; characters)&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays the full name of the day for the specified&amp;nbsp;&lt;b&gt;DateTime&lt;/b&gt;. If a specific valid format provider (a non-null object that implements&amp;nbsp;&lt;b&gt;IFormatProvider&lt;/b&gt;&amp;nbsp;with the expected property) is not supplied, then the&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.globalization.datetimeformatinfo.daynames(v=VS.71).aspx&quot; style=&quot;color: #1364c4; text-decoration: none;&quot;&gt;DayNames&lt;/a&gt;&amp;nbsp;property of the&amp;nbsp;&lt;b&gt;DateTimeFormat&lt;/b&gt;&amp;nbsp;and its current culture associated with the current thread is used. Otherwise, the&amp;nbsp;&lt;b&gt;DayNames&lt;/b&gt;&amp;nbsp;property from the specified format provider is used.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;f&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays seconds fractions represented in one digit.Note that if the &#39;f&#39; format specifier is used alone, without other custom format strings, it is interpreted as the full (long date + short time) format specifier. If the &#39;f&#39; format specifier is passed with other custom format specifiers or the &#39;%&#39; character, it is interpreted as a custom format specifier.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;ff&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays seconds fractions represented in two digits.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;fff&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays seconds fractions represented in three digits.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;ffff&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays seconds fractions represented in four digits.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;fffff&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays seconds fractions represented in five digits.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;ffffff&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays seconds fractions represented in six digits.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;fffffff&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays seconds fractions represented in seven digits.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;g or gg (plus any number of additional &quot;g&quot; characters)&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays the era (A.D. for example) for the specified&amp;nbsp;&lt;b&gt;DateTime&lt;/b&gt;. If a specific valid format provider (a non-null object that implements&amp;nbsp;&lt;b&gt;IFormatProvider&lt;/b&gt;&amp;nbsp;with the expected property) is not supplied, then the era is determined from the calendar associated with the&lt;b&gt;DateTimeFormat&lt;/b&gt;&amp;nbsp;and its current culture associated with the current thread.Note that if the &#39;g&#39; format specifier is used alone, without other custom format strings, it is interpreted as the standard general format specifier. If the &#39;g&#39; format specifier is passed with other custom format specifiers or the &#39;%&#39; character, it is interpreted as a custom format specifier.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;h&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays the hour for the specified&amp;nbsp;&lt;b&gt;DateTime&lt;/b&gt;&amp;nbsp;in the range 1-12. The hour represents whole hours passed since either midnight (displayed as 12) or noon (also displayed as 12). If this format is used alone, then the same hour before or after noon is indistinguishable. If the hour is a single digit (1-9), it is displayed as a single digit. No rounding occurs when displaying the hour. For example, a&amp;nbsp;&lt;b&gt;DateTime&lt;/b&gt;&amp;nbsp;of 5:43 returns 5.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;hh, hh (plus any number of additional &quot;h&quot; characters)&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays the hour for the specified&amp;nbsp;&lt;b&gt;DateTime&lt;/b&gt;&amp;nbsp;in the range 1-12. The hour represents whole hours passed since either midnight (displayed as 12) or noon (also displayed as 12). If this format is used alone, then the same hour before or after noon is indistinguishable. If the hour is a single digit (1-9), it is formatted with a preceding 0 (01-09).&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;H&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays the hour for the specified&amp;nbsp;&lt;b&gt;DateTime&lt;/b&gt;&amp;nbsp;in the range 0-23. The hour represents whole hours passed since midnight (displayed as 0). If the hour is a single digit (0-9), it is displayed as a single digit.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;HH, HH (plus any number of additional &quot;H&quot; characters)&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays the hour for the specified&amp;nbsp;&lt;b&gt;DateTime&lt;/b&gt;&amp;nbsp;in the range 0-23. The hour represents whole hours passed since midnight (displayed as 0). If the hour is a single digit (0-9), it is formatted with a preceding 0 (01-09).&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;m&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays the minute for the specified&amp;nbsp;&lt;b&gt;DateTime&lt;/b&gt;&amp;nbsp;in the range 0-59. The minute represents whole minutes passed since the last hour. If the minute is a single digit (0-9), it is displayed as a single digit.Note that if the &#39;m&#39; format specifier is used alone, without other custom format strings, it is interpreted as the standard month day pattern format specifier. If the &#39;m&#39; format specifier is passed with other custom format specifiers or the &#39;%&#39; character, it is interpreted as a custom format specifier.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;mm, mm (plus any number of additional &quot;m&quot; characters)&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays the minute for the specified&amp;nbsp;&lt;b&gt;DateTime&lt;/b&gt;&amp;nbsp;in the range 0-59. The minute represents whole minutes passed since the last hour. If the minute is a single digit (0-9), it is formatted with a preceding 0 (01-09).&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;M&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays the month, measured as a number between 1 and 12, inclusive. If the month is a single digit (1-9), it is displayed as a single digit.Note that if the &#39;M&#39; format specifier is used alone, without other custom format strings, it is interpreted as the standard month day pattern format specifier. If the &#39;M&#39; format specifier is passed with other custom format specifiers or the &#39;%&#39; character, it is interpreted as a custom format specifier.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;MM&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays the month, measured as a number between 1 and 12, inclusive. If the month is a single digit (1-9), it is formatted with a preceding 0 (01-09).&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;MMM&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays the abbreviated name of the month for the specified&amp;nbsp;&lt;b&gt;DateTime&lt;/b&gt;. If a specific valid format provider (a non-null object that implements&amp;nbsp;&lt;b&gt;IFormatProvider&lt;/b&gt;&amp;nbsp;with the expected property) is not supplied, the&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.globalization.datetimeformatinfo.abbreviatedmonthnames(v=VS.71).aspx&quot; style=&quot;color: #1364c4; text-decoration: none;&quot;&gt;AbbreviatedMonthNames&lt;/a&gt;&amp;nbsp;property of the&amp;nbsp;&lt;b&gt;DateTimeFormat&lt;/b&gt;and its current culture associated with the current thread is used. Otherwise, the&lt;b&gt;AbbreviatedMonthNames&lt;/b&gt;&amp;nbsp;property from the specified format provider is used.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;MMMM&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays the full name of the month for the specified&amp;nbsp;&lt;b&gt;DateTime&lt;/b&gt;. If a specific valid format provider (a non-null object that implements&amp;nbsp;&lt;b&gt;IFormatProvider&lt;/b&gt;&amp;nbsp;with the expected property) is not supplied, then the&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.globalization.datetimeformatinfo.monthnames(v=VS.71).aspx&quot; style=&quot;color: #1364c4; text-decoration: none;&quot;&gt;MonthNames&lt;/a&gt;&amp;nbsp;property of the&amp;nbsp;&lt;b&gt;DateTimeFormat&lt;/b&gt;&amp;nbsp;and its current culture associated with the current thread is used. Otherwise, the&amp;nbsp;&lt;b&gt;MonthNames&lt;/b&gt;&amp;nbsp;property from the specified format provider is used.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;s&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays the seconds for the specified&amp;nbsp;&lt;b&gt;DateTime&lt;/b&gt;&amp;nbsp;in the range 0-59. The second represents whole seconds passed since the last minute. If the second is a single digit (0-9), it is displayed as a single digit only.Note that if the &#39;s&#39; format specifier is used alone, without other custom format strings, it is interpreted as the standard sortable date/time pattern format specifier. If the &#39;s&#39; format specifier is passed with other custom format specifiers or the &#39;%&#39; character, it is interpreted as a custom format specifier.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;ss, ss (plus any number of additional &quot;s&quot; characters)&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays the seconds for the specified&amp;nbsp;&lt;b&gt;DateTime&lt;/b&gt;&amp;nbsp;in the range 0-59. The second represents whole seconds passed since the last minute. If the second is a single digit (0-9), it is formatted with a preceding 0 (01-09).&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;t&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays the first character of the A.M./P.M. designator for the specified&amp;nbsp;&lt;b&gt;DateTime&lt;/b&gt;. If a specific valid format provider (a non-null object that implements&amp;nbsp;&lt;b&gt;IFormatProvider&lt;/b&gt;&amp;nbsp;with the expected property) is not supplied, then the&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.globalization.datetimeformatinfo.amdesignator(v=VS.71).aspx&quot; style=&quot;color: #1364c4; text-decoration: none;&quot;&gt;AMDesignator&lt;/a&gt;&amp;nbsp;(or&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.globalization.datetimeformatinfo.pmdesignator(v=VS.71).aspx&quot; style=&quot;color: #1364c4; text-decoration: none;&quot;&gt;PMDesignator&lt;/a&gt;) property of the&amp;nbsp;&lt;b&gt;DateTimeFormat&lt;/b&gt;&amp;nbsp;and its current culture associated with the current thread is used. Otherwise, the&amp;nbsp;&lt;b&gt;AMDesignator&lt;/b&gt;&amp;nbsp;(or&amp;nbsp;&lt;b&gt;PMDesignator&lt;/b&gt;) property from the specified&lt;b&gt;IFormatProvider&lt;/b&gt;&amp;nbsp;is used. If the total number of whole hours passed for the specified&lt;b&gt;DateTime&lt;/b&gt;&amp;nbsp;is less than 12, then the&amp;nbsp;&lt;b&gt;AMDesignator&lt;/b&gt;&amp;nbsp;is used. Otherwise, the&amp;nbsp;&lt;b&gt;PMDesignator&lt;/b&gt;&amp;nbsp;is used.Note that if the &#39;t&#39; format specifier is used alone, without other custom format strings, it is interpreted as the standard long time pattern format specifier. If the &#39;t&#39; format specifier is passed with other custom format specifiers or the &#39;%&#39; character, it is interpreted as a custom format specifier.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;tt, tt (plus any number of additional &quot;t&quot; characters)&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays the A.M./P.M. designator for the specified&amp;nbsp;&lt;b&gt;DateTime&lt;/b&gt;. If a specific valid format provider (a non-null object that implements&amp;nbsp;&lt;b&gt;IFormatProvider&lt;/b&gt;&amp;nbsp;with the expected property) is not supplied, then the&amp;nbsp;&lt;b&gt;AMDesignator&lt;/b&gt;&amp;nbsp;(or&amp;nbsp;&lt;b&gt;PMDesignator&lt;/b&gt;) property of the&amp;nbsp;&lt;b&gt;DateTimeFormat&lt;/b&gt;and its current culture associated with the current thread is used. Otherwise, the&lt;b&gt;AMDesignator&lt;/b&gt;&amp;nbsp;(or&amp;nbsp;&lt;b&gt;PMDesignator&lt;/b&gt;) property from the specified&amp;nbsp;&lt;b&gt;IFormatProvider&lt;/b&gt;&amp;nbsp;is used. If the total number of whole hours passed for the specified&amp;nbsp;&lt;b&gt;DateTime&lt;/b&gt;&amp;nbsp;is less than 12, then the&lt;b&gt;AMDesignator&lt;/b&gt;&amp;nbsp;is used. Otherwise, the&amp;nbsp;&lt;b&gt;PMDesignator&lt;/b&gt;&amp;nbsp;is used.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;y&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays the year for the specified&amp;nbsp;&lt;b&gt;DateTime&lt;/b&gt;&amp;nbsp;as a maximum two-digit number. The first two digits of the year are omitted. If the year is a single digit (1-9), it is displayed as a single digit.Note that if the &#39;y&#39; format specifier is used alone, without other custom format strings, it is interpreted as the standard short date pattern format specifier. If the &#39;y&#39; format specifier is passed with other custom format specifiers or the &#39;%&#39; character, it is interpreted as a custom format specifier.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;yy&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays the year for the specified&amp;nbsp;&lt;b&gt;DateTime&lt;/b&gt;&amp;nbsp;as a maximum two-digit number. The first two digits of the year are omitted. If the year is a single digit (1-9), it is formatted with a preceding 0 (01-09).&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;yyyy&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays the year for the specified&amp;nbsp;&lt;b&gt;DateTime&lt;/b&gt;, including the century. If the year is less than four digits in length, then preceding zeros are appended as necessary to make the displayed year four digits long.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;z&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays the time zone offset for the system&#39;s current time zone in whole hours only. The offset is always displayed with a leading sign (zero is displayed as &quot;+0&quot;), indicating hours ahead of Greenwich mean time (+) or hours behind Greenwich mean time (-). The range of values is –12 to +13. If the offset is a single digit (0-9), it is displayed as a single digit with the appropriate leading sign. The setting for the time zone is specified as +X or –X where X is the offset in hours from GMT. The displayed offset is affected by daylight savings time.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;zz&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays the time zone offset for the system&#39;s current time zone in whole hours only. The offset is always displayed with a leading or trailing sign (zero is displayed as &quot;+00&quot;), indicating hours ahead of Greenwich mean time (+) or hours behind Greenwich mean time (-). The range of values is –12 to +13. If the offset is a single digit (0-9), it is formatted with a preceding 0 (01-09) with the appropriate leading sign. The setting for the time zone is specified as +X or –X where X is the offset in hours from GMT. The displayed offset is affected by daylight savings time.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;zzz, zzz (plus any number of additional &quot;z&quot; characters)&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Displays the time zone offset for the system&#39;s current time zone in hours and minutes. The offset is always displayed with a leading or trailing sign (zero is displayed as &quot;+00:00&quot;), indicating hours ahead of Greenwich mean time (+) or hours behind Greenwich mean time (-). The range of values is –12:00 to +13:00. If the offset is a single digit (0-9), it is formatted with a preceding 0 (01-09) with the appropriate leading sign. The setting for the time zone is specified as +X or –X where X is the offset in hours from GMT. The displayed offset is affected by daylight savings time.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;:&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Time separator.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;/&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Date separator.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;&quot;&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Quoted string. Displays the literal value of any string between two quotation marks preceded by the escape character (/).&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;&#39;&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Quoted string. Displays the literal value of any string between two &quot; &#39; &quot; characters.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;%&lt;i&gt;c&lt;/i&gt;&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Where&amp;nbsp;&lt;i&gt;c&lt;/i&gt;&amp;nbsp;is both a standard format specifier and a custom format specifier, displays the custom format pattern associated with the format specifier.Note that if a format specifier is used alone as a single character, it is interpreted as a standard format specifier. Only format specifiers consisting of two or more characters are interpreted as custom format specifiers. In order to display the custom format for a specifier defined as both a standard and a custom format specifier, precede the specifier with a % symbol.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;\&lt;i&gt;c&lt;/i&gt;&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Where&amp;nbsp;&lt;i&gt;c&lt;/i&gt;&amp;nbsp;is any character, the escape character displays the next character as a literal. The escape character cannot be used to create an escape sequence (like &quot;\n&quot; for new line) in this context.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;vertical-align: top;&quot; valign=&quot;top&quot;&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;25%&quot;&gt;Any other character&lt;/td&gt;&lt;td style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; line-height: 18px; margin-bottom: 1px; margin-left: 1px; margin-right: 1px; margin-top: 1px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;&quot; width=&quot;75%&quot;&gt;Other characters are written directly to the result string as literals.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/4888099916092276652/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingresource.blogspot.com/2010/09/net-custom-datetime-format-strings.html#comment-form' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/4888099916092276652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/4888099916092276652'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/2010/09/net-custom-datetime-format-strings.html' title='.NET Custom DateTime Format Strings'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6407056434887736567.post-3485582889634650140</id><published>2010-08-31T20:42:00.000-07:00</published><updated>2010-09-01T16:26:54.395-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".net"/><category scheme="http://www.blogger.com/atom/ns#" term="crystal reports"/><category scheme="http://www.blogger.com/atom/ns#" term="paging"/><category scheme="http://www.blogger.com/atom/ns#" term="reportdocument"/><category scheme="http://www.blogger.com/atom/ns#" term="reports"/><category scheme="http://www.blogger.com/atom/ns#" term="reportviewer"/><category scheme="http://www.blogger.com/atom/ns#" term="visual studio"/><title type='text'>Crystal Reports for Web Paging Problem</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;Noticed how the paging of&amp;nbsp;Crystal Reports for Visual Studio works, that when the report is more than 2 pages, the navigator gets stuck at page 2?&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEita_QCwdIwE-akY7ClgM8atVJUcYBRrkEbWPDN73C5Lh5f8XQwT-n24sLFVLRKaiqhuqI-Y_yhmAMRzsEcIQED5b7lfSJOOYWTWNXTTWPwnzNf-6p4ESBqZEe7xOtN-xpF_u-EW4HEOiFG/s1600/crystalreportspagingerror.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEita_QCwdIwE-akY7ClgM8atVJUcYBRrkEbWPDN73C5Lh5f8XQwT-n24sLFVLRKaiqhuqI-Y_yhmAMRzsEcIQED5b7lfSJOOYWTWNXTTWPwnzNf-6p4ESBqZEe7xOtN-xpF_u-EW4HEOiFG/s320/crystalreportspagingerror.PNG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;Here&#39;s a simple solution.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;If the ReportDocument loading codes are placed in the Page_Load event of the page...&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;protected void&lt;/span&gt; Page_Load(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;object &lt;/span&gt;sender, &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;EventArgs &lt;/span&gt;e)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;ReportViewer.ReportSource = reportDocument;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;...create a new&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;Page_Init&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;event and &lt;b&gt;move &lt;/b&gt;the codes there.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;protected void&lt;/span&gt;&amp;nbsp;Page_Init(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;object&amp;nbsp;&lt;/span&gt;sender,&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;EventArgs&amp;nbsp;&lt;/span&gt;e)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;ReportViewer.ReportSource = reportDocument;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;Now the paging will work as intended.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqiruQyv7h61ZpsvloJZJZyCavbU5k7zx8N4ag8hZ_nf3yQ0X9-gP50KoGcoCuzUtejBamzfGi2Y3FiuksH7KZWPomY3pHjTL-GCO0SZV-SFlZ5IriKGATwb8Bfs1Q1oFnepGCqLP0xppF/s1600/crystalreportspaging.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqiruQyv7h61ZpsvloJZJZyCavbU5k7zx8N4ag8hZ_nf3yQ0X9-gP50KoGcoCuzUtejBamzfGi2Y3FiuksH7KZWPomY3pHjTL-GCO0SZV-SFlZ5IriKGATwb8Bfs1Q1oFnepGCqLP0xppF/s320/crystalreportspaging.PNG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;-elyk&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/3485582889634650140/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingresource.blogspot.com/2010/08/crystal-reports-for-web-paging-problem.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/3485582889634650140'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/3485582889634650140'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/2010/08/crystal-reports-for-web-paging-problem.html' title='Crystal Reports for Web Paging Problem'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEita_QCwdIwE-akY7ClgM8atVJUcYBRrkEbWPDN73C5Lh5f8XQwT-n24sLFVLRKaiqhuqI-Y_yhmAMRzsEcIQED5b7lfSJOOYWTWNXTTWPwnzNf-6p4ESBqZEe7xOtN-xpF_u-EW4HEOiFG/s72-c/crystalreportspagingerror.PNG" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6407056434887736567.post-8890284005381636221</id><published>2010-05-13T20:02:00.000-07:00</published><updated>2010-05-13T20:07:43.717-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="iis"/><category scheme="http://www.blogger.com/atom/ns#" term="services.msc"/><category scheme="http://www.blogger.com/atom/ns#" term="sessionState"/><category scheme="http://www.blogger.com/atom/ns#" term="stateserver"/><category scheme="http://www.blogger.com/atom/ns#" term="web.config"/><title type='text'>IIS 6.0 and Session State Problems</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Have you tried publishing a website in a development server without problems only to see them once deployed on a production server? Here&#39;s one problem you might encounter. Why does the session expire quickly when you explicitly set the timeout property in the website&#39;s &lt;b&gt;web.config&lt;/b&gt;?&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;sessionState &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;mode&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;=&quot;InProc&quot;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;cookieless&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;=&quot;false&quot;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;timeout&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;=&quot;30&quot;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Here&#39;s a good post that explains why:&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; letter-spacing: 1px; line-height: 14px; text-transform: uppercase;&quot;&gt;&lt;a href=&quot;http://blogs.msdn.com/david.wang/archive/2005/09/19/Why_do_I_lose_ASP_Session_State_on_IIS6.aspx&quot;&gt;WHY DO I LOSE ASP SESSION STATE ON IIS6&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Now after digesting the post, I&#39;ll give a simple solution you may try to solve that problem.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;u&gt;Step 1:&lt;/u&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Change the sessionState in the web.config to an out of process like &lt;b&gt;StateServer&lt;/b&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;sessionState&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;mode&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;=&quot;StateServer&quot;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;stateConnectionString&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;=&quot;tcpip=localhost:42424&quot;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;cookieless&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;=&quot;false&quot;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;timeout&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;=&quot;30&quot;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;We&#39;ll use the StateServer mode which is ASP.NET&#39;s special session handling method.&amp;nbsp;Don&#39;t change the &lt;b&gt;stateConnectionString&lt;/b&gt;, that is simply the port that will be used by the ASP.NET State Service.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;u&gt;Step 2:&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Now let&#39;s configure the ASP.NET State Service.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;In the server hosting the website, go to Start &amp;gt; Run &amp;gt; Type &lt;b&gt;services.msc&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_7m9Opb7ZR2BhbSCaDOiy-IFP_cbGtNY5I2nufvYo9QXikK94DBaixg7FIT09K3CGmU9frOeusHkvsBC05vLffeCvOnIoSgjcHqvkSTnzD7Wj8OZaJYsMAAyfG72uiKx8pnx-yxZAcwaT/s1600/services.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_7m9Opb7ZR2BhbSCaDOiy-IFP_cbGtNY5I2nufvYo9QXikK94DBaixg7FIT09K3CGmU9frOeusHkvsBC05vLffeCvOnIoSgjcHqvkSTnzD7Wj8OZaJYsMAAyfG72uiKx8pnx-yxZAcwaT/s320/services.PNG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
Select ASP.NET State Service and right click it and select &lt;b&gt;Properties&lt;/b&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1eYDfIu0pNyBVQoKUpYVsyGuyzZYqUonbapjpLcum_nrlgtgpYPaVW3tABoaWRgNBJkv3s9tEqd48WHAgD3Ltae34R2soRnsWTl61irfyDcZnOyyt_M3kg9P22gXwpJXY9jEmR2ZvM_nF/s1600/services2.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;449&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1eYDfIu0pNyBVQoKUpYVsyGuyzZYqUonbapjpLcum_nrlgtgpYPaVW3tABoaWRgNBJkv3s9tEqd48WHAgD3Ltae34R2soRnsWTl61irfyDcZnOyyt_M3kg9P22gXwpJXY9jEmR2ZvM_nF/s640/services2.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Make sure to select &lt;b&gt;Automatic&lt;/b&gt; in &lt;b&gt;Startup type&lt;/b&gt;, so the service will start automatically everytime the server reboots. Then start the service.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioeJbbbdN2hKYlPYQx_2hgsw5KFPOGYGMP680rdUhNwZgGj_27wb1jAQ-Dqmv2TPrrKfAnXUMZzs0qCkgAb_QbAtITVhbYsPXdeRgsnSqt0JTUlDqzcA0KYjOw3pFf5fpMIdnB7YEohMYe/s1600/services3.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioeJbbbdN2hKYlPYQx_2hgsw5KFPOGYGMP680rdUhNwZgGj_27wb1jAQ-Dqmv2TPrrKfAnXUMZzs0qCkgAb_QbAtITVhbYsPXdeRgsnSqt0JTUlDqzcA0KYjOw3pFf5fpMIdnB7YEohMYe/s400/services3.PNG&quot; width=&quot;350&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;u&gt;Step 3:&lt;/u&gt;&lt;br /&gt;
&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;br /&gt;
Now try running the website and see if it already follows the timeout period you set in the web.config. If it does and you haven&#39;t encountered any problems then all is good, congrats!. But if you encountered this sneaky error:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 15px;&quot;&gt;&lt;em&gt;&lt;b&gt;Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500&lt;/b&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 15px;&quot;&gt;&lt;em&gt;&lt;br /&gt;
&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 15px;&quot;&gt;&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: &#39;Trebuchet MS&#39;, sans-serif; font-style: normal; line-height: normal;&quot;&gt;Then your problem might be &lt;b&gt;serialization&lt;/b&gt;. Because sessions that will be saved in the ASP.NET State Service must be serialized. Two things to make sure is to first serialize all your local classes like this:&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #45818e;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;Serializable&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
&lt;em&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;public class&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #45818e;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;SampleClass&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;Place a &lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;Serializable &lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;tag before the declaration of the class.&lt;br /&gt;
&lt;br /&gt;
Second is to make sure you&#39;re not using classes that cannot be serialized like Web Controls (Button, Textbox, Table, etc.). Just search &lt;/span&gt; &lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;msdn &lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;for other non-serializable classes.&lt;br /&gt;
&lt;br /&gt;
If you followed these steps your website should be running okay by now.&lt;br /&gt;
&lt;br /&gt;
Here&#39;s some topics you might be interested:&lt;br /&gt;
&lt;/span&gt;    &lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms178586.aspx&quot;&gt;Session-State Modes&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/7ay27kt9(VS.80).aspx&quot;&gt;Serialization&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/7ay27kt9(VS.80).aspx&quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;-elyk&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt; &lt;/span&gt;   &lt;br /&gt;
&lt;/em&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/8890284005381636221/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingresource.blogspot.com/2010/05/iis-60-and-session-state-problems.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/8890284005381636221'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/8890284005381636221'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/2010/05/iis-60-and-session-state-problems.html' title='IIS 6.0 and Session State Problems'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_7m9Opb7ZR2BhbSCaDOiy-IFP_cbGtNY5I2nufvYo9QXikK94DBaixg7FIT09K3CGmU9frOeusHkvsBC05vLffeCvOnIoSgjcHqvkSTnzD7Wj8OZaJYsMAAyfG72uiKx8pnx-yxZAcwaT/s72-c/services.PNG" height="72" width="72"/><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6407056434887736567.post-3865296444286302426</id><published>2010-04-17T08:50:00.000-07:00</published><updated>2010-04-17T20:43:10.932-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="enablesession"/><category scheme="http://www.blogger.com/atom/ns#" term="web method"/><category scheme="http://www.blogger.com/atom/ns#" term="web services"/><title type='text'>ASP.NET Enable Session in Web Service Methods</title><content type='html'>&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;Ever tried accessing session variables in Web Service methods? It won&#39;t work unless you add a little property in the &lt;strong&gt;WebMethod&lt;/strong&gt; header of the functions.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Trebuchet MS;&quot;&gt;For example, the basic hello world:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;[&lt;span style=&quot;color: #45818e;&quot;&gt;WebMethod&lt;/span&gt;(EnableSession=&lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;)]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public&amp;nbsp;void&lt;/span&gt; HelloWorld()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;Just add the statement &lt;strong&gt;EnableSession=true&lt;/strong&gt; and you&#39;ll be able to access session variables&amp;nbsp;found normally&amp;nbsp;in aspx pages like the following sample.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; userid = Session[&lt;span style=&quot;color: #990000;&quot;&gt;&quot;userid&quot;&lt;/span&gt;].ToString();&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/3865296444286302426/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingresource.blogspot.com/2010/04/aspnet-enable-session-in-web-service.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/3865296444286302426'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/3865296444286302426'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/2010/04/aspnet-enable-session-in-web-service.html' title='ASP.NET Enable Session in Web Service Methods'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6407056434887736567.post-290515466025287454</id><published>2010-04-15T19:39:00.000-07:00</published><updated>2010-04-15T19:39:14.017-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="code"/><category scheme="http://www.blogger.com/atom/ns#" term="code behind"/><category scheme="http://www.blogger.com/atom/ns#" term="password"/><category scheme="http://www.blogger.com/atom/ns#" term="textbox"/><title type='text'>ASP.NET C# Set Value to Password Textbox in Code Behind</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;If ever you&#39;ve tried setting value in code-behind to a textbox with &lt;b&gt;TextMode &lt;/b&gt;property set to &quot;&lt;b&gt;Password&quot;&lt;/b&gt;, you would notice it doesn&#39;t display the masked text on the page. This is simply the way it is for security purposes, but there is a workaround so you can show the user there is actually text in the textbox.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Here is the snippet:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;txt1.Text = &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&quot;sample_password&quot;&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;if (txt1.TextMode ==&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #073763;&quot;&gt;TextBoxMode&lt;/span&gt;.Password)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;txt1.Attributes.Add(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&quot;value&quot;&lt;/span&gt;, txt1.Text);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Just set the same text value to the javascript attribute &lt;b&gt;&quot;value&quot;&lt;/b&gt; and you&#39;re done.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/290515466025287454/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingresource.blogspot.com/2010/04/aspnet-c-set-value-to-password-textbox.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/290515466025287454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/290515466025287454'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/2010/04/aspnet-c-set-value-to-password-textbox.html' title='ASP.NET C# Set Value to Password Textbox in Code Behind'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6407056434887736567.post-5811619282867119978</id><published>2010-04-13T01:46:00.000-07:00</published><updated>2010-04-13T01:46:25.089-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="move"/><category scheme="http://www.blogger.com/atom/ns#" term="moveto"/><category scheme="http://www.blogger.com/atom/ns#" term="onload"/><category scheme="http://www.blogger.com/atom/ns#" term="resize"/><category scheme="http://www.blogger.com/atom/ns#" term="resizeto"/><title type='text'>Javascript OnLoad Page Resize and Move to Center</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Here&#39;s a snippet for loading a web page with set width and height and moving it at the center of the screen.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;window.onload = &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;function&lt;/span&gt;() {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;var &lt;/span&gt;width = 800;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;var &lt;/span&gt;height = 600;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;window.resizeTo(width, height);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;window.moveTo(((screen.width - width) / 2), ((screen.height - height) / 2));&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;For this sample we resize the window to 800 by 600 and then placed it at the center of the screen by taking the screen width and height (current monitor resolution) then subtracting it with the set width and height (800 and 600 respectively) and finally diving it by 2. Now, simply place this script on the head part of the page and that&#39;s it.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/5811619282867119978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingresource.blogspot.com/2010/04/javascript-onload-page-resize-and-move.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/5811619282867119978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/5811619282867119978'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/2010/04/javascript-onload-page-resize-and-move.html' title='Javascript OnLoad Page Resize and Move to Center'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6407056434887736567.post-3030009815340735062</id><published>2010-04-06T19:27:00.000-07:00</published><updated>2010-04-06T19:28:46.881-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ctrl-R"/><category scheme="http://www.blogger.com/atom/ns#" term="f5"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="refresh"/><category scheme="http://www.blogger.com/atom/ns#" term="window open"/><title type='text'>Disable Refresh in Webpage Using Javascript (F5 &amp; Ctrl + R)</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Okay here&#39;s another script for disabling refresh&amp;nbsp;(F5 &amp;amp; Ctrl + R)&amp;nbsp;in your web pages.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;document.onkeydown = &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;function&lt;/span&gt;() { &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;switch &lt;/span&gt;(event.keyCode) {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;case &lt;/span&gt;116 : &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;//F5 button&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;event.returnValue =&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;false&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;event.keyCode = 0;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;return false&lt;/span&gt;;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;case &lt;/span&gt;82 : &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;//R button&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (event.ctrlKey) {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;event.returnValue =&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;false&lt;/span&gt;;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;event.keyCode = 0;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;return false&lt;/span&gt;;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Same as before, you can add this to your main javascript file and place it in the head part of your page.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;It works by adding a function to your page&#39;s &lt;b&gt;onkeydown &lt;/b&gt;event. Then we simply get which button was pressed by using &lt;b&gt;event.Keycode&lt;/b&gt; (116 for F5 and 82 for R). Also, notice the &quot;if&quot; statement for R, it simply checks if the control button was pressed at the same time as R by checking &lt;b&gt;event.ctrlKey&lt;/b&gt;.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;But there&#39;s a limitation to handling page refreshes with this code. You simply cannot control the refresh button specific to your browsers&#39; toolbar.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUc1CdQ1XfU9erYBWn2efAIHRo2Z6n0YFIsbnIaXpw1O8t3LqWIOFI4tslR9k61I5DJRt3AfXKsKQ12dcXlgU-qoXB1SMLqOAP0_85Jgw1FiyI1xlqranUB5PxZM6tRcjWZRRGL5Vh1TKt/s1600/window_open_toolbar.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;45&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUc1CdQ1XfU9erYBWn2efAIHRo2Z6n0YFIsbnIaXpw1O8t3LqWIOFI4tslR9k61I5DJRt3AfXKsKQ12dcXlgU-qoXB1SMLqOAP0_85Jgw1FiyI1xlqranUB5PxZM6tRcjWZRRGL5Vh1TKt/s400/window_open_toolbar.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt; &lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt; &lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;So the only way to really prevent users to refresh the page is by using this code and at the same time opening your page at a new window without the toolbar.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Check&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;a href=&quot;http://codingresource.blogspot.com/2010/01/javascript-windowopen-in-net.html&quot;&gt;http://codingresource.blogspot.com/2010/01/javascript-windowopen-in-net.html&lt;/a&gt;&amp;nbsp;for more info on how to do that.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/3030009815340735062/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingresource.blogspot.com/2010/04/disable-refresh-in-webpage-using.html#comment-form' title='16 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/3030009815340735062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/3030009815340735062'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/2010/04/disable-refresh-in-webpage-using.html' title='Disable Refresh in Webpage Using Javascript (F5 &amp; Ctrl + R)'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUc1CdQ1XfU9erYBWn2efAIHRo2Z6n0YFIsbnIaXpw1O8t3LqWIOFI4tslR9k61I5DJRt3AfXKsKQ12dcXlgU-qoXB1SMLqOAP0_85Jgw1FiyI1xlqranUB5PxZM6tRcjWZRRGL5Vh1TKt/s72-c/window_open_toolbar.PNG" height="72" width="72"/><thr:total>16</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6407056434887736567.post-261002046030987287</id><published>2010-04-06T18:10:00.000-07:00</published><updated>2010-04-06T18:10:18.930-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="disable"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="right-click"/><title type='text'>Disable Right-Click in Webpage Using Javascript</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Here&#39;s a simple javascript snippet you can use to disable right-click in your web pages:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;document.oncontextmenu = &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;function&lt;/span&gt;() {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;alert(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&#39;Right-click is disabled.&#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;return false&lt;/span&gt;;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
Just place the above code anywhere in your main javascript file or in the head part of the main page. You can also remove or change the alert if you don&#39;t want to notify the user.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/261002046030987287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingresource.blogspot.com/2010/04/disable-right-click-in-webpage-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/261002046030987287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/261002046030987287'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/2010/04/disable-right-click-in-webpage-using.html' title='Disable Right-Click in Webpage Using Javascript'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6407056434887736567.post-7018657971886911350</id><published>2010-03-04T21:55:00.000-08:00</published><updated>2010-03-04T21:55:27.156-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ajax"/><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="autocomplete"/><category scheme="http://www.blogger.com/atom/ns#" term="autocompleteextender"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="modal popup"/><category scheme="http://www.blogger.com/atom/ns#" term="modalpopupextender"/><title type='text'>AutoCompleteExtender problems with ModalPopupExtender</title><content type='html'>&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;If you&#39;ve tried to use the &lt;strong&gt;AutoCompleteExtender&lt;/strong&gt; inside a &lt;strong&gt;ModalPopupExtender&lt;/strong&gt;, you&#39;ll notice that the autocomplete&amp;nbsp;options show behind the modal popup. This is a Z-index problem in which the ModalPopupExtender overrides all other controls. If you check the modal&#39;s Z-index you&#39;ll see that it uses&amp;nbsp;100001 for its foreground element, so use something higher like 10000001.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;cc1&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;AutoCompleteExtender&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;ace&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;OnClientShown&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;ShowOptions&quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;cc1&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;AutoCompleteExtender&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;script&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;language&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;javascript&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;text/&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;javascript&quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;function&lt;/span&gt; ShowOptions(control, args) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;control._completionListElement.style.zIndex = 10000001;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: Courier New;&quot;&gt;&lt;/span&gt;&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;So we use the &lt;strong&gt;OnClientShown&lt;/strong&gt; property which will call a javascript function to change the &lt;strong&gt;AutoCompleteExtender&lt;/strong&gt;&#39;s Z-index when it kicks in.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/7018657971886911350/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingresource.blogspot.com/2010/03/autocompleteextender-problems-with.html#comment-form' title='18 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/7018657971886911350'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/7018657971886911350'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/2010/03/autocompleteextender-problems-with.html' title='AutoCompleteExtender problems with ModalPopupExtender'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>18</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6407056434887736567.post-1063652557782711808</id><published>2010-03-01T17:03:00.000-08:00</published><updated>2010-03-01T17:03:44.843-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="column"/><category scheme="http://www.blogger.com/atom/ns#" term="insert into select"/><category scheme="http://www.blogger.com/atom/ns#" term="msg 2714"/><category scheme="http://www.blogger.com/atom/ns#" term="select into"/><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><category scheme="http://www.blogger.com/atom/ns#" term="t-sql"/><category scheme="http://www.blogger.com/atom/ns#" term="table"/><title type='text'>SQL Select Into &amp; Insert Into Select</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Here are two useful T-SQL query syntax for inserting select statements into tables:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;b&gt;SELECT INTO&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;SELECT&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;table1.column1,&amp;nbsp;table1.column2,&amp;nbsp;table1.column3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;INTO &lt;/span&gt;new_table&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;FROM &lt;/span&gt;table1&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;b&gt;INSERT INTO SELECT&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;INSERT INTO&lt;/span&gt; table1&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;SELECT&amp;nbsp;&lt;/span&gt;table2.column1,&amp;nbsp;table2.column2,&amp;nbsp;table2.column3&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;FROM &lt;/span&gt;table2&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Both of these syntax inserts query results into a table, the only difference is that we use &lt;b&gt;SELECT INTO&lt;/b&gt; to insert values from an existing table to a new one (a new table that is not yet present in the database).&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;And we use &lt;b&gt;INSERT INTO SELECT&lt;/b&gt; to insert values from an existing table to another existing one. Of course be reminded that the number of select columns from the source table should match the destination table&#39;s columns. Also note that if you use SELECT INTO to copy values from an existing table to another one, you&#39;ll get an error like this:&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;Msg 2714, Level 16, State 6 -&amp;nbsp;There is already an object named &#39;table_name&#39; in the database&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;. &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;So you really should use INSERT INTO SELECT in those cases.&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/1063652557782711808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingresource.blogspot.com/2010/03/sql-select-into-insert-into-select.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/1063652557782711808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/1063652557782711808'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/2010/03/sql-select-into-insert-into-select.html' title='SQL Select Into &amp; Insert Into Select'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6407056434887736567.post-1330849308984777974</id><published>2010-02-25T21:37:00.000-08:00</published><updated>2010-02-25T21:37:33.539-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="enter"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><title type='text'>ASP.NET C# OnEnter event in TextBox</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Here is a workaround for ASP.NET C# if you want an event that triggers on pressing the &lt;b&gt;&quot;Enter&quot;&lt;/b&gt;&amp;nbsp;key on your keyboard while still inside a textbox.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;First the javascript snippet:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;if&amp;nbsp;&lt;/span&gt;(event.which || event.keyCode) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; ((event.which == 13) || (event.keyCode == 13)) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;document.getElementById(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&#39;btnClick&#39;&lt;/span&gt;).click();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;return false&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;else &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;return &lt;/span&gt;true;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;};&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
It just captures the &lt;b&gt;&quot;Enter&quot;&lt;/b&gt; key press (which is 13) and then clicks the corresponding button to trigger its event. So you just place this script on the textbox&#39;s &lt;b&gt;onkeydown&lt;/b&gt; attribute which I&#39;ll show in just a sec.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;protected void&lt;/span&gt; Page_Load(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;object &lt;/span&gt;sender, &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;EventArgs &lt;/span&gt;e)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (!IsPostBack)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;txtBox.Attributes.Add(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&quot;onkeydown&quot;&lt;/span&gt;, &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&quot;if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById(&#39;&quot;&lt;/span&gt; + btnClick.UniqueID + &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&quot;&#39;).click();return false;}} else {return true}; &quot;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
Just add the attribute on the Page_Load event and you&#39;re done.&lt;br /&gt;
&lt;br /&gt;
Check this link for more keycodes:&amp;nbsp;&lt;a href=&quot;http://www.cambiaresearch.com/c4/702b8cd1-e5b0-42e6-83ac-25f0306e3e25/Javascript-Char-Codes-Key-Codes.aspx&quot;&gt;http://www.cambiaresearch.com/c4/702b8cd1-e5b0-42e6-83ac-25f0306e3e25/Javascript-Char-Codes-Key-Codes.aspx&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
-k&lt;br /&gt;
&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/1330849308984777974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingresource.blogspot.com/2010/02/aspnet-c-onenter-event-in-textbox.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/1330849308984777974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/1330849308984777974'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/2010/02/aspnet-c-onenter-event-in-textbox.html' title='ASP.NET C# OnEnter event in TextBox'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6407056434887736567.post-7164611157906178687</id><published>2010-02-25T20:19:00.000-08:00</published><updated>2010-02-25T20:19:16.850-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="cookies"/><category scheme="http://www.blogger.com/atom/ns#" term="web"/><title type='text'>ASP.NET C# : Working With Cookies</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;If enabled on client browsers, cookies are a great way to store bits of data for use by websites like remembering the login state of users who doesn&#39;t want to retype their username and password everytime they visit the site.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Here are the most common functions you can use to manipulate cookies in ASP.NET (C#):&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;b&gt;SETCOOKIE&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;public void&lt;/span&gt; SetCookie(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;string &lt;/span&gt;name, &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;string &lt;/span&gt;value, &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;int &lt;/span&gt;expiration)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;HttpCookie &lt;/span&gt;cookie;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;if &lt;/span&gt;(Request.Cookies[name] == &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;) cookie = &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;new &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;HttpCookie&lt;/span&gt;(name);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;else &lt;/span&gt;cookie = Request.Cookies[name];&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;cookie.Value = value;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;cookie.Expires = &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;DateTime&lt;/span&gt;.Now.AddDays(expiration);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Response.Cookies.Add(cookie);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;SetCookie can be used to add a new cookie or overwrite an exisiting one in your cookie collection. Simply pass the name and value pair and the expiration (in days) for how long you want that cookie to be in use by your website. In the following code, we store the username &quot;abby&quot; in our collection for 1 day.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;SetCookie(&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&quot;username&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&quot;abby&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;, 1);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Take note though that if you use the same cookie name &quot;username&quot; again to set another value, it will overwrite the previous one.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;b&gt;GETCOOKIE&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;public string&lt;/span&gt; GetCookie(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;string &lt;/span&gt;name)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;HttpCookie &lt;/span&gt;cookie = Request.Cookies[name];&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;if &lt;/span&gt;(cookie == &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;) &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;return &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&quot;&quot;&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;else return&lt;/span&gt; cookie.Value;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;GetCookie can be used to retrieve the value of the cookie by passing the name. In the following code, we get the value of the cookie considering it has not yet expired.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;string &lt;/span&gt;str = GetCookie(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&quot;username&quot;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;b&gt;DELETECOOKIE&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;public void&lt;/span&gt; DeleteCookie(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;string &lt;/span&gt;name)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #073763;&quot;&gt;HttpCookie &lt;/span&gt;cookie;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;if &lt;/span&gt;(Request.Cookies[name] == &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;) &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;return&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;else &lt;/span&gt;cookie = Request.Cookies[name];&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;cookie.Expires = &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;DateTime&lt;/span&gt;.Now.AddDays(-1);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Response.Cookies.Add(cookie);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;DeleteCookie can be used to delete a particular cookie from the cookie collection by passing the name. Notice the -1 in the AddDays? That will simply delete the value in the physical cookie file. In the following code, we delete the &quot;username&quot; cookie.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;DeleteCookie(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&quot;username&quot;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;b&gt;CLEARCOOKIES&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;public void &lt;/span&gt;ClearCookies()&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;int &lt;/span&gt;cookieCount = Request.Cookies.Count;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;for &lt;/span&gt;(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;int &lt;/span&gt;i = 0; i &amp;lt; cookieCount; i++)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #073763;&quot;&gt;HttpCookie &lt;/span&gt;cookie = Request.Cookies[i];&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cookie.Expires = &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #073763;&quot;&gt;DateTime&lt;/span&gt;.Now.AddDays(-1);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Response.Cookies.Add(cookie);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;ClearCookies can be used to delete all cookies in the cookie collection. We also used the -1 in the AddDays here but used a loop to delete each one in the collection. In the following code, it will delete the physical cookie file of your website.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;ClearCookies();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;And that&#39;s it for cookies.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;-k&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/7164611157906178687/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingresource.blogspot.com/2010/02/aspnet-c-working-with-cookies.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/7164611157906178687'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/7164611157906178687'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/2010/02/aspnet-c-working-with-cookies.html' title='ASP.NET C# : Working With Cookies'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6407056434887736567.post-1555528318902903976</id><published>2010-02-13T08:02:00.000-08:00</published><updated>2010-02-13T08:03:46.559-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="iis"/><category scheme="http://www.blogger.com/atom/ns#" term="iis7"/><category scheme="http://www.blogger.com/atom/ns#" term="publish"/><title type='text'>IIS7 Publish Problems with Database</title><content type='html'>&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;So after testing your website on Visual Studio and made sure everything is working fine, especially database connections, you now published your new site on IIS7&amp;nbsp;and to your surprise connections don&#39;t work as you&#39;ve set.&amp;nbsp;Try these following steps..&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Trebuchet MS;&quot;&gt;Open IIS by going to Control Panel &amp;gt; Administrative Tools &amp;gt; Internet Information Services (IIS) Manager. On the left menu, click on Application Pools.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTjWqlijV5rABCAnE42eQwYFowemS8HyL9ANfhKEkYaUoRFZOQ6LYjR9ciSGHgSBmptZfPTgv1tiDSIcug0-0RvtXVwX0odh9vflXAieXznQcCDXR5wTCFR7IZBsNR_cuzK8z50RpYLp60/s1600-h/iis7_1.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; ct=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTjWqlijV5rABCAnE42eQwYFowemS8HyL9ANfhKEkYaUoRFZOQ6LYjR9ciSGHgSBmptZfPTgv1tiDSIcug0-0RvtXVwX0odh9vflXAieXznQcCDXR5wTCFR7IZBsNR_cuzK8z50RpYLp60/s320/iis7_1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;Click on &lt;strong&gt;DefaultAppPool&lt;/strong&gt; and then &lt;strong&gt;Advanced Settings...&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsFH1_t2zEXJD_Cm_w1CaSmGFj2WF3EVh5W7ISkWUnovrVsIsTf2E6bwEHAyHeXVuQqgDdEvubkXU0FUL7T39B7VEfeRrHWqOPy8Dv2Rs3sAPRhqbzizCdAJipysuMcoorUtelcPJ5kZVl/s1600-h/iis7_2.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; ct=&quot;true&quot; height=&quot;228&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsFH1_t2zEXJD_Cm_w1CaSmGFj2WF3EVh5W7ISkWUnovrVsIsTf2E6bwEHAyHeXVuQqgDdEvubkXU0FUL7T39B7VEfeRrHWqOPy8Dv2Rs3sAPRhqbzizCdAJipysuMcoorUtelcPJ5kZVl/s640/iis7_2.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;Click on the &lt;strong&gt;Identity&lt;/strong&gt; selector under&lt;strong&gt; Process Model&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZfjfuE0a6HL_zdf5EW9LZiMuHodxsySQzCn5lgDbupdx2dILbu6UlZ78UysPDeppXoeVF00YLZVvTEnenRHqQZ-l8f_wSY8C5Th1B4qLv5VDI0phOiH0xkN5ys3rYEBROclKc7u8RW17h/s1600-h/iis7_3.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; ct=&quot;true&quot; height=&quot;596&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZfjfuE0a6HL_zdf5EW9LZiMuHodxsySQzCn5lgDbupdx2dILbu6UlZ78UysPDeppXoeVF00YLZVvTEnenRHqQZ-l8f_wSY8C5Th1B4qLv5VDI0phOiH0xkN5ys3rYEBROclKc7u8RW17h/s640/iis7_3.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;Change it to &lt;strong&gt;LocalSystem &lt;/strong&gt;and click Ok.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyOeNQkKD2v5gUqUBMwJ7cZn7rofdgPVBk-R_vtM2dFiB1AmOImDWql6Sz0YeLvXc-xH_NVrIYRiUQBKnrFN2q9sN64oNuQfyy_XbF-o7R_hJ9crdA65TJ_4_EnoW1aqULzhcQXaEQczGt/s1600-h/iis7_4.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; ct=&quot;true&quot; height=&quot;230&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyOeNQkKD2v5gUqUBMwJ7cZn7rofdgPVBk-R_vtM2dFiB1AmOImDWql6Sz0YeLvXc-xH_NVrIYRiUQBKnrFN2q9sN64oNuQfyy_XbF-o7R_hJ9crdA65TJ_4_EnoW1aqULzhcQXaEQczGt/s400/iis7_4.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;Now try running your website again and it should have no more connection problems.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS;&quot;&gt;-k&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/1555528318902903976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingresource.blogspot.com/2010/02/iis7-publish-problems-with-database.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/1555528318902903976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/1555528318902903976'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/2010/02/iis7-publish-problems-with-database.html' title='IIS7 Publish Problems with Database'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTjWqlijV5rABCAnE42eQwYFowemS8HyL9ANfhKEkYaUoRFZOQ6LYjR9ciSGHgSBmptZfPTgv1tiDSIcug0-0RvtXVwX0odh9vflXAieXznQcCDXR5wTCFR7IZBsNR_cuzK8z50RpYLp60/s72-c/iis7_1.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6407056434887736567.post-4695564906599618167</id><published>2010-02-11T07:01:00.000-08:00</published><updated>2010-02-23T17:42:19.576-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="activex"/><category scheme="http://www.blogger.com/atom/ns#" term="computer name"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="ip address"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="mac address"/><title type='text'>Get Client MAC Address &amp; IP Address using Javascript</title><content type='html'>&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;This is somewhat similar to the previous post &lt;a href=&quot;http://codingresource.blogspot.com/2010/01/get-client-cpu-id-with-javascript.html&quot;&gt;Get client cpu id with javascript&lt;/a&gt;, so the client still needs to enable ActiveX components on his browser. Read more on the said&amp;nbsp;post for details.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;;&quot;&gt;Ok if you&#39;re done reading, you&#39;ll notice we simply change the script to this:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;script&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;text/javascript&quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var&lt;/span&gt; macAddress = &quot;&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; ipAddress = &quot;&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; computerName = &quot;&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; wmi = GetObject(&lt;span style=&quot;color: #4c1130;&quot;&gt;&quot;winmgmts:{impersonationLevel=impersonate}&quot;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;e = &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;new &lt;/span&gt;Enumerator(wmi.ExecQuery(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&quot;SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True&quot;&lt;/span&gt;));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;for&lt;/span&gt;(; !e.atEnd(); e.moveNext()) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; s = e.item(); &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; macAddress = s.MACAddress;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ipAddress = s.IPAddress(0);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; computerName = s.DNSHostName;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Instead of &lt;strong&gt;Win32_Processor&lt;/strong&gt;, here we&#39;ll access &lt;strong&gt;Win32_NetworkAdapterConfiguration&lt;/strong&gt; to read network related details like the MAC Address, IP Address and the computer name.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;;&quot;&gt;Then we can simply use textboxes to display that information or whatever you like.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;input&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;text&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;txtMACAdress&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;input&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;text&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;txtIPAdress&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;input&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;text&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;txtComputerName&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;script&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;text/javascript&quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById(&lt;span style=&quot;color: #4c1130;&quot;&gt;&quot;txtMACAdress&quot;&lt;/span&gt;).value = unescape(macAddress);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById(&lt;span style=&quot;color: #4c1130;&quot;&gt;&quot;txtIPAdress&quot;&lt;/span&gt;).value = unescape(ipAddress);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById(&lt;span style=&quot;color: #4c1130;&quot;&gt;&quot;txtComputerName&quot;&lt;/span&gt;).value = unescape(computerName);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;And just like before, make sure to place the declarations snippet&amp;nbsp;above this script&amp;nbsp;for it to&amp;nbsp;display the values properly. Now the client can see his/her own MAC and IP Addresses.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;;&quot;&gt;Read more about the &lt;strong&gt;Win32_NetworkAdapterConfiguration&lt;/strong&gt; object&amp;nbsp;here &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/aa394217(VS.85).aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/aa394217(VS.85).aspx&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;;&quot;&gt;-k&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/4695564906599618167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingresource.blogspot.com/2010/02/get-client-mac-address-ip-address-using.html#comment-form' title='48 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/4695564906599618167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/4695564906599618167'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/2010/02/get-client-mac-address-ip-address-using.html' title='Get Client MAC Address &amp; IP Address using Javascript'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>48</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6407056434887736567.post-6481897255610000118</id><published>2010-02-10T23:59:00.000-08:00</published><updated>2010-02-11T00:01:21.355-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ajax"/><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><title type='text'>ASP.NET AJAX this._form is null error on javascript</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;If ever you encounter this sneaky error on your ASP.NET AJAX-Enabled websites (you would know it when you see the &lt;b&gt;this._form is null&lt;/b&gt;&amp;nbsp;javascript error message or simply if your &lt;b&gt;controls don&#39;t cause postbacks anymore&lt;/b&gt;) the culprit is the javascript declaration found on the &lt;b&gt;head &lt;/b&gt;tag in the html page.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;If you have declared it like this:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;script&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;=&quot;scripts/main.js&quot;&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;=&quot;text/javascript&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Simply change it to this:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;script&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;=&quot;scripts/main.js&quot;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;=&quot;text/javascript&quot;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;And problem is solved.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;-k&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/6481897255610000118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingresource.blogspot.com/2010/02/aspnet-ajax-thisform-is-null-error-on.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/6481897255610000118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/6481897255610000118'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/2010/02/aspnet-ajax-thisform-is-null-error-on.html' title='ASP.NET AJAX this._form is null error on javascript'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6407056434887736567.post-8223974134945822515</id><published>2010-01-31T22:39:00.000-08:00</published><updated>2010-01-31T22:41:32.562-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="cookies"/><category scheme="http://www.blogger.com/atom/ns#" term="msdn"/><category scheme="http://www.blogger.com/atom/ns#" term="sessionState"/><category scheme="http://www.blogger.com/atom/ns#" term="web.config"/><title type='text'>ASP.NET Logout on Session Expire</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Here&#39;s a way to enable logout after session has expired in your ASP.NET pages.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Let us begin with the &lt;b&gt;sessionState &lt;/b&gt;tag inside the web.config file:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;system.web&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&amp;lt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;sessionState &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;mode&lt;/span&gt;=&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&quot;&lt;/span&gt;InProc&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&quot;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;cookieless&lt;/span&gt;=&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&quot;&lt;/span&gt;false&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&quot;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;timeout&lt;/span&gt;=&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&quot;&lt;/span&gt;30&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&quot;&lt;/span&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;system.web&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Make sure to place it inside the&amp;nbsp;&lt;b&gt;system.web&lt;/b&gt; tag. For the attributes, we use &lt;b&gt;InProc&lt;/b&gt; mode to &lt;span class=&quot;Apple-style-span&quot; style=&quot;text-decoration: underline;&quot;&gt;store the session on the local computer&lt;/span&gt;, &lt;b&gt;cookieless is set to false&lt;/b&gt; which means it will &lt;span class=&quot;Apple-style-span&quot; style=&quot;text-decoration: underline;&quot;&gt;store the session as cookies&lt;/span&gt; (if you set this to true, you will get some jumbled alphanumeric characters in your webpage&#39;s URL) and finally &lt;b&gt;timeout &lt;/b&gt;which has a &lt;span class=&quot;Apple-style-span&quot; style=&quot;text-decoration: underline;&quot;&gt;numeric value equal to how long you want your session in minutes before it expires&lt;/span&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;For more information on sessionState attributes, check out msdn:&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/h6bb9cz9(VS.71).aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/h6bb9cz9(VS.71).aspx&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Now the snippet above alone will not make your page redirect automatically to your logout page after session has expired. We still need human intervention to enable that. So we add this next logic to the Master Page&#39;s page_load event (or to all pages of a website if you&#39;re not using master pages):&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;protected void&lt;/span&gt; Page_Load(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;object &lt;/span&gt;sender, &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;EventArgs &lt;/span&gt;e)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;//1st: Every postback should pass through this code.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;// &amp;nbsp; &amp;nbsp; Make a decision statement to check if user has already logged in&lt;/span&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (&lt;i&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;user has already logged in&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;//2nd: Check your user session.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If session is null (expired) then continue&lt;/span&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (Session[&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&quot;&lt;/span&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;user_session&lt;/span&gt;&lt;/i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&quot;&lt;/span&gt;] == &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;//3rd: Clear all sessions, data, connections, etc. (optional)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Redirect to logout page.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Page.Response.Redirect(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&quot;&lt;/span&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;logout_page&lt;/span&gt;&lt;/i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&quot;&lt;/span&gt;, &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
Handling session expiration is required for web pages which uses sessions to store data so you won&#39;t encounter the&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; white-space: pre;&quot;&gt;&lt;b&gt;object reference not set to an instance of an object&lt;/b&gt;&lt;/span&gt;&amp;nbsp;error should your session objects expire.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-k&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/8223974134945822515/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingresource.blogspot.com/2010/01/aspnet-logout-on-session-expire.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/8223974134945822515'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/8223974134945822515'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/2010/01/aspnet-logout-on-session-expire.html' title='ASP.NET Logout on Session Expire'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6407056434887736567.post-7417475298352008099</id><published>2010-01-31T05:51:00.000-08:00</published><updated>2010-01-31T05:51:47.289-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="databind"/><category scheme="http://www.blogger.com/atom/ns#" term="inline"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="Server tag was not well formed"/><title type='text'>ASP.NET Server tag was not well formed</title><content type='html'>&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;&lt;strong&gt;TIP: &lt;u&gt;ASP.NET C# Expression Language with Javascript&lt;/u&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;Here&#39;s a tip on how to use C# bind code&amp;nbsp;inline with javascript events, first let&#39;s use a LinkButton for example:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;asp:LinkButton&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;lnkBtn&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;OnClick&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;lnkBtn_Click&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;OnClientClick&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&#39;&lt;/span&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;&amp;lt;%&lt;/span&gt;# &quot;document.getElementById(\&quot;txtHtmlText\&quot;).value = &quot; + Eval(&quot;id&quot;) + &quot;;&quot; &lt;span style=&quot;background-color: yellow;&quot;&gt;%&amp;gt;&lt;/span&gt;&#39; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;Imagine this LinkButton is inside a binded control like Gridview or Repeater, etc.,&amp;nbsp;now look at&amp;nbsp;the &lt;strong&gt;OnClientClick&lt;/strong&gt; attribute. Remember&amp;nbsp;to be careful with single and double quotes. &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;1.&amp;nbsp;Use &lt;u&gt;single quotes to contain the whole&amp;nbsp;expresion&lt;/u&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Trebuchet MS;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;OnClientClick&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;span style=&quot;background-color: #ea9999;&quot;&gt;&#39;&amp;nbsp;&amp;nbsp;...&amp;nbsp; &#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;2. Enclose inner javascript statements with double quotes and concatenate it with .NET bind statements (&lt;em&gt;like &lt;strong&gt;Eval()&lt;/strong&gt;&lt;/em&gt;)&amp;nbsp;with the &quot;&lt;strong&gt;+&lt;/strong&gt;&quot; symbol.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Trebuchet MS;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: #ea9999;&quot;&gt;&quot;document.getElementById(\&quot;txtHtmlText\&quot;).value = &quot;&lt;/span&gt; &lt;strong&gt;&lt;span style=&quot;background-color: #ea9999;&quot;&gt;+&lt;/span&gt;&lt;/strong&gt; Eval(&quot;id&quot;) &lt;strong&gt;&lt;span style=&quot;background-color: #ea9999;&quot;&gt;+&lt;/span&gt;&lt;/strong&gt; &lt;span style=&quot;background-color: #ea9999;&quot;&gt;&quot;;&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;3.&amp;nbsp;U&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;se&amp;nbsp;&lt;u&gt;escaped double quotes (the one with the slash)&lt;/u&gt; if ever you&#39;ll use double quotes inside another one.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Trebuchet MS;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;getElementById(&lt;strong&gt;&lt;span style=&quot;background-color: #ea9999;&quot;&gt;\&quot;txtHtmlText\&quot;&lt;/span&gt;&lt;/strong&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Trebuchet MS;&quot;&gt;So the next time you get the error &lt;strong&gt;&quot;Server tag was not well formed&quot;&lt;/strong&gt; just remember these 3 tips.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Trebuchet MS;&quot;&gt;-k&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/7417475298352008099/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingresource.blogspot.com/2010/01/aspnet-server-tag-was-not-well-formed.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/7417475298352008099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/7417475298352008099'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/2010/01/aspnet-server-tag-was-not-well-formed.html' title='ASP.NET Server tag was not well formed'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6407056434887736567.post-7997321091583122847</id><published>2010-01-28T23:53:00.000-08:00</published><updated>2010-01-29T00:07:56.441-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="web services"/><title type='text'>Change Web Service name in ASP.NET</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;For example you have a Web Service named &lt;span class=&quot;Apple-style-span&quot; style=&quot;text-decoration: underline;&quot;&gt;AAAWebService&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUABAYI5MmIO7sLV5A34JSfhwT_GkYKnFe9ZsgD4i70xbO5bDU5K1qy-JES24Vovrbv8BdNARv1exDDbnv2b7OscthFV9JopopzVw27oWGX3EuvDWvifoR1dpLVd3kEBMc80fVMipTZfgs/s1600-h/web-service-name1.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUABAYI5MmIO7sLV5A34JSfhwT_GkYKnFe9ZsgD4i70xbO5bDU5K1qy-JES24Vovrbv8BdNARv1exDDbnv2b7OscthFV9JopopzVw27oWGX3EuvDWvifoR1dpLVd3kEBMc80fVMipTZfgs/s200/web-service-name1.PNG&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;And you want to change its name to let&#39;s say &lt;span class=&quot;Apple-style-span&quot; style=&quot;text-decoration: underline;&quot;&gt;BBBWebService&lt;/span&gt;. If you open your code and change it like this..&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;public class&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;BBBWebService &lt;/span&gt;: System.Web.Services.&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;WebService&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;... and then run it, you would get an error like this...&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhycf8ADCe5iM2X6eK2Aab07l4n71KUo5ystCW_LII2NUEhDAI-9zCyeiBrppJpMnduCoKAPCknYCItDHVBgbJlIIGG0B7lOwkCKd8ymJwfBU8YQaRpGU4OhYRN8fVWJC599dlziOUeG5nH/s1600-h/web-service-name2.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;212&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhycf8ADCe5iM2X6eK2Aab07l4n71KUo5ystCW_LII2NUEhDAI-9zCyeiBrppJpMnduCoKAPCknYCItDHVBgbJlIIGG0B7lOwkCKd8ymJwfBU8YQaRpGU4OhYRN8fVWJC599dlziOUeG5nH/s640/web-service-name2.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;The solution is to right click on your web service asmx file and click view markup.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiohsa5awl2VYkSNY5V_VkK_K4CX9-SIN-TCAJCPyo5iBTVoA5iM0G1xJikzuCJfHDglGAXra2aIgMj06lPRg-X8cZApOk25lsG50J4MrNPbSmFm1Woy_o0U39aY8YzbD7a64_n4CMP89C/s1600-h/web-service-name3.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiohsa5awl2VYkSNY5V_VkK_K4CX9-SIN-TCAJCPyo5iBTVoA5iM0G1xJikzuCJfHDglGAXra2aIgMj06lPRg-X8cZApOk25lsG50J4MrNPbSmFm1Woy_o0U39aY8YzbD7a64_n4CMP89C/s320/web-service-name3.PNG&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Change the name here and you&#39;re done.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: yellow;&quot;&gt;&amp;lt;%&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;@&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;WebService &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;Language&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;=&quot;C#&quot;&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;CodeBehind&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;=&quot;AAAWebService.asmx.cs&quot;&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;Class&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;=&quot;Web_Services.BBBWebService&quot;&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: yellow;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;-k&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/7997321091583122847/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingresource.blogspot.com/2010/01/change-web-service-name-in-aspnet.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/7997321091583122847'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/7997321091583122847'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/2010/01/change-web-service-name-in-aspnet.html' title='Change Web Service name in ASP.NET'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUABAYI5MmIO7sLV5A34JSfhwT_GkYKnFe9ZsgD4i70xbO5bDU5K1qy-JES24Vovrbv8BdNARv1exDDbnv2b7OscthFV9JopopzVw27oWGX3EuvDWvifoR1dpLVd3kEBMc80fVMipTZfgs/s72-c/web-service-name1.PNG" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6407056434887736567.post-226899639255992206</id><published>2010-01-28T18:33:00.000-08:00</published><updated>2010-01-28T18:36:53.940-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="button"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="redirect"/><category scheme="http://www.blogger.com/atom/ns#" term="refresh"/><category scheme="http://www.blogger.com/atom/ns#" term="reload"/><title type='text'>ASP.NET C# Refresh page from code behind</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;To refresh your page you may use the javascript function:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 15px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;window.location.reload();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 15px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif; line-height: 15px;&quot;&gt;For example you can use that on the &lt;b&gt;OnClientClick&lt;/b&gt; attribute of an ASP.NET button:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 15px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 15px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;asp:button&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;=&quot;btnRefresh&quot;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;OnClick&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;=&quot;btnRefresh_Click&quot;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;=&quot;server&quot;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;=&quot;REFRESH&quot;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 15px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;OnClientClick&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;=&quot;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;window.location.reload();&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 15px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 15px;&quot;&gt;The code above will work fine, but if let&#39;s say you have some other server-side logic you want to run on the code for&amp;nbsp;&lt;b&gt;btnRefresh_Click&lt;/b&gt;,&lt;b&gt;&amp;nbsp;&lt;/b&gt;it won&#39;t be executed because the page would already be refreshed by then.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 15px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif; line-height: 15px;&quot;&gt;So to run your server-side code, first remove the &lt;b&gt;OnClientClick&amp;nbsp;&lt;/b&gt;attribute&amp;nbsp;on the asp button tag above.&amp;nbsp;Then place the following code inside your button click event:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 15px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 15px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;protected void&lt;/span&gt; btnRefresh_Click(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;object &lt;/span&gt;sender, &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;EventArgs &lt;/span&gt;e)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;//Your logic here...&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Page.Response.Redirect(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;HttpContext&lt;/span&gt;.Current.Request.Url.ToString(), &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
We simply redirect the page to its current url and that does the trick.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-k&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/226899639255992206/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingresource.blogspot.com/2010/01/aspnet-c-refresh-page-from-code-behind.html#comment-form' title='17 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/226899639255992206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/226899639255992206'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/2010/01/aspnet-c-refresh-page-from-code-behind.html' title='ASP.NET C# Refresh page from code behind'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>17</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6407056434887736567.post-1907874119083650353</id><published>2010-01-27T03:58:00.000-08:00</published><updated>2010-01-27T04:04:03.266-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".net"/><category scheme="http://www.blogger.com/atom/ns#" term="attributes"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="window open"/><title type='text'>Javascript Window.Open() in .NET</title><content type='html'>&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;Here&#39;s an example on how to popup a new window using javascript in .NET. First we&#39;ll use a simple button as the trigger source for the popup.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;asp:Button &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;btnPopup&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: Trebuchet MS;&quot;&gt;Then on the page load in the code behind, add an&amp;nbsp;&lt;strong&gt;onclick&lt;/strong&gt; attribute to the button.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;protected void&lt;/span&gt; Page_Load(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, &lt;span style=&quot;color: #0b5394;&quot;&gt;EventArgs&lt;/span&gt; e)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; btnPopup.Attributes.Add(&lt;span style=&quot;color: #990000;&quot;&gt;&quot;onclick&quot;&lt;/span&gt;, &lt;span style=&quot;color: #990000;&quot;&gt;&quot;window.open(&#39;http://&quot;&lt;/span&gt; + Page.Request.Url.Authority + &lt;span style=&quot;color: #990000;&quot;&gt;&quot;/TestPage.aspx&#39;,&#39;Test&#39;,&#39;status,toolbar,location,menubar,directories,resizable,scrollbars,width=400,height=400&#39;)&quot;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;}&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;&lt;/span&gt;&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;The &lt;strong&gt;Page.Request.Url.Authority&lt;/strong&gt; in the code above will retrieve the root url of your site. Then just add the name of the aspx file to popup&amp;nbsp;after the forward slash (if it is within another directory, just add the directory name before the&amp;nbsp;aspx file, and so forth).&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;font-family: Trebuchet MS;&quot;&gt;&lt;/span&gt;&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;font-family: Trebuchet MS;&quot;&gt;To explain the javascript part, &lt;strong&gt;window.open()&lt;/strong&gt; accepts 3 parameters: the url of the site to popup, the window name (not title, the title should be in the head part of the new page,&amp;nbsp;so make sure it doesn&#39;t have spaces), and window features.&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;font-family: Trebuchet MS;&quot;&gt;&lt;/span&gt;&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;font-family: Trebuchet MS;&quot;&gt;Here&#39;s some of the commonly used window features:&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;&lt;/span&gt;&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;&lt;strong&gt;status&lt;/strong&gt;:&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;&lt;/span&gt;&amp;nbsp; &lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4RRBOKtcqVo7hHNskxrksEOKT1tQSLwPVPcs1AYLRomp2NNae3bBTTJkdOCrqXferH4HE_4co63W8r18hu9CYFbDyr7wQ3M3WHh5b2H_S3D9Vsl2-gei8tijGu0We7JZK1C3aYyic88dm/s1600-h/window_open_status.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;32&quot; mt=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4RRBOKtcqVo7hHNskxrksEOKT1tQSLwPVPcs1AYLRomp2NNae3bBTTJkdOCrqXferH4HE_4co63W8r18hu9CYFbDyr7wQ3M3WHh5b2H_S3D9Vsl2-gei8tijGu0We7JZK1C3aYyic88dm/s400/window_open_status.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-family: Trebuchet MS;&quot;&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;&lt;strong&gt;toolbar&lt;/strong&gt;:&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUc1CdQ1XfU9erYBWn2efAIHRo2Z6n0YFIsbnIaXpw1O8t3LqWIOFI4tslR9k61I5DJRt3AfXKsKQ12dcXlgU-qoXB1SMLqOAP0_85Jgw1FiyI1xlqranUB5PxZM6tRcjWZRRGL5Vh1TKt/s1600-h/window_open_toolbar.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;45&quot; mt=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUc1CdQ1XfU9erYBWn2efAIHRo2Z6n0YFIsbnIaXpw1O8t3LqWIOFI4tslR9k61I5DJRt3AfXKsKQ12dcXlgU-qoXB1SMLqOAP0_85Jgw1FiyI1xlqranUB5PxZM6tRcjWZRRGL5Vh1TKt/s400/window_open_toolbar.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;&lt;/span&gt;&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;&lt;strong&gt;location&lt;/strong&gt;:&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiogPK4tZ8dJ88e2HRzlzshCngwXZalBu2VcjHNO3zbIgnFYNs7r50U88VjYvwtcbSWxSEQkgTDLlmvdt6hywTV4l0_DWrAYMGmQwqfjnNxnDwu4_oAnyJatPBe8ak0n-9c_xlHzzFN9ori/s1600-h/window_open_location.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;33&quot; mt=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiogPK4tZ8dJ88e2HRzlzshCngwXZalBu2VcjHNO3zbIgnFYNs7r50U88VjYvwtcbSWxSEQkgTDLlmvdt6hywTV4l0_DWrAYMGmQwqfjnNxnDwu4_oAnyJatPBe8ak0n-9c_xlHzzFN9ori/s400/window_open_location.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;&lt;/span&gt;&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;&lt;strong&gt;menubar&lt;/strong&gt;:&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimXFSKYRLK_QwQiniHzhX4xIaxBDjb24V2jNm0U0OAVivIiEkhuDcmxZUOQS-91yyiK5H_m5L0G0hHhNSw075RpHQ116CLU163tsVXDuP2BZ2Q1mA0FfnivxEb4iYbG-Zb2TWrWq2wwcHZ/s1600-h/window_open_menubar.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;28&quot; mt=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimXFSKYRLK_QwQiniHzhX4xIaxBDjb24V2jNm0U0OAVivIiEkhuDcmxZUOQS-91yyiK5H_m5L0G0hHhNSw075RpHQ116CLU163tsVXDuP2BZ2Q1mA0FfnivxEb4iYbG-Zb2TWrWq2wwcHZ/s400/window_open_menubar.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;&lt;/span&gt;&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;&lt;strong&gt;directories&lt;/strong&gt;:&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBw2Vnaz0zaNGRLb2VkFj__ioa8J_uzUd35JyfNFDPO5HFONartdkCExN1St-hmVXzPhVkWu6sT_TKS3121lMMixCmH_ZEWELGjf7qzYD16pqevw2WK6O-sg3OK17hQ-k7VnbDaSFkbCiA/s1600-h/window_open_directories.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;28&quot; mt=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBw2Vnaz0zaNGRLb2VkFj__ioa8J_uzUd35JyfNFDPO5HFONartdkCExN1St-hmVXzPhVkWu6sT_TKS3121lMMixCmH_ZEWELGjf7qzYD16pqevw2WK6O-sg3OK17hQ-k7VnbDaSFkbCiA/s400/window_open_directories.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;&lt;/span&gt;&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;&lt;strong&gt;resizable&lt;/strong&gt;:&lt;/span&gt; &lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;&lt;u&gt;window can be resized&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAByGmSta52DnEXEL5ei_yiYR91z2xWwSTgmERQOED8g5n89o9UZ0WQRfoNZUO7Pa9qbC51ZCHy703pzExqn_40uZjmuWZBRIpUPJSMcNbUweCUCmmPuNy8USbEP2wJxibUDECpjPjFqL3/s1600-h/window_open_resizable.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; mt=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAByGmSta52DnEXEL5ei_yiYR91z2xWwSTgmERQOED8g5n89o9UZ0WQRfoNZUO7Pa9qbC51ZCHy703pzExqn_40uZjmuWZBRIpUPJSMcNbUweCUCmmPuNy8USbEP2wJxibUDECpjPjFqL3/s320/window_open_resizable.PNG&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;&lt;/span&gt;&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;&lt;strong&gt;scrollbars&lt;/strong&gt;:&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhED5tfDs_O-VlHgx8s97XxVHsp-gDhXmkqizIw86ObmBVw97W1Q-g8KAbLcABpih0FWq7zruMEBikDjxXbv8VRI8IADq0s_lPLYLshMrPyTs629S9HX6NaOLcxUwu2YIbHiK1aWlp273PI/s1600-h/window_open_scrollbars.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; he=&quot;&quot; mt=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhED5tfDs_O-VlHgx8s97XxVHsp-gDhXmkqizIw86ObmBVw97W1Q-g8KAbLcABpih0FWq7zruMEBikDjxXbv8VRI8IADq0s_lPLYLshMrPyTs629S9HX6NaOLcxUwu2YIbHiK1aWlp273PI/s400/window_open_scrollbars.PNG&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;&lt;/span&gt;&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;&lt;strong&gt;width&lt;/strong&gt;: &lt;u&gt;the width of the window in pixels&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;&lt;/span&gt;&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;&lt;strong&gt;height&lt;/strong&gt;: &lt;u&gt;the height of the window in pixels&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Trebuchet MS;&quot;&gt;To use these features simply add them to the list like this:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&quot;window.open&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;(&#39;http://www.testpage.com&#39;,&#39;Test&#39;,&#39;&lt;strong&gt;status,toolbar,location,menubar,directories,resizable,scrollbars&lt;/strong&gt;,width=400,height=400&#39;)&quot;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfttuDhObkinQezc0iGP-sxO-OGI0fBcT_wEBDB5G_30bXk__KnWtx_KEQrYBVaeE7NIP6xoGd1ImsvxBa1P9T6T81K_jbAxNC4nk1eTjMFh6rk2T1Dz56zKdypIvsPv96gEGczY2M2DfK/s1600-h/window_open_all.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; mt=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfttuDhObkinQezc0iGP-sxO-OGI0fBcT_wEBDB5G_30bXk__KnWtx_KEQrYBVaeE7NIP6xoGd1ImsvxBa1P9T6T81K_jbAxNC4nk1eTjMFh6rk2T1Dz56zKdypIvsPv96gEGczY2M2DfK/s400/window_open_all.PNG&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;If not then simply omit them:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&quot;window.open(&#39;http://www.testpage.com&#39;,&#39;Test&#39;,&#39;width=400,height=400&#39;)&quot;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4Wmppk6A8XBoJMMbKFHGA1997mzelT4F32hewU1adRdAjgfsbTDGINbkgE9UKwIQBr4Tzxo74jz8LWfNec04ARDtGFB64tc5pWjpUmjT3F3x5_7_QJkjbmue_yLGg-mj1glbrAEKQ-GKx/s1600-h/window_open_none.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; mt=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4Wmppk6A8XBoJMMbKFHGA1997mzelT4F32hewU1adRdAjgfsbTDGINbkgE9UKwIQBr4Tzxo74jz8LWfNec04ARDtGFB64tc5pWjpUmjT3F3x5_7_QJkjbmue_yLGg-mj1glbrAEKQ-GKx/s400/window_open_none.PNG&quot; width=&quot;376&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;That&#39;s it, one note though, make sure that the aspx page in the url exists or you&#39;ll get an error.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;-k&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/1907874119083650353/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingresource.blogspot.com/2010/01/javascript-windowopen-in-net.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/1907874119083650353'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/1907874119083650353'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/2010/01/javascript-windowopen-in-net.html' title='Javascript Window.Open() in .NET'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4RRBOKtcqVo7hHNskxrksEOKT1tQSLwPVPcs1AYLRomp2NNae3bBTTJkdOCrqXferH4HE_4co63W8r18hu9CYFbDyr7wQ3M3WHh5b2H_S3D9Vsl2-gei8tijGu0We7JZK1C3aYyic88dm/s72-c/window_open_status.PNG" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6407056434887736567.post-754048859843607692</id><published>2010-01-25T05:47:00.000-08:00</published><updated>2010-01-26T23:53:33.497-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="iis"/><category scheme="http://www.blogger.com/atom/ns#" term="iis7"/><category scheme="http://www.blogger.com/atom/ns#" term="iusr"/><category scheme="http://www.blogger.com/atom/ns#" term="management studio"/><category scheme="http://www.blogger.com/atom/ns#" term="nt authority"/><category scheme="http://www.blogger.com/atom/ns#" term="sql server"/><title type='text'>Login failed for user &#39;NT AUTHORITY\IUSR&#39;</title><content type='html'>&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;If you encountered this error while running your published website or web service in IIS7:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #ffe599; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Message: Sys.WebForms.PageRequestManagerServerErrorException: Cannot open database &quot;[DB_NAME]&lt;db name=&quot;&quot;&gt;&quot; requested by the login. The login failed.&lt;/db&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Just follow these simple steps to solve the problem.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;;&quot;&gt;1. Open SQL Server Management Studio.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzSdxB8TwV_631ax7ojU8xxvN7q2t6wvppx8za2GAkcoWUVnoL2BtrkiLGPDWv_C-Kpf8ujI8JfgX059iLcvuQXbikulAy3P9eJdS2tHzvSMC_C-F1g40gJRtx9b8YquriGABGKZ6SYTNq/s1600-h/loginfailed1.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; mt=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzSdxB8TwV_631ax7ojU8xxvN7q2t6wvppx8za2GAkcoWUVnoL2BtrkiLGPDWv_C-Kpf8ujI8JfgX059iLcvuQXbikulAy3P9eJdS2tHzvSMC_C-F1g40gJRtx9b8YquriGABGKZ6SYTNq/s320/loginfailed1.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;2. On the left menu, expand &lt;strong&gt;Security&lt;/strong&gt; then &lt;strong&gt;Logins&lt;/strong&gt;. Check if &lt;strong&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&#39;NT AUTHORITY\IUSR&#39;&lt;/span&gt;&lt;/strong&gt; exists. If not then that is the cause of the problem.&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjopyHvyhAKyzrDnip6VT7G8BkR0zOc2ofQT_1Gl5BQb_PXgCUHAWpwGV6FpRixc6nHHKlQY90EdirK16TA4vqLmyx2WHutCaHIGk3mFAzAHjfTADSgVSn2lc4gyKGaWtcqyCFHDrQj2qtv/s1600-h/loginfailed2.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; mt=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjopyHvyhAKyzrDnip6VT7G8BkR0zOc2ofQT_1Gl5BQb_PXgCUHAWpwGV6FpRixc6nHHKlQY90EdirK16TA4vqLmyx2WHutCaHIGk3mFAzAHjfTADSgVSn2lc4gyKGaWtcqyCFHDrQj2qtv/s320/loginfailed2.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;3&lt;/span&gt;. Right-click on &lt;strong&gt;Logins&lt;/strong&gt; then&amp;nbsp;click&amp;nbsp;&lt;strong&gt;New Login...&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhj-s1xo7AZqzwLrWQZ-0sA8tGc92GcqookVs99Lf2sAMRvMe_1xZtosLNh5mGLCtAPpl2jH3R2DcSXci2MjoMCpFy8UslMbhHEBxaGZOF5v2p4ZGtH4fU-EI1g_Y6Typnu3c7fBiQlzsBO/s1600-h/loginfailed3.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; mt=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhj-s1xo7AZqzwLrWQZ-0sA8tGc92GcqookVs99Lf2sAMRvMe_1xZtosLNh5mGLCtAPpl2jH3R2DcSXci2MjoMCpFy8UslMbhHEBxaGZOF5v2p4ZGtH4fU-EI1g_Y6Typnu3c7fBiQlzsBO/s320/loginfailed3.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;4. On the &lt;strong&gt;General&lt;/strong&gt; page, click &lt;strong&gt;Search...&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtkEwMU_mcDdiMNYAyqjwPllDI6-Wcrhjl5GlHWeXfCrLEzABLFAhL4ctR5kfMgq3YEGzfzDk-_NTugqqV6YgmSbBQ5h65i-73TR7dpY9fWj6HvGuURa1x1vf_0UlgeIcrfBD_NMSYFIGv/s1600-h/loginfailed4.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;574&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtkEwMU_mcDdiMNYAyqjwPllDI6-Wcrhjl5GlHWeXfCrLEzABLFAhL4ctR5kfMgq3YEGzfzDk-_NTugqqV6YgmSbBQ5h65i-73TR7dpY9fWj6HvGuURa1x1vf_0UlgeIcrfBD_NMSYFIGv/s640/loginfailed4.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;5. On the next popup window, click &lt;strong&gt;Advanced...&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5PspYXu26N3kgWbQ4HNyx8y3LG4Wi9242SrC8RIlqDuUuolEsEvAR2Gilm4ZxI5k37FYR8EZO4p_Srdyqz4F_t2CTt48xpRrnEbOQUvj-4ANlh0g5vI2CB7gjnQ1MiJk1VDRnXVKtlDuK/s1600-h/loginfailed5.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;218&quot; mt=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5PspYXu26N3kgWbQ4HNyx8y3LG4Wi9242SrC8RIlqDuUuolEsEvAR2Gilm4ZxI5k37FYR8EZO4p_Srdyqz4F_t2CTt48xpRrnEbOQUvj-4ANlh0g5vI2CB7gjnQ1MiJk1VDRnXVKtlDuK/s400/loginfailed5.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;6. Then on the following window, click &lt;strong&gt;Find Now&lt;/strong&gt; and find &lt;strong&gt;&lt;span style=&quot;color: #990000;&quot;&gt;IUSR&lt;/span&gt;&lt;/strong&gt; on the&amp;nbsp;Search Results. Then click &lt;strong&gt;OK&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2S8vkGoOILxQ3T72VktDi0Nx_al1Pit_BXntgFNQAhIImyCvRzFQxdLtesL5WR6RMBhmQ0Uqf7jONf16F2af3tkXBAqUi9g4q0Pp7b7WhkknF5AI4Js2jCkmHwjGx9dJqH7zbzpNRhX4D/s1600-h/loginfailed6.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;333&quot; mt=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2S8vkGoOILxQ3T72VktDi0Nx_al1Pit_BXntgFNQAhIImyCvRzFQxdLtesL5WR6RMBhmQ0Uqf7jONf16F2af3tkXBAqUi9g4q0Pp7b7WhkknF5AI4Js2jCkmHwjGx9dJqH7zbzpNRhX4D/s400/loginfailed6.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;7. Back on the left menu, you&#39;ll now see the&amp;nbsp;&lt;strong&gt;&#39;NT AUTHORITY\IUSR&#39;&lt;/strong&gt; user. Right click on it and click &lt;strong&gt;Properties&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifP76rgTV4Nvd6ruvmMPmA-SjFF5g3MX4dZLW8-4-vtv6KNjFgB7xE06imTRRbNvoUZ2VsEAEEfyDFZxNOl74UTbdSqZ3mbWOSAhqOTFzzNYncdv5vMm6aoyAexS_D9_C4g0Td6yDueYZB/s1600-h/loginfailed7.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; mt=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifP76rgTV4Nvd6ruvmMPmA-SjFF5g3MX4dZLW8-4-vtv6KNjFgB7xE06imTRRbNvoUZ2VsEAEEfyDFZxNOl74UTbdSqZ3mbWOSAhqOTFzzNYncdv5vMm6aoyAexS_D9_C4g0Td6yDueYZB/s320/loginfailed7.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;8. On the &lt;strong&gt;Server Roles&lt;/strong&gt; page, check on &lt;strong&gt;sysadmin&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEip0XyBo1CZxMCxe3q3zj6OyH2R6Hm6pjDJfT61G9jrS6AllBdWuxNJy9iz4T9xLF8MYB1BNW_eoGXlEguD1Qe6Bgj1RRj73_THRUc5SR53UMw1qSE0CZ49s8wyZeziHR0CcPBWNf4bLYyx/s1600-h/loginfailed8.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;215&quot; mt=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEip0XyBo1CZxMCxe3q3zj6OyH2R6Hm6pjDJfT61G9jrS6AllBdWuxNJy9iz4T9xLF8MYB1BNW_eoGXlEguD1Qe6Bgj1RRj73_THRUc5SR53UMw1qSE0CZ49s8wyZeziHR0CcPBWNf4bLYyx/s400/loginfailed8.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;9. Then on the &lt;strong&gt;User Mapping&lt;/strong&gt; page check on the database name you need access to; and below that on the database role membership make sure to also check on &lt;strong&gt;db_owner&lt;/strong&gt; then click OK.&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxMVMPYKui-TL0mHWugScukJ0y6GkzeQMXts9Mb2zl-C8iUex4ozoHACLjCXNhQA_lzsqYPCzznToT9n5myQI9dQ3sEcM365nonKG-MqmOdzndOPsmcPx098go6GCHVPfc1sB5NZCi_qTd/s1600-h/loginfailed9.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;572&quot; mt=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxMVMPYKui-TL0mHWugScukJ0y6GkzeQMXts9Mb2zl-C8iUex4ozoHACLjCXNhQA_lzsqYPCzznToT9n5myQI9dQ3sEcM365nonKG-MqmOdzndOPsmcPx098go6GCHVPfc1sB5NZCi_qTd/s640/loginfailed9.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;;&quot;&gt;...And that&#39;s a wrap, you shouldn&#39;t be seeing the login failed error now.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;;&quot;&gt;-k&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/754048859843607692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingresource.blogspot.com/2010/01/login-failed-for-user-nt-authorityiusr.html#comment-form' title='69 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/754048859843607692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/754048859843607692'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/2010/01/login-failed-for-user-nt-authorityiusr.html' title='Login failed for user &#39;NT AUTHORITY\IUSR&#39;'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzSdxB8TwV_631ax7ojU8xxvN7q2t6wvppx8za2GAkcoWUVnoL2BtrkiLGPDWv_C-Kpf8ujI8JfgX059iLcvuQXbikulAy3P9eJdS2tHzvSMC_C-F1g40gJRtx9b8YquriGABGKZ6SYTNq/s72-c/loginfailed1.png" height="72" width="72"/><thr:total>69</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6407056434887736567.post-2604986602393493982</id><published>2010-01-22T18:38:00.000-08:00</published><updated>2010-01-22T18:38:20.928-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cross-browser compatibility"/><category scheme="http://www.blogger.com/atom/ns#" term="ie6"/><category scheme="http://www.blogger.com/atom/ns#" term="ie7"/><category scheme="http://www.blogger.com/atom/ns#" term="ie8"/><category scheme="http://www.blogger.com/atom/ns#" term="ietester"/><category scheme="http://www.blogger.com/atom/ns#" term="internet explorer"/><category scheme="http://www.blogger.com/atom/ns#" term="my-debugbar"/><category scheme="http://www.blogger.com/atom/ns#" term="vista"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><category scheme="http://www.blogger.com/atom/ns#" term="windows 7"/><category scheme="http://www.blogger.com/atom/ns#" term="xp"/><title type='text'>Internet Explorer 6 for Windows Vista / Windows 7</title><content type='html'>&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;If you&#39;re running on Vista or Windows 7 it&#39;s sure you&#39;re IE browser is already IE7 or IE8, but suppose you&#39;re developing for clients who will still use the &quot;buggy&quot; IE6 (so it simply means you have to develop sites which takes those bugs into consideration), one way is to install a Virtual Machine on your PC that will run Windows XP which will surely use much of your PC&#39;s resources (hard drive space and memory). The other is this program I found called &lt;strong&gt;IETester&lt;/strong&gt;. Check it out &lt;a href=&quot;http://www.my-debugbar.com/wiki/IETester/HomePage&quot;&gt;here&lt;/a&gt;&lt;span style=&quot;color: black;&quot;&gt;. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJEcK6zdKB_d98aHrj9VuxQX38v2vaAyy-SNfkKj26iJlpuLzHxgWmNIekCs4OwBj2linq-G3I6UvsBqXBKlEMvw60O_0tMAod0ykNP604zz1dklMSWKgBokokRVuR2fPf-Ib1jIaUGXpx/s1600-h/ietester.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;371&quot; mt=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJEcK6zdKB_d98aHrj9VuxQX38v2vaAyy-SNfkKj26iJlpuLzHxgWmNIekCs4OwBj2linq-G3I6UvsBqXBKlEMvw60O_0tMAod0ykNP604zz1dklMSWKgBokokRVuR2fPf-Ib1jIaUGXpx/s640/ietester.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Trebuchet MS;&quot;&gt;It&#39;s still an alpha release so there might be bugs here and there but it will only take you a minute to download its 25mb filesize and it&#39;s free. Now you can live with those cross-browser compatibility issues all over&amp;nbsp;again,&amp;nbsp;one of those&amp;nbsp;I will be tackling on my next post so keep tuned.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Trebuchet MS;&quot;&gt;-k&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/2604986602393493982/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingresource.blogspot.com/2010/01/internet-explorer-6-for-windows-vista.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/2604986602393493982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/2604986602393493982'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/2010/01/internet-explorer-6-for-windows-vista.html' title='Internet Explorer 6 for Windows Vista / Windows 7'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJEcK6zdKB_d98aHrj9VuxQX38v2vaAyy-SNfkKj26iJlpuLzHxgWmNIekCs4OwBj2linq-G3I6UvsBqXBKlEMvw60O_0tMAod0ykNP604zz1dklMSWKgBokokRVuR2fPf-Ib1jIaUGXpx/s72-c/ietester.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6407056434887736567.post-6331271933868169500</id><published>2010-01-22T07:53:00.000-08:00</published><updated>2010-01-22T07:56:49.087-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="button"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="controls"/><category scheme="http://www.blogger.com/atom/ns#" term="events"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="onblur"/><category scheme="http://www.blogger.com/atom/ns#" term="onfocus"/><category scheme="http://www.blogger.com/atom/ns#" term="textbox"/><category scheme="http://www.blogger.com/atom/ns#" term="w3schools"/><title type='text'>How to use events like onblur, onfocus, etc. for ASP.NET Texbox and other controls</title><content type='html'>&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;Have you ever wondered if you can use other event attributes for some ASP.NET controls, say an ASP.NET Textbox?&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfyFrX5xxV1xnLrSq-zsc2yVO6G-E2DmX-H0Bo82ZSpNPYkIiIRHSxWFjj1rzzxZ5-7Uf-4HoXxvuLf6SHoLeSFg44WyvqTmj8-ikNsYS8pVqOjPrJrz9P-9IEqCEqpl6xoBSRArUUuST-/s1600-h/textboxevents.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;264&quot; mt=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfyFrX5xxV1xnLrSq-zsc2yVO6G-E2DmX-H0Bo82ZSpNPYkIiIRHSxWFjj1rzzxZ5-7Uf-4HoXxvuLf6SHoLeSFg44WyvqTmj8-ikNsYS8pVqOjPrJrz9P-9IEqCEqpl6xoBSRArUUuST-/s640/textboxevents.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;When upon checking, all you see that&#39;s available is a &lt;strong&gt;TextChanged&lt;/strong&gt; event. And you know that the html input tag can&amp;nbsp;support other events like:&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGSoH0D0UmDk0BN6CLZf1hWQbtdk6tcINkM1KaYo5Yj2kptSlEY89sn7Pi_vh6CdH9HFEsK6H27IwcNB9yRwj1DHMKap72VqfJ9TPz5cYZ8QJBRBQlhv_aVFp0fObaibPtdEz9IM2lzyKo/s1600-h/textboxevents2.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;432&quot; mt=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGSoH0D0UmDk0BN6CLZf1hWQbtdk6tcINkM1KaYo5Yj2kptSlEY89sn7Pi_vh6CdH9HFEsK6H27IwcNB9yRwj1DHMKap72VqfJ9TPz5cYZ8QJBRBQlhv_aVFp0fObaibPtdEz9IM2lzyKo/s640/textboxevents2.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Trebuchet MS;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;Source: &lt;a href=&quot;http://www.w3schools.com/TAGS/tag_input.asp&quot;&gt;w3schools&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Trebuchet MS;&quot;&gt;A workaround is to create an ASP.NET Button and place it inside a hidden div:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;div&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;style&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;display&lt;/span&gt;: &lt;span style=&quot;color: blue;&quot;&gt;none&lt;/span&gt;;&lt;span style=&quot;color: blue;&quot;&gt;&quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;asp&lt;/span&gt;:&lt;span style=&quot;color: red;&quot;&gt;Button&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;btnTextBoxEventHandler&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;server&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OnClick&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;btnTextBoxEventHandler_Click&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: Courier New;&quot;&gt;&lt;/span&gt;&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: Courier New;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;And here&#39;s the markup for&amp;nbsp;the textbox, just a regular one:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;asp&lt;/span&gt;:&lt;span style=&quot;color: red;&quot;&gt;Textbox&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;txt1&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;Now on your page onload event, add an attribute to your textbox:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;protected void&lt;/span&gt; Page_Load(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, &lt;span style=&quot;color: #134f5c;&quot;&gt;EventArgs&lt;/span&gt; e)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; txt1.Attributes.Add(&lt;span style=&quot;color: #990000;&quot;&gt;&quot;onblur&quot;&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.Page.ClientScript.GetPostBackEventReference(&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.btnTextBoxEventHandler, &lt;span style=&quot;color: #990000;&quot;&gt;&quot;&quot;&lt;/span&gt;));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;Then of course, the event handler for the button:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Trebuchet MS;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;protected void&lt;/span&gt; btnTextBoxEventHandler_Click(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, &lt;span style=&quot;color: #134f5c;&quot;&gt;EventArgs&lt;/span&gt; e)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Trebuchet MS;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;//Place code here for onblur..&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Trebuchet MS;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Trebuchet MS;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;&quot;&gt;Now place the code you want to trigger (when the textbox loses focus) inside the button event and see what happens. Try experimenting with other event attributes and ASP.NET control combinations too.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Trebuchet MS;&quot;&gt;-k&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/6331271933868169500/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingresource.blogspot.com/2010/01/how-to-use-events-like-onblur-onfocus.html#comment-form' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/6331271933868169500'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/6331271933868169500'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/2010/01/how-to-use-events-like-onblur-onfocus.html' title='How to use events like onblur, onfocus, etc. for ASP.NET Texbox and other controls'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfyFrX5xxV1xnLrSq-zsc2yVO6G-E2DmX-H0Bo82ZSpNPYkIiIRHSxWFjj1rzzxZ5-7Uf-4HoXxvuLf6SHoLeSFg44WyvqTmj8-ikNsYS8pVqOjPrJrz9P-9IEqCEqpl6xoBSRArUUuST-/s72-c/textboxevents.png" height="72" width="72"/><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6407056434887736567.post-2118258020265525559</id><published>2010-01-21T22:36:00.000-08:00</published><updated>2010-01-21T22:36:12.072-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="line numbers"/><category scheme="http://www.blogger.com/atom/ns#" term="visual studio"/><title type='text'>Visual Studio Line Numbers</title><content type='html'>&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Ever wondered why errors in Visual Studio show you line numbers where it occured yet upon checking back on your code you found none? That is because by default, on installation of Visual Studio, line numbers are disabled. To enable it simply go to menu then tools then options.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGpUEqJF8amQUYuUY90UPkNaDH7KGQ8grOLRi4bYV9baBXXLtc0vuTTN44fStlMMezRJgwEKThpmwutLycQy-YO1q0j7HEIKobhjgzbUFuJpgCbiOGfuboIE2VVDzpwgKOQcUK7X9H4RJC/s1600-h/linenumbers1.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGpUEqJF8amQUYuUY90UPkNaDH7KGQ8grOLRi4bYV9baBXXLtc0vuTTN44fStlMMezRJgwEKThpmwutLycQy-YO1q0j7HEIKobhjgzbUFuJpgCbiOGfuboIE2VVDzpwgKOQcUK7X9H4RJC/s400/linenumbers1.PNG&quot; width=&quot;215&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Once the options window pop up, expand on Text Editor and select the&amp;nbsp;language&amp;nbsp;you want to show line numbers and simply click the checkbox &quot;Line numbers&quot;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJg7WjpLyXw4CmhNisq7dWt82WvJFbFj8RMq_suZzhTU9oux2cm87IvDwG5b0GbrZlwOxQS5z5KATdO8X-hFIsHCJkDl5sB3aQZxR0vTqv9PX94bZl9pvNSuO6fPUmRUJrrvoWMFKCVvkW/s1600-h/linenumbers2.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;379&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJg7WjpLyXw4CmhNisq7dWt82WvJFbFj8RMq_suZzhTU9oux2cm87IvDwG5b0GbrZlwOxQS5z5KATdO8X-hFIsHCJkDl5sB3aQZxR0vTqv9PX94bZl9pvNSuO6fPUmRUJrrvoWMFKCVvkW/s640/linenumbers2.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;You can do this to other&amp;nbsp;languages&amp;nbsp;you want, better if you do it on all.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHAzEVvotbnb39Fmo8z_4eOdM9ejTMfqpczPXaslU-OauDuVLcdm07sQHNGyYM6Fen21MMbGtIJs74brAd88l6DB2WJ5QBdWD0GJGqGb-WXSYz-2BuMrzumkFAdfBZT3TdyhLrhnX9PPP_/s1600-h/linenumbers3.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHAzEVvotbnb39Fmo8z_4eOdM9ejTMfqpczPXaslU-OauDuVLcdm07sQHNGyYM6Fen21MMbGtIJs74brAd88l6DB2WJ5QBdWD0GJGqGb-WXSYz-2BuMrzumkFAdfBZT3TdyhLrhnX9PPP_/s320/linenumbers3.PNG&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;That&#39;s it, the only thing I&#39;ve been wondering is why Microsoft opted to disable it by default when we all know that line numbers are important for debugging..&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;-k&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/2118258020265525559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingresource.blogspot.com/2010/01/visual-studio-line-numbers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/2118258020265525559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/2118258020265525559'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/2010/01/visual-studio-line-numbers.html' title='Visual Studio Line Numbers'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGpUEqJF8amQUYuUY90UPkNaDH7KGQ8grOLRi4bYV9baBXXLtc0vuTTN44fStlMMezRJgwEKThpmwutLycQy-YO1q0j7HEIKobhjgzbUFuJpgCbiOGfuboIE2VVDzpwgKOQcUK7X9H4RJC/s72-c/linenumbers1.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6407056434887736567.post-3639264811916429825</id><published>2010-01-21T21:53:00.000-08:00</published><updated>2010-01-21T21:57:49.602-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="activex"/><category scheme="http://www.blogger.com/atom/ns#" term="cpu id"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><title type='text'>Get Client CPU ID with Javascript</title><content type='html'>&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;For whatever purpose it may serve, here&#39;s how to get the client CPU ID through javascript. Just a warning though, this script uses ActiveX object which is disabled by default on browsers and I&#39;m not sure if you can enable it on non-IE. So for now we&#39;ll just do it with Internet Explorer.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Go to Tools then Internet Options.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqI83RqbV-SJKZWN44Uzk6rILmTlAqA3Hf5bFnfxkQA8HaDMFSh1uVO_T_12NF5UUil7Fo1dBGrt_MmQvkgavZBmooSf0V2Fs62mNT7lN24Q837XY2wQyS4wAFx94Z7ErpBBaINp6VPIv4/s1600-h/cpuid1.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqI83RqbV-SJKZWN44Uzk6rILmTlAqA3Hf5bFnfxkQA8HaDMFSh1uVO_T_12NF5UUil7Fo1dBGrt_MmQvkgavZBmooSf0V2Fs62mNT7lN24Q837XY2wQyS4wAFx94Z7ErpBBaINp6VPIv4/s400/cpuid1.PNG&quot; width=&quot;352&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Then on the &lt;b&gt;Security &lt;/b&gt;tab click on &quot;Custom Level...&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlZhz829NYLOcKe0ujMqPQu68IQLoavMhwY0MRPjX8XBT0FCQSAcLwsIJfFBYkrUoyJp2KLiCP0w6cRo6uhlPzFstHcX51SN3YkvJtfYlm6MTI4lazQMueb_U8yN1pkr1VH76e-A8E36Hu/s1600-h/cpuid2.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlZhz829NYLOcKe0ujMqPQu68IQLoavMhwY0MRPjX8XBT0FCQSAcLwsIJfFBYkrUoyJp2KLiCP0w6cRo6uhlPzFstHcX51SN3YkvJtfYlm6MTI4lazQMueb_U8yN1pkr1VH76e-A8E36Hu/s400/cpuid2.PNG&quot; width=&quot;342&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Go down until you see &quot;Initialize and script ActiveX controls not marked as safe...&quot; and &lt;b&gt;enable &lt;/b&gt;it then click Ok. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Now we go to the scripting part. Add this next snippet in your html page.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;script &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;text/javascript&quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;var &lt;span style=&quot;color: black;&quot;&gt;str = &lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;var &lt;span style=&quot;color: black;&quot;&gt;wmi = GetObject(&lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;&quot;winmgmts:{impersonationLevel=impersonate}&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;e = &lt;/span&gt;new &lt;span style=&quot;color: black;&quot;&gt;Enumerator(wmi.InstancesOf(&lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;&quot;Win32_Processor&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;for&lt;span style=&quot;color: black;&quot;&gt;(; !e.atEnd(); e.moveNext()) {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;var &lt;span style=&quot;color: black;&quot;&gt;s = e.item();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;str = s.ProcessorID;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;span style=&quot;color: #4c1130;&quot;&gt;script&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
You can add the script above anywhere on your html head or body, but if you chose to put it on the body be sure to place it anywhere above this next snippet, which just displays the CPU ID in the page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;b&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;Client CPU ID : &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;b&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;span &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;spanCPUID&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;script&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;text/javascript&quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;document.getElementById(&lt;span style=&quot;color: #4c1130;&quot;&gt;&quot;spanCPUID&quot;&lt;/span&gt;).innerHTML = str;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;lt;/&lt;span style=&quot;color: #4c1130;&quot;&gt;script&lt;/span&gt;&amp;gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;script type=&quot;text/javascript&quot;&gt;
&lt;/font&gt;&lt;/p&gt;&lt;p&gt;

&lt;font class=&quot;Apple-style-span&quot; face=&quot;&#39;Courier New&#39;, Courier, monospace&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;document.getElementById(&quot;divCPU2&quot;).innerHTML = str;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;

&lt;font class=&quot;Apple-style-span&quot; face=&quot;&#39;Courier New&#39;, Courier, monospace&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;/script&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;And that&#39;s it, you should now see the client computer&#39;s cpu id when you run the page.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;-k&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingresource.blogspot.com/feeds/3639264811916429825/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingresource.blogspot.com/2010/01/get-client-cpu-id-with-javascript.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/3639264811916429825'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6407056434887736567/posts/default/3639264811916429825'/><link rel='alternate' type='text/html' href='http://codingresource.blogspot.com/2010/01/get-client-cpu-id-with-javascript.html' title='Get Client CPU ID with Javascript'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqI83RqbV-SJKZWN44Uzk6rILmTlAqA3Hf5bFnfxkQA8HaDMFSh1uVO_T_12NF5UUil7Fo1dBGrt_MmQvkgavZBmooSf0V2Fs62mNT7lN24Q837XY2wQyS4wAFx94Z7ErpBBaINp6VPIv4/s72-c/cpuid1.PNG" height="72" width="72"/><thr:total>7</thr:total></entry></feed>