tags:

views:

28

answers:

1

I'm trying my hand in asp.net. I have a dropdown list in my page.There's a button below this dropdown.Both this control are in a panel.

What I'm trying to do is when I select on dropdown list to change the value I want to shift buttons below as in when you go to select dropdown, the list opens and elongates, when this elongates I want to push the button below and when I select an item in dropdown put the buttons back.

+1  A: 

You could probably trap clicks or focus events to move things around on the client side (see http://www.w3schools.com/tags/tag_select.asp for event options) and then show/hide an empty div or something like that, but in general I'd avoid "features" like this. It's a pain to build, it isn't expected behaviour by the user, and it may also be a pain to maintain cross-browser support for.

Without seeing what you're trying to do, it's difficult to say, but I'd recommend there may be some layout options you could look at to get around whatever issue the dropdown is causing.

Kendrick
Hay thanks for your reply.I'm just trying few things with asp.net.I know it's a weird requirement but some fine day I might be asked by client to do this
gizgok
You can register client scripts in ASP.NET, but actually trapping the event and moving the button isn't ASP.NET specific and probably isn't going to help you learn the framework. I'd also tell the client no if they asked for this. Bouncing UI elements around is generally not a good idea, it's confusing to the user and almost always unnecessary.
Kendrick
If you want to work with client side events and extend your knowledge of ASP.NET, take a look at the ASP.NET Toolkit. It's easy to use and when used properly it can greatly improve the end user experience. http://www.asp.net/ajaxlibrary/act.ashx
Kendrick