By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,375 Members | 1,111 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,375 IT Pros & Developers. It's quick & easy.

hiding groups of data elements on a webform?

P: n/a
MDB
This may sound like a naive question, but that's only because I'm naive
about most things ASP.NET, as my background is primarily Lotus Notes
Development, and before that, DOS-based FoxPro.

Is there a way to group elements, such as a set of textboxes and related
labels, in effect giving them a common group name that could then be used to
disable/enable other elements on the page? For example if I have a
_textChanged event on a textbox that detects an error, it would be lovely to
be able to hide all the other controls on the page, to reinforce the notion
that the user really can't do anything until they fix the error in the
original textbox. I've dealt too often with users who need to be hit over
the head with a sledgehammer like that.

Right now, I see my choices as: 1) putting the controls to be hidden in a
panel and hiding the panel, which is not an ideal solution because it would
involved redesigning the screen; or 2) immediately redirect the user out of
the edit screen back to the main screen, and display a bright red error msg
in my lblErrMsg label telling them what they just did wrong. Both accomplish
the goal of keeping the user from doing anything else on the edit screen,
but only one stays on the edit screen and lets the user correct their
mistake on the spot, rather than starting all over again. Only the spectre
of undoing my work on the editscreen to put fields on a panel is keeping me
from embracing that option.

I'm also open to any and all suggestions, if the answer to my original
question is 'so sorry'. Thanks!

MDBloemker
md********@hotmail.com
Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi,

1) I dont think that hidding control is a good idea from the user point
of view, consider disable control instead of hidding them.

2) for the same resson using panel (<DIV>) to group control is better
idea then redirecting your user to page with description what he is
doing wrong but with no option to fix his mistake. stay in the same page
where error happned, disable all nesesery buttons, display error details
and let your user fix them.

HTH

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2

P: n/a
MDB
I've already been informed by the user that redirecting is out of the
question; if there's an error, they want to correct it immediately.
Disabling all other controls on the page except for the textbox that needs
to be corrected is the way I need to go, but the question remains, does
there exist any other approach to this other than coding each individual as
disabled( Textbox1.enabled = false, DropDown2.enabled = false, 97 lines of
code altogether for 97 controls) in the error event, and then turning
churning through 97 controls to enable them after the error is resolved? I
dimly remember FoxPro having the ability to assign a single group name to
selected controls, towit, say, these five fields and/or dropdowns have the
same group name Group1, so the command to enable or disable or hide only
those particular fields would be along the lines of Group1.enabled = false
(yes, I know that's not FoxPro syntax, but it's been so long since I've
coded in FP that I'm approximating.

(If that functionality doesn't exists in ASP.NET right now, how best might
one go about suggesting it as a future enhancement???)

MDBloemker
md********@hotmail.com
"Natty Gur" <na***@dao2com.com> wrote in message
news:eI**************@TK2MSFTNGP10.phx.gbl...
Hi,

1) I dont think that hidding control is a good idea from the user point
of view, consider disable control instead of hidding them.

2) for the same resson using panel (<DIV>) to group control is better
idea then redirecting your user to page with description what he is
doing wrong but with no option to fix his mistake. stay in the same page
where error happned, disable all nesesery buttons, display error details
and let your user fix them.

HTH

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #3

P: n/a
Hi,

You can just disable buttons (to prevent user from redirecting to other
page or perform any action until all fields with errors changed by
user). you can place buttons on panel and disable the container panel. I
dont familiar with any way to disable groups of control without using
containers.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.