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

<channel>
	<title>dotnet thoughts &#187; HTML</title>
	<atom:link href="http://www.dotnetthoughts.net/tag/html/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dotnetthoughts.net</link>
	<description>a dotnet developer&#039;s technical blog</description>
	<lastBuildDate>Wed, 08 Feb 2012 03:18:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ASP.Net Default button and Master Pages</title>
		<link>http://www.dotnetthoughts.net/2010/06/21/asp-net-default-button-and-master-pages/</link>
		<comments>http://www.dotnetthoughts.net/2010/06/21/asp-net-default-button-and-master-pages/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 07:33:34 +0000</pubDate>
		<dc:creator>Anuraj P</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[.Net 3.0 / 3.5]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[BackToBasics]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[C#.Net]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://www.dotnetthoughts.net/?p=908</guid>
		<description><![CDATA[Last few days I was(am) busy with one pure ASP.Net application(why its pure because we are not using any 3rd party controls, ajax nothing. Everything is postbacking ). Today I got a weird bug from one of my QC team &#8230; <a href="http://www.dotnetthoughts.net/2010/06/21/asp-net-default-button-and-master-pages/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Last few days I was(am) busy with one pure ASP.Net application(why its pure because we are not using any 3rd party controls, ajax nothing. Everything is postbacking <img src='http://www.dotnetthoughts.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ). Today I got a weird bug from one of my QC team saying when ever they presses ENTER button, focus is on any textbox, it popups Help window from our application. In our application, end users can open the Help window, by clicking on some help images icons provided in the application. These images are displayed using ASP Image button controls (If you are using ASP Image controls this problem will not occur, but in our application, we need to disable it some scenarios, so can&#8217;t use ASP Image). After searching I found the issue with the default button property of ASP.Net, which helps us to submit the form using Enter Key. In my page ASP.Net considering the Help image button as default button for the Page. We can set the default button to our submit button using various methods. Set the default button property of the FORM, or create a Panel control over the controls and set the default button property of the Panel.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;form id=&quot;form1&quot; runat=&quot;server&quot; defaultbutton=&quot;cmdSubmit&quot;&gt;
&lt;asp:Panel runat=&quot;server&quot; ID=&quot;plMain&quot; DefaultButton=&quot;cmdSubmit&quot;&gt;
</pre>
<p>Form tag also supports  &#8220;defaultfocus&#8221; this property allows to focus to control, on Page Load.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;form id=&quot;form1&quot; runat=&quot;server&quot; defaultbutton=&quot;cmdSubmit&quot; defaultfocus=&quot;txtUser&quot;&gt;
</pre>
<p>If you are using Master Pages, there will be some slight difference because, the Form tag will not be available in the content Pages. It can fix using code behind, using FindControl method.</p>
<pre class="brush: csharp; title: ; notranslate">
(Page.Master.FindControl(&quot;Form1&quot;) as HtmlForm).DefaultButton = this.cmdSubmit.UniqueID;
</pre>
<p>Also you can do something like this</p>
<pre class="brush: csharp; title: ; notranslate">
Page.Master.Page.Form.DefaultButton = cmdSubmit.UniqueID;
</pre>
<p>Happy Coding <img src='http://www.dotnetthoughts.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="betterrelated"><p><strong>Related content:</strong></p>
<ol><li> <a href="http://www.dotnetthoughts.net/2009/10/07/how-to-store-and-retrieve-files-from-sql-server-database/" title="Permanent link to How to Store and Retrieve files from SQL Server Database">How to Store and Retrieve files from SQL Server Database</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2010/03/30/using-custom-controls-from-app_code-folder/" title="Permanent link to Using custom controls from App_Code folder">Using custom controls from App_Code folder</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2008/10/08/control-focus-with-postback/" title="Permanent link to Control focus with Postback">Control focus with Postback</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2011/11/15/how-to-persist-checkbox-state-in-gridview-while-paging/" title="Permanent link to How to persist checkbox state in gridview while paging">How to persist checkbox state in gridview while paging</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2009/09/11/a-simple-chat-script-using-asp-net-c/" title="Permanent link to A Simple Chat script using ASP.Net C#">A Simple Chat script using ASP.Net C#</a>  </li>
</ol></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotnetthoughts.net/2010/06/21/asp-net-default-button-and-master-pages/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Programmatically submitting a FORM with Javascript</title>
		<link>http://www.dotnetthoughts.net/2007/05/24/programmatically-submitting-a-form-with-javascript/</link>
		<comments>http://www.dotnetthoughts.net/2007/05/24/programmatically-submitting-a-form-with-javascript/#comments</comments>
		<pubDate>Thu, 24 May 2007 04:57:53 +0000</pubDate>
		<dc:creator>Anuraj P</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://anuraj.wordpress.com/2007/05/24/programmatically-submitting-a-form-with-javascript/</guid>
		<description><![CDATA[In asp.net, it allows to create only one &#60;FORM&#62; tag. If you put more than one &#60;FORM&#62; tag it will generate an error. But some times we require multiple form tags and submit buttons. Because &#60;FORM&#62; tag in asp.net always &#8230; <a href="http://www.dotnetthoughts.net/2007/05/24/programmatically-submitting-a-form-with-javascript/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In asp.net, it allows to create only one &lt;FORM&gt; tag. If you put more than one &lt;FORM&gt; tag it will generate an error. But some times we require multiple form tags and submit buttons. Because &lt;FORM&gt; tag in asp.net always submit the form to the page itself.</p>
<p>Here is some code in javascript, it will submit the form using javascript.</p>
<pre class="brush: jscript; title: ; notranslate">
function submitform()
{
document.forms[0].action = &quot;mynewaspxpage.aspx&quot;;
document.forms[0].submit();
}
</pre>
<p>This function will set the action to mynewaspxpage.aspx and submit the form. Normally this option required for submitting forms automatically.</p>
<div class="betterrelated"><p><strong>Related content:</strong></p>
<ol><li> <a href="http://www.dotnetthoughts.net/2010/06/21/asp-net-default-button-and-master-pages/" title="Permanent link to ASP.Net Default button and Master Pages">ASP.Net Default button and Master Pages</a>  </li>
</ol></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotnetthoughts.net/2007/05/24/programmatically-submitting-a-form-with-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clearing combobox items using javascript</title>
		<link>http://www.dotnetthoughts.net/2007/05/23/clearing-combobox-items-using-javascript/</link>
		<comments>http://www.dotnetthoughts.net/2007/05/23/clearing-combobox-items-using-javascript/#comments</comments>
		<pubDate>Wed, 23 May 2007 04:57:11 +0000</pubDate>
		<dc:creator>Anuraj P</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Combobox]]></category>
		<category><![CDATA[Dropdown]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://anuraj.wordpress.com/2007/05/23/clearing-combobox-items-using-javascript/</guid>
		<description><![CDATA[I already posted some code to add and read values from dropdown lists using Javascript. Sometimes we require to reset the items to zero or need to clear the items in the dropdown list. Here is a simple code snippet &#8230; <a href="http://www.dotnetthoughts.net/2007/05/23/clearing-combobox-items-using-javascript/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I already <a href="http://www.dotnetthoughts.net/2007/05/11/adding-and-reading-values-from-combo-box-using-javascript/">posted</a> some code to add and read values from dropdown lists using Javascript. Sometimes we require to reset the items to zero or need to clear the items in the dropdown list. Here is a simple code snippet which will reset the dropdown items.</p>
<pre class="brush: jscript; title: ; notranslate">
function clearDropdown(dropdown)
{
var mycombo =document.getElementById(dropdown);
mycombo.options.length = 0;
return(false);
}
</pre>
<p>And you can use this function like this</p>
<pre class="brush: xml; title: ; notranslate">
&lt;button onclick=&quot;javascript:clearDropdown('myoptions')&quot;&gt;Reset Options&lt;/button&gt;
</pre>
<p>Where myoptions is the dropdown to clear.</p>
<div class="betterrelated"><p><strong>Related content:</strong></p>
<ol><li> <a href="http://www.dotnetthoughts.net/2007/05/11/adding-and-reading-values-from-combo-box-using-javascript/" title="Permanent link to Adding and reading values from combo box using Javascript">Adding and reading values from combo box using Javascript</a>  </li>
</ol></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotnetthoughts.net/2007/05/23/clearing-combobox-items-using-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS list-style-image Property</title>
		<link>http://www.dotnetthoughts.net/2007/05/22/css-list-style-image-property/</link>
		<comments>http://www.dotnetthoughts.net/2007/05/22/css-list-style-image-property/#comments</comments>
		<pubDate>Tue, 22 May 2007 10:42:52 +0000</pubDate>
		<dc:creator>Anuraj P</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://anuraj.wordpress.com/2007/05/22/css-list-style-image-property/</guid>
		<description><![CDATA[If you are using list tags, like OL, LI, UL etc, there is limited control on the UI, like it will render only like 1, disc etc. Sometimes the we require bulletedlists to be look nice. Here is simple way &#8230; <a href="http://www.dotnetthoughts.net/2007/05/22/css-list-style-image-property/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you are using list tags, like OL, LI, UL etc, there is limited control on the UI, like it will render only like 1, disc etc. Sometimes the we require bulletedlists to be look nice. Here is simple way to modifying the OL and UL tags with custom icons. The list-style-image property in CSS used to replace the existing UL and OL tags marker with an Image.</p>
<pre class="brush: css; title: ; notranslate">
ol
{
list-style-image: url(&amp;quot;newImage.gif&amp;quot;);
}
</pre>
<p>And you can change it dynamically using Javascript.</p>
<pre class="brush: jscript; title: ; notranslate">
var links = document.getElementsByTagName(&amp;quot;UL&amp;quot;);
for(var i=0; i &amp;lt;= links.length - 1; i++)
{
links[i].style.listStyleImage=&amp;quot;url(plus.gif)&amp;quot;;
}
</pre>
<p>This code will search all the UL tags and assign images for them.</p>
<div class="betterrelated none"><p>No related content found.</p></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotnetthoughts.net/2007/05/22/css-list-style-image-property/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detect browser name and version</title>
		<link>http://www.dotnetthoughts.net/2007/05/21/detect-browser-name-and-version/</link>
		<comments>http://www.dotnetthoughts.net/2007/05/21/detect-browser-name-and-version/#comments</comments>
		<pubDate>Mon, 21 May 2007 04:05:46 +0000</pubDate>
		<dc:creator>Anuraj P</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://anuraj.wordpress.com/2007/05/21/detect-browser-name-and-version/</guid>
		<description><![CDATA[If your writing cross-browser web applications, it is nessary to detcect Browser name and version. Because some of the javascript code like forms[] and controls[] will not work in all browsers, and document.getElementById() will not work in old version browsers. &#8230; <a href="http://www.dotnetthoughts.net/2007/05/21/detect-browser-name-and-version/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If your writing cross-browser web applications, it is nessary to detcect Browser name and version. Because some of the javascript code like forms[] and controls[] will not work in all browsers, and document.getElementById() will not work in old version browsers.</p>
<p>Here is the code to detect browser name and version.</p>
<pre class="brush: jscript; title: ; notranslate">
var browser=navigator.appName
var version= parseFloat(navigator.appVersion)
alert(&quot;You are running &quot; + browser +&quot; and your browser version is &quot; + version);
</pre>
<p>This will popup an alert box with browser name and version.</p>
<div class="betterrelated none"><p>No related content found.</p></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotnetthoughts.net/2007/05/21/detect-browser-name-and-version/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

