Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hyberlink control align problem

Status
Not open for further replies.

Crazyec

Programmer
Joined
Aug 28, 2001
Messages
80
Location
HK
Hi, I have make a HyperLink control to a form and use a image to be a button, like the following,

Script Part:
Sub Page_Load(Sender As Object, E as EventArgs)
hlEndDate.NavigateUrl = "Javascript:pickDate('" & txtEndDate.ClientID & "')"
end sub

HTML Part:
<td valign="center">
<asp:HyperLink id="hlEndDate" tabIndex="1" runat="server" ImageUrl="Images\date-picker.gif"></asp:HyperLink>
&nbsp;<asp:TextBox id="txtEndDate" runat="server" Width="80" CssClass="textbox"></asp:TextBox>
<asp:button id="cmdSearch" tabIndex="3" runat="server" Width="70px" ForeColor="White" BackColor="Gray" Font-Bold="True" Font-Names="Verdana" Font-Size="X-Small" Text="Search"></asp:button>
&nbsp;
</td>

The problem I found , I cannot align with the controls, and texts in the same cell.
I have tried to used imagebutton. It is good for alignment, as it has property to set. But it will do postback when everytime I click it.

Any solution on this problem?
 
put another table inside the <td>? tables are best for aligning. or u could use the GridView way (floating controls)...

Known is handfull, Unknown is worldfull
 
Thanks for your advise, after tried, it can't
I think the problem is the control is not align by the cell property. It still move higher than other controls, text in the cell.
 
I think maybe you need to use CSS. I am no expert on it, but I sure someone on here can help you. Aliging in a table can be tedious.

Jim
 
Thanks, Jim.

Yes, I think I need use css on this. But I have no idea how to do. Hope the css experts in here can help me.

 
My final solution is to give the other controls in the same cell a style

<color blue>VERTICAL-ALIGN: top;</color>

and the TD also valign on Top

so everything are align on top.

Thank you everybody.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top