Listbox is overlapping the Textbox in Asp.net

S

santel

Hi All,

Is it not possible to overlap the listbox with other controls. I wanna
place the Textbox above the Listbox. I searched many groups but
couldn't get the answer. Any suggestions please.
 
C

Christopher Reed

To put one control on top of another, you will need to use CSS and set the
Position attribute to Absolute for your control. You may also need to use
the Z-Order attribute as well.
 
S

santel

Thanks for your reply.

I tried all. But the listbox is overlapping the textbox. I want the
Textbox to be displayed on top
 
C

Christopher Reed

Try this:

<asp:TextBox id="txtOne" runat="server"
style="position:absolute;left:2in;top:2in;width:2in;height:2in;z-index:1"
/>
<asp:ListBox id="lstOne" runat="server"
style="position:absolute;left:2in;top:2in;width:2in;height:2in;z-index:2"
/>
 
S

santel

Thanks for your effort.

I tried this. But i can see only listbox. Textbox goes under the
Listbox. But I want is vice versa.
 
A

addup

Chris: You meant to have the z order of the textbox GREATER than that
of the listbox

Santel: This will work fine in the "modern" browsers (Gekko, KHTML
etc.) but will *NOT* work in IE

It's a well-known problem with IE. Refer to the KB article 177378
http://support.microsoft.com/default.aspx?scid=kb;en-us;177378

my pet hack to fix this is to clide an IFRAME between the listbox and
the textbox

Hope this helps
-- addup --
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,144
Latest member
KetoBaseReviews
Top