Disabling controls on aspx pages

F

Fred Flintstone

I'm a bit confused about something. I have an aspx page populated
with dynamic controls; textboxes, labels, radios and so on. On the
page is a Yes/No radio combination and 3 textboxes. The textboxes are
visible. If you click the No radio, the textboxes should disappear.
In my code, I'm setting the textbox's Visible property to false.

What happens is, when you click the No radio, the textboxes do
disappear. But I'm left with a blank space on the page equal to the
area the textboxes took up. I took the source of the resultant page
and copied out thie HTML into Dreamweaver to try and see where the
problem is. Well, the textboxes are still there. I assume there's
session data missing that's there when the page is actually generated
that hides the textbox but in essence, it doesn't really disappear.

So I start with this:

Heading
Radios Yes/No
Textbox
Textbox
Textbox

But when no is clicked (postback is performed that sets textboxes
visible to false ) I get:

Heading
Radios Yes/No (No selected)
Blank space
Blank space
Blank space

How do I get this space to disappear?

Thanks!
 
G

Guest

have you tried enclosing the controlls in another control such as a tablecell
or a panel and then setting that to visible=false ?
 
F

Fred Flintstone

That's a thought, I'll see what I can do with that, thanks.

I should also point out that this behavior only occurs with text
boxes. If they were checkboxes, labels, literalcontrols or a
different radio set, the controls and the space they occupy disappear
properly.
 
V

varun

hi
I think u should use javascript in this
What u can u go to html page of aspx page and in textboxes
style="DISPLAY:none"
and then u use javascript that if no is selected then textboxes should
not be displayed and when yes is selected then textboxes should be
displayed.I hope this will solve ur problem .If not then mail me at
(e-mail address removed) and i will send full code to u
bye
varun
 

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,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top