So I was sitting at my desk minding my own business working on a client's website when I needed to integrate some Server Controls into the UI, no big deal.
So I pull the code the designer had used for the mockup and looked it over and came up with this requirement:
I had to replace a text box and an image with a TextBox and an ImageButton. 10 minutes tops.
Well, these 2 particular elements needed to be enclosed within a User Control so the code that had to be dropped into the user control looked like:
Code:
<td width="100"
background="image.gif">
<label>
<div align="center">
<input name="search" type="text" id="search" size="10" />
</div>
</label>
</td>
<td width="42">
<img name="go_button"
src="image.gif" width="42"
height="32" border="0" id="go_button" alt="Go Button" />
</td>
No problem. So I replaced the textbox and image with a TextBox and ImageButton control, saved it, viewed my page and, for some reason, the UI was blown out 2px. >< I narrowed it down to the image button and tried changing all the relevant properties (width, height, etc) to no avail.
Ok. I replaced the image button with an html image button but, again, the UI was blown out 2px. At this point I was mildly frustrated. Unforunately, I couldn't simply wrap the image in an anchor tag as I needed the control to post back and do some processing before I redirected to another page.
Ultimately I ended up doing this:
Code:
<asp:LinkButton ID="lbBtn" runat="server" OnClick="lbBtn_Click">
<img name="go_button" src="image.gif" width="42"
height="32" border="0" id="go_button" alt="Go Button" />
</asp:LinkButton>
So what about the rest of you, any crazy or otherwise odd hacks that you have had to employ to meet a requirement that you would like to share?
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET
Professional IIS 7 and ASP.NET Integrated Programming
================================================== =========