By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,979 Members | 1,349 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,979 IT Pros & Developers. It's quick & easy.

XHTML validation problem

P: n/a
I've got a site using master pages.

The problem is that although every supposedly is XHTML, the W3C checker
is failing on an image button. The code on the generated web page is:
<code>
<input type="image" name="ctl00$MainContentHolder$btn_quickSearch"
id="ctl00_MainContentHolder_btn_quickSearch" class="QuickSearch"
src="gfx/Search.gif" alt="Do Search"
onclick="javascript:WebForm_DoPostBackWithOptions( new
WebForm_PostBackOptions(&quot;ctl00$MainContentHol der$btn_quickSearch&quot;,
&quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))"
border="0" /></

</code>

Now, obviously the 'border="0"' is the problem.

The ACTUAL code is
<code>
<asp:ImageButton ID="btn_quickSearch" runat="server"
CssClass="QuickSearch" ImageUrl="~/gfx/Search.gif"
OnClick="btn_quickSearch_Click" AlternateText="Do Search"
EnableTheming="False" />
</code>

So, my question is this: how do I get an image button to generate XHTML
compatable code? Because everything I've tried is NOT working.

Any ideas anyone?

Thanks in advance...Dave.

May 21 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You might want to look at this, which shows you how to have your pages
render in XHTML:

http://msdn2.microsoft.com/en-US/library/ms178159.aspx

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Code Monkey" <dl********@gmail.com> wrote in message
news:11**********************@j73g2000cwa.googlegr oups.com...
I've got a site using master pages.

The problem is that although every supposedly is XHTML, the W3C checker
is failing on an image button. The code on the generated web page is:
<code>
<input type="image" name="ctl00$MainContentHolder$btn_quickSearch"
id="ctl00_MainContentHolder_btn_quickSearch" class="QuickSearch"
src="gfx/Search.gif" alt="Do Search"
onclick="javascript:WebForm_DoPostBackWithOptions( new
WebForm_PostBackOptions(&quot;ctl00$MainContentHol der$btn_quickSearch&quot;,
&quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))"
border="0" /></

</code>

Now, obviously the 'border="0"' is the problem.

The ACTUAL code is
<code>
<asp:ImageButton ID="btn_quickSearch" runat="server"
CssClass="QuickSearch" ImageUrl="~/gfx/Search.gif"
OnClick="btn_quickSearch_Click" AlternateText="Do Search"
EnableTheming="False" />
</code>

So, my question is this: how do I get an image button to generate XHTML
compatable code? Because everything I've tried is NOT working.

Any ideas anyone?

Thanks in advance...Dave.

May 21 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.