Customizing the search textbox

I have a textbox for searching the site and would like to put the magnifying glass, which by the time now appears beside it, within it like Telerik's website (
This is the code for search Textbox:
<asp:TextBox ID="txtSearch" runat="server" onFocus="if(this.value=='Search...')this.value='';"
            onBlur="if(this.value == '')this.value='Search...';" Text="&nbsp;&nbsp;Search..."
And one of or both of these codes for the magnifying glass, which appears beside the textbox:
<div id="SearchIcon" class="SearchIcon" onclick="document.getElementById('SearchChoices').style.display='block'">
            <asp:Image ID="downArrow" runat="server" ImageUrl="~/images/action.gif" />
<asp:LinkButton ID="cmdSearch" runat="server" CausesValidation="False"></asp:LinkButton>
This is a DotNetNuke site.
Who is Participating?
Christian de BellefeuilleConnect With a Mentor ProgrammerCommented:
As i said, use an ImageButton instead of a LinkButton like this:

    <asp:ImageButton ID="ImageButton1" runat="server" OnClick="CodeBehindFunction"  />

Of course, CodeBehindFunction, is your search code...
Christian de BellefeuilleProgrammerCommented:
I would use an ImageButton instead of a LinkButton.
Christian de BellefeuilleProgrammerCommented:
In fact, if you look at Telerik site, the button is not INSIDE the textbox... it's just at the right of the textbox.  
(Type AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA in the box, you will see what i mean)

They probably use CssClass or Style to make it look like they want.

Here's a Textbox with a strange background under the textbox...  you might give it a try.
<asp:TextBox ID="UserName" runat="server"  style="font-size:larger; color:white; padding-top:13px; text-align:center;background-image:url(/Secure/images/obj_username.jpg);z-index:2; width:188px; height:45px; background-repeat:no-repeat" BackColor="Transparent" BorderWidth="0px" Height="45px" Width="188px"></asp:TextBox>
ihbemd6rbAuthor Commented:
Hello, I know that it is a background image, I also have  such a background image, but it doesn't work on click! On Telerik's website the people click on this background image to search, and it works. But mine does nothing!
ihbemd6rbAuthor Commented:
Good idea! Thanks!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.