473,903 Members | 5,463 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Panel Validation

I have a control that simply displays a list of links. Following one of the
links doesn't post back or redirect to another page, it simply hides the
current panel and shows the one you selected... So the behavour is similar to
a tab control.

The user is expected to fill out required data on each of the panels before
pressing a submit button which is visible from all panels.

Problem I have is validating the data entered by the user. I can use built
in validators to actualy do the validation but consider this type of
situation.

The user loads the page and enters some but not all of the data on the first
panel. They then follow the link to the second panel (which sets DISPLAY:none
on the currently visible panel and DISPLAY:block on the new panel using
javascript)

If the user then enters the required data on the second panel and presses
the submit button the validators fire and fail on the first panel but the
user cannot tell because the panel is not visible.

I want to be able to do one of the following:

A) validate a panel as it loses visiblity without a postback. This way the
user must enter the data before they leave the panel. (server side validation
will still occur when the submit button is pressed but the data will already
be known good) This would be the prefered option

b) force the panel with the failed validator to be visible when the server
side validation occurs.

c) display some kind of message on the currently visible panel indicating
that there are failed validators on the first panel so the user is aware and
can correct the problem.

Any ideas would be helpful

--
Bill
Nov 19 '05 #1
9 3194
Bill,

Is there a reason that you can't set the panel's visibility property from
the codebehind after a successful postback?

That way you can do your clientside validation, wrap the button's click
event code in If Page.IsValid, and only switch panels if valid entries are
made.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Bill Long" <Bi******@discu ssions.microsof t.com> wrote in message
news:6E******** *************** ***********@mic rosoft.com...
I have a control that simply displays a list of links. Following one of the
links doesn't post back or redirect to another page, it simply hides the
current panel and shows the one you selected... So the behavour is similar
to
a tab control.

The user is expected to fill out required data on each of the panels
before
pressing a submit button which is visible from all panels.

Problem I have is validating the data entered by the user. I can use built
in validators to actualy do the validation but consider this type of
situation.

The user loads the page and enters some but not all of the data on the
first
panel. They then follow the link to the second panel (which sets
DISPLAY:none
on the currently visible panel and DISPLAY:block on the new panel using
javascript)

If the user then enters the required data on the second panel and presses
the submit button the validators fire and fail on the first panel but the
user cannot tell because the panel is not visible.

I want to be able to do one of the following:

A) validate a panel as it loses visiblity without a postback. This way the
user must enter the data before they leave the panel. (server side
validation
will still occur when the submit button is pressed but the data will
already
be known good) This would be the prefered option

b) force the panel with the failed validator to be visible when the server
side validation occurs.

c) display some kind of message on the currently visible panel indicating
that there are failed validators on the first panel so the user is aware
and
can correct the problem.

Any ideas would be helpful

--
Bill

Nov 19 '05 #2
The reason is performance. Postbacks are not very network friendly. The way
it works now changing panels is instantanious. Using postback slows things
down quite a bit and cause unnessecary network traffic

--
Bill
"S. Justin Gengo" wrote:
Bill,

Is there a reason that you can't set the panel's visibility property from
the codebehind after a successful postback?

That way you can do your clientside validation, wrap the button's click
event code in If Page.IsValid, and only switch panels if valid entries are
made.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Bill Long" <Bi******@discu ssions.microsof t.com> wrote in message
news:6E******** *************** ***********@mic rosoft.com...
I have a control that simply displays a list of links. Following one of the
links doesn't post back or redirect to another page, it simply hides the
current panel and shows the one you selected... So the behavour is similar
to
a tab control.

The user is expected to fill out required data on each of the panels
before
pressing a submit button which is visible from all panels.

Problem I have is validating the data entered by the user. I can use built
in validators to actualy do the validation but consider this type of
situation.

The user loads the page and enters some but not all of the data on the
first
panel. They then follow the link to the second panel (which sets
DISPLAY:none
on the currently visible panel and DISPLAY:block on the new panel using
javascript)

If the user then enters the required data on the second panel and presses
the submit button the validators fire and fail on the first panel but the
user cannot tell because the panel is not visible.

I want to be able to do one of the following:

A) validate a panel as it loses visiblity without a postback. This way the
user must enter the data before they leave the panel. (server side
validation
will still occur when the submit button is pressed but the data will
already
be known good) This would be the prefered option

b) force the panel with the failed validator to be visible when the server
side validation occurs.

c) display some kind of message on the currently visible panel indicating
that there are failed validators on the first panel so the user is aware
and
can correct the problem.

Any ideas would be helpful

--
Bill


Nov 19 '05 #3
Bill,

But the validators will stop a postback clientside so it won't occur for any
browser that supports it. And you say you're posting back anyway upon
successful validation... So at least for the panels that need to be
validated I think that's the best solution.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Bill Long" <Bi******@discu ssions.microsof t.com> wrote in message
news:8C******** *************** ***********@mic rosoft.com...
The reason is performance. Postbacks are not very network friendly. The
way
it works now changing panels is instantanious. Using postback slows things
down quite a bit and cause unnessecary network traffic

--
Bill
"S. Justin Gengo" wrote:
Bill,

Is there a reason that you can't set the panel's visibility property from
the codebehind after a successful postback?

That way you can do your clientside validation, wrap the button's click
event code in If Page.IsValid, and only switch panels if valid entries
are
made.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Bill Long" <Bi******@discu ssions.microsof t.com> wrote in message
news:6E******** *************** ***********@mic rosoft.com...
>I have a control that simply displays a list of links. Following one of
>the
> links doesn't post back or redirect to another page, it simply hides
> the
> current panel and shows the one you selected... So the behavour is
> similar
> to
> a tab control.
>
> The user is expected to fill out required data on each of the panels
> before
> pressing a submit button which is visible from all panels.
>
> Problem I have is validating the data entered by the user. I can use
> built
> in validators to actualy do the validation but consider this type of
> situation.
>
> The user loads the page and enters some but not all of the data on the
> first
> panel. They then follow the link to the second panel (which sets
> DISPLAY:none
> on the currently visible panel and DISPLAY:block on the new panel using
> javascript)
>
> If the user then enters the required data on the second panel and
> presses
> the submit button the validators fire and fail on the first panel but
> the
> user cannot tell because the panel is not visible.
>
> I want to be able to do one of the following:
>
> A) validate a panel as it loses visiblity without a postback. This way
> the
> user must enter the data before they leave the panel. (server side
> validation
> will still occur when the submit button is pressed but the data will
> already
> be known good) This would be the prefered option
>
> b) force the panel with the failed validator to be visible when the
> server
> side validation occurs.
>
> c) display some kind of message on the currently visible panel
> indicating
> that there are failed validators on the first panel so the user is
> aware
> and
> can correct the problem.
>
> Any ideas would be helpful
>
> --
> Bill


Nov 19 '05 #4
Bill,

A different thought if you really don't want to post back until the final
submit button is clicked. I think you'd have to cycle through each validator
and check if it's valid. You could have a subroutine for each panel that
could be called from the submit and it would loop through the validators on
that panel and then if one that isn't valid is found set that panel to
visible. If you try to do this all client side it won't work with a lot of
browsers so you may run into trouble there...
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate. com> wrote in
message news:uF******** ******@TK2MSFTN GP10.phx.gbl...
Bill,

But the validators will stop a postback clientside so it won't occur for
any browser that supports it. And you say you're posting back anyway upon
successful validation... So at least for the panels that need to be
validated I think that's the best solution.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Bill Long" <Bi******@discu ssions.microsof t.com> wrote in message
news:8C******** *************** ***********@mic rosoft.com...
The reason is performance. Postbacks are not very network friendly. The
way
it works now changing panels is instantanious. Using postback slows
things
down quite a bit and cause unnessecary network traffic

--
Bill
"S. Justin Gengo" wrote:
Bill,

Is there a reason that you can't set the panel's visibility property
from
the codebehind after a successful postback?

That way you can do your clientside validation, wrap the button's click
event code in If Page.IsValid, and only switch panels if valid entries
are
made.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Bill Long" <Bi******@discu ssions.microsof t.com> wrote in message
news:6E******** *************** ***********@mic rosoft.com...
>I have a control that simply displays a list of links. Following one of
>the
> links doesn't post back or redirect to another page, it simply hides
> the
> current panel and shows the one you selected... So the behavour is
> similar
> to
> a tab control.
>
> The user is expected to fill out required data on each of the panels
> before
> pressing a submit button which is visible from all panels.
>
> Problem I have is validating the data entered by the user. I can use
> built
> in validators to actualy do the validation but consider this type of
> situation.
>
> The user loads the page and enters some but not all of the data on the
> first
> panel. They then follow the link to the second panel (which sets
> DISPLAY:none
> on the currently visible panel and DISPLAY:block on the new panel
> using
> javascript)
>
> If the user then enters the required data on the second panel and
> presses
> the submit button the validators fire and fail on the first panel but
> the
> user cannot tell because the panel is not visible.
>
> I want to be able to do one of the following:
>
> A) validate a panel as it loses visiblity without a postback. This way
> the
> user must enter the data before they leave the panel. (server side
> validation
> will still occur when the submit button is pressed but the data will
> already
> be known good) This would be the prefered option
>
> b) force the panel with the failed validator to be visible when the
> server
> side validation occurs.
>
> c) display some kind of message on the currently visible panel
> indicating
> that there are failed validators on the first panel so the user is
> aware
> and
> can correct the problem.
>
> Any ideas would be helpful
>
> --
> Bill


Nov 19 '05 #5
This close to what I was thinking. I could have a little piece of javascript
for each panel. When the user clicks to display one of the other panels, I
could loop through each control I want to validate and validate it. If I find
one that fails then leave the panel visible otherwise hide it and display the
one the user selected.

I sort of have this working but it is messy and not really a good solution
becasue I have to have two seperate validation routines for each control I
want to validate. Client side javascript and server side validators. I would
rather do as you suggest and make use of the validators I already have in
place.

I've tried that already and the problem I have with it is this:

Validation doesn't always occur when I change panels. Lets say I have a
panel with a textbox and a required field validator. If I open the page, the
page is valid but the textbox is blank. If I then change to another panel...
no validation. On server side validation this is not true but the client side
validation seems only to occur after a text changed event has occured. IE: I
put some text in the textbox changed then delete it...

Interesting problem... I may have to live with multiple validation routines
for each validated control.

Bill
"S. Justin Gengo" wrote:
Bill,

A different thought if you really don't want to post back until the final
submit button is clicked. I think you'd have to cycle through each validator
and check if it's valid. You could have a subroutine for each panel that
could be called from the submit and it would loop through the validators on
that panel and then if one that isn't valid is found set that panel to
visible. If you try to do this all client side it won't work with a lot of
browsers so you may run into trouble there...
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate. com> wrote in
message news:uF******** ******@TK2MSFTN GP10.phx.gbl...
Bill,

But the validators will stop a postback clientside so it won't occur for
any browser that supports it. And you say you're posting back anyway upon
successful validation... So at least for the panels that need to be
validated I think that's the best solution.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Bill Long" <Bi******@discu ssions.microsof t.com> wrote in message
news:8C******** *************** ***********@mic rosoft.com...
The reason is performance. Postbacks are not very network friendly. The
way
it works now changing panels is instantanious. Using postback slows
things
down quite a bit and cause unnessecary network traffic

--
Bill
"S. Justin Gengo" wrote:

Bill,

Is there a reason that you can't set the panel's visibility property
from
the codebehind after a successful postback?

That way you can do your clientside validation, wrap the button's click
event code in If Page.IsValid, and only switch panels if valid entries
are
made.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Bill Long" <Bi******@discu ssions.microsof t.com> wrote in message
news:6E******** *************** ***********@mic rosoft.com...
>I have a control that simply displays a list of links. Following one of
>the
> links doesn't post back or redirect to another page, it simply hides
> the
> current panel and shows the one you selected... So the behavour is
> similar
> to
> a tab control.
>
> The user is expected to fill out required data on each of the panels
> before
> pressing a submit button which is visible from all panels.
>
> Problem I have is validating the data entered by the user. I can use
> built
> in validators to actualy do the validation but consider this type of
> situation.
>
> The user loads the page and enters some but not all of the data on the
> first
> panel. They then follow the link to the second panel (which sets
> DISPLAY:none
> on the currently visible panel and DISPLAY:block on the new panel
> using
> javascript)
>
> If the user then enters the required data on the second panel and
> presses
> the submit button the validators fire and fail on the first panel but
> the
> user cannot tell because the panel is not visible.
>
> I want to be able to do one of the following:
>
> A) validate a panel as it loses visiblity without a postback. This way
> the
> user must enter the data before they leave the panel. (server side
> validation
> will still occur when the submit button is pressed but the data will
> already
> be known good) This would be the prefered option
>
> b) force the panel with the failed validator to be visible when the
> server
> side validation occurs.
>
> c) display some kind of message on the currently visible panel
> indicating
> that there are failed validators on the first panel so the user is
> aware
> and
> can correct the problem.
>
> Any ideas would be helpful
>
> --
> Bill



Nov 19 '05 #6
Actually when you think about. That's not really a good solution either
because if I load the page, fill out the first panel and then hit the submit
button without selecting one of the links to display another panel validators
on the other panels would fire but not be visible and the user would have no
indication that this occured. I would also have to validate each panel on the
client when the submit button was clicked.

What might work is forget about validating when the panels change but loop
through validators on each panel when the submit button is clicked and
display the first panel I find with a failure. The validators themselves
would prevent the postback. All I have to do is find panel.

Are you a Microsoft employee? Can you point me toward a good knowledge base
article on testing validators with javascript?

--
Bill
"Bill Long" wrote:
This close to what I was thinking. I could have a little piece of javascript
for each panel. When the user clicks to display one of the other panels, I
could loop through each control I want to validate and validate it. If I find
one that fails then leave the panel visible otherwise hide it and display the
one the user selected.

I sort of have this working but it is messy and not really a good solution
becasue I have to have two seperate validation routines for each control I
want to validate. Client side javascript and server side validators. I would
rather do as you suggest and make use of the validators I already have in
place.

I've tried that already and the problem I have with it is this:

Validation doesn't always occur when I change panels. Lets say I have a
panel with a textbox and a required field validator. If I open the page, the
page is valid but the textbox is blank. If I then change to another panel...
no validation. On server side validation this is not true but the client side
validation seems only to occur after a text changed event has occured. IE: I
put some text in the textbox changed then delete it...

Interesting problem... I may have to live with multiple validation routines
for each validated control.

Bill
"S. Justin Gengo" wrote:
Bill,

A different thought if you really don't want to post back until the final
submit button is clicked. I think you'd have to cycle through each validator
and check if it's valid. You could have a subroutine for each panel that
could be called from the submit and it would loop through the validators on
that panel and then if one that isn't valid is found set that panel to
visible. If you try to do this all client side it won't work with a lot of
browsers so you may run into trouble there...
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate. com> wrote in
message news:uF******** ******@TK2MSFTN GP10.phx.gbl...
Bill,

But the validators will stop a postback clientside so it won't occur for
any browser that supports it. And you say you're posting back anyway upon
successful validation... So at least for the panels that need to be
validated I think that's the best solution.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Bill Long" <Bi******@discu ssions.microsof t.com> wrote in message
news:8C******** *************** ***********@mic rosoft.com...
> The reason is performance. Postbacks are not very network friendly. The
> way
> it works now changing panels is instantanious. Using postback slows
> things
> down quite a bit and cause unnessecary network traffic
>
> --
> Bill
>
>
> "S. Justin Gengo" wrote:
>
>> Bill,
>>
>> Is there a reason that you can't set the panel's visibility property
>> from
>> the codebehind after a successful postback?
>>
>> That way you can do your clientside validation, wrap the button's click
>> event code in If Page.IsValid, and only switch panels if valid entries
>> are
>> made.
>>
>> --
>> Sincerely,
>>
>> S. Justin Gengo, MCP
>> Web Developer / Programmer
>>
>> www.aboutfortunate.com
>>
>> "Out of chaos comes order."
>> Nietzsche
>> "Bill Long" <Bi******@discu ssions.microsof t.com> wrote in message
>> news:6E******** *************** ***********@mic rosoft.com...
>> >I have a control that simply displays a list of links. Following one of
>> >the
>> > links doesn't post back or redirect to another page, it simply hides
>> > the
>> > current panel and shows the one you selected... So the behavour is
>> > similar
>> > to
>> > a tab control.
>> >
>> > The user is expected to fill out required data on each of the panels
>> > before
>> > pressing a submit button which is visible from all panels.
>> >
>> > Problem I have is validating the data entered by the user. I can use
>> > built
>> > in validators to actualy do the validation but consider this type of
>> > situation.
>> >
>> > The user loads the page and enters some but not all of the data on the
>> > first
>> > panel. They then follow the link to the second panel (which sets
>> > DISPLAY:none
>> > on the currently visible panel and DISPLAY:block on the new panel
>> > using
>> > javascript)
>> >
>> > If the user then enters the required data on the second panel and
>> > presses
>> > the submit button the validators fire and fail on the first panel but
>> > the
>> > user cannot tell because the panel is not visible.
>> >
>> > I want to be able to do one of the following:
>> >
>> > A) validate a panel as it loses visiblity without a postback. This way
>> > the
>> > user must enter the data before they leave the panel. (server side
>> > validation
>> > will still occur when the submit button is pressed but the data will
>> > already
>> > be known good) This would be the prefered option
>> >
>> > b) force the panel with the failed validator to be visible when the
>> > server
>> > side validation occurs.
>> >
>> > c) display some kind of message on the currently visible panel
>> > indicating
>> > that there are failed validators on the first panel so the user is
>> > aware
>> > and
>> > can correct the problem.
>> >
>> > Any ideas would be helpful
>> >
>> > --
>> > Bill
>>
>>
>>


Nov 19 '05 #7
You know I read somewhere on one of these forums that when you have a problem
you need to ask yourself why you need to do what you are trying to do. Then
you need to ask the same question about the answer you give yourself and keep
asking the question about your answer until you can't answer anymore. At that
point you will have come to the real problem you are trying to solve.

The bottom line with this problem is I want the end-user to have a visual
notification of any validation error that occurs regardless of the panel in
which it occurs on.

I added a ValidationSumma ry control to the page visible with all panels and
it 10 minutes my problem is over.

I thank you very much for your time Justin. You have definitly helped me
think this problem through.
--
Bill
"Bill Long" wrote:
I have a control that simply displays a list of links. Following one of the
links doesn't post back or redirect to another page, it simply hides the
current panel and shows the one you selected... So the behavour is similar to
a tab control.

The user is expected to fill out required data on each of the panels before
pressing a submit button which is visible from all panels.

Problem I have is validating the data entered by the user. I can use built
in validators to actualy do the validation but consider this type of
situation.

The user loads the page and enters some but not all of the data on the first
panel. They then follow the link to the second panel (which sets DISPLAY:none
on the currently visible panel and DISPLAY:block on the new panel using
javascript)

If the user then enters the required data on the second panel and presses
the submit button the validators fire and fail on the first panel but the
user cannot tell because the panel is not visible.

I want to be able to do one of the following:

A) validate a panel as it loses visiblity without a postback. This way the
user must enter the data before they leave the panel. (server side validation
will still occur when the submit button is pressed but the data will already
be known good) This would be the prefered option

b) force the panel with the failed validator to be visible when the server
side validation occurs.

c) display some kind of message on the currently visible panel indicating
that there are failed validators on the first panel so the user is aware and
can correct the problem.

Any ideas would be helpful

--
Bill

Nov 19 '05 #8
Bill,

No, I'm not MS. And sorry, but I don't know of a good article for this.

What I'm fearful of is that by the time your done you may actually end up
using more processing power than the post backs would have taken. I see what
you're going for, and I hope you get it working.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Bill Long" <Bi******@discu ssions.microsof t.com> wrote in message
news:49******** *************** ***********@mic rosoft.com...
Actually when you think about. That's not really a good solution either
because if I load the page, fill out the first panel and then hit the
submit
button without selecting one of the links to display another panel
validators
on the other panels would fire but not be visible and the user would have
no
indication that this occured. I would also have to validate each panel on
the
client when the submit button was clicked.

What might work is forget about validating when the panels change but loop
through validators on each panel when the submit button is clicked and
display the first panel I find with a failure. The validators themselves
would prevent the postback. All I have to do is find panel.

Are you a Microsoft employee? Can you point me toward a good knowledge
base
article on testing validators with javascript?

--
Bill
"Bill Long" wrote:
This close to what I was thinking. I could have a little piece of
javascript
for each panel. When the user clicks to display one of the other panels,
I
could loop through each control I want to validate and validate it. If I
find
one that fails then leave the panel visible otherwise hide it and display
the
one the user selected.

I sort of have this working but it is messy and not really a good
solution
becasue I have to have two seperate validation routines for each control
I
want to validate. Client side javascript and server side validators. I
would
rather do as you suggest and make use of the validators I already have in
place.

I've tried that already and the problem I have with it is this:

Validation doesn't always occur when I change panels. Lets say I have a
panel with a textbox and a required field validator. If I open the page,
the
page is valid but the textbox is blank. If I then change to another
panel...
no validation. On server side validation this is not true but the client
side
validation seems only to occur after a text changed event has occured.
IE: I
put some text in the textbox changed then delete it...

Interesting problem... I may have to live with multiple validation
routines
for each validated control.

Bill
"S. Justin Gengo" wrote:
> Bill,
>
> A different thought if you really don't want to post back until the
> final
> submit button is clicked. I think you'd have to cycle through each
> validator
> and check if it's valid. You could have a subroutine for each panel
> that
> could be called from the submit and it would loop through the
> validators on
> that panel and then if one that isn't valid is found set that panel to
> visible. If you try to do this all client side it won't work with a lot
> of
> browsers so you may run into trouble there...
>
>
> --
> Sincerely,
>
> S. Justin Gengo, MCP
> Web Developer / Programmer
>
> www.aboutfortunate.com
>
> "Out of chaos comes order."
> Nietzsche
> "S. Justin Gengo" <justin@[no_spam_please]aboutfortunate. com> wrote in
> message news:uF******** ******@TK2MSFTN GP10.phx.gbl...
> > Bill,
> >
> > But the validators will stop a postback clientside so it won't occur
> > for
> > any browser that supports it. And you say you're posting back anyway
> > upon
> > successful validation... So at least for the panels that need to be
> > validated I think that's the best solution.
> >
> > --
> > Sincerely,
> >
> > S. Justin Gengo, MCP
> > Web Developer / Programmer
> >
> > www.aboutfortunate.com
> >
> > "Out of chaos comes order."
> > Nietzsche
> > "Bill Long" <Bi******@discu ssions.microsof t.com> wrote in message
> > news:8C******** *************** ***********@mic rosoft.com...
> >> The reason is performance. Postbacks are not very network friendly.
> >> The
> >> way
> >> it works now changing panels is instantanious. Using postback slows
> >> things
> >> down quite a bit and cause unnessecary network traffic
> >>
> >> --
> >> Bill
> >>
> >>
> >> "S. Justin Gengo" wrote:
> >>
> >>> Bill,
> >>>
> >>> Is there a reason that you can't set the panel's visibility
> >>> property
> >>> from
> >>> the codebehind after a successful postback?
> >>>
> >>> That way you can do your clientside validation, wrap the button's
> >>> click
> >>> event code in If Page.IsValid, and only switch panels if valid
> >>> entries
> >>> are
> >>> made.
> >>>
> >>> --
> >>> Sincerely,
> >>>
> >>> S. Justin Gengo, MCP
> >>> Web Developer / Programmer
> >>>
> >>> www.aboutfortunate.com
> >>>
> >>> "Out of chaos comes order."
> >>> Nietzsche
> >>> "Bill Long" <Bi******@discu ssions.microsof t.com> wrote in message
> >>> news:6E******** *************** ***********@mic rosoft.com...
> >>> >I have a control that simply displays a list of links. Following
> >>> >one of
> >>> >the
> >>> > links doesn't post back or redirect to another page, it simply
> >>> > hides
> >>> > the
> >>> > current panel and shows the one you selected... So the behavour
> >>> > is
> >>> > similar
> >>> > to
> >>> > a tab control.
> >>> >
> >>> > The user is expected to fill out required data on each of the
> >>> > panels
> >>> > before
> >>> > pressing a submit button which is visible from all panels.
> >>> >
> >>> > Problem I have is validating the data entered by the user. I can
> >>> > use
> >>> > built
> >>> > in validators to actualy do the validation but consider this type
> >>> > of
> >>> > situation.
> >>> >
> >>> > The user loads the page and enters some but not all of the data
> >>> > on the
> >>> > first
> >>> > panel. They then follow the link to the second panel (which sets
> >>> > DISPLAY:none
> >>> > on the currently visible panel and DISPLAY:block on the new panel
> >>> > using
> >>> > javascript)
> >>> >
> >>> > If the user then enters the required data on the second panel and
> >>> > presses
> >>> > the submit button the validators fire and fail on the first panel
> >>> > but
> >>> > the
> >>> > user cannot tell because the panel is not visible.
> >>> >
> >>> > I want to be able to do one of the following:
> >>> >
> >>> > A) validate a panel as it loses visiblity without a postback.
> >>> > This way
> >>> > the
> >>> > user must enter the data before they leave the panel. (server
> >>> > side
> >>> > validation
> >>> > will still occur when the submit button is pressed but the data
> >>> > will
> >>> > already
> >>> > be known good) This would be the prefered option
> >>> >
> >>> > b) force the panel with the failed validator to be visible when
> >>> > the
> >>> > server
> >>> > side validation occurs.
> >>> >
> >>> > c) display some kind of message on the currently visible panel
> >>> > indicating
> >>> > that there are failed validators on the first panel so the user
> >>> > is
> >>> > aware
> >>> > and
> >>> > can correct the problem.
> >>> >
> >>> > Any ideas would be helpful
> >>> >
> >>> > --
> >>> > Bill
> >>>
> >>>
> >>>
> >
> >
>
>
>

Nov 19 '05 #9
Bill,

Great solution!

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Bill Long" <Bi******@discu ssions.microsof t.com> wrote in message
news:EC******** *************** ***********@mic rosoft.com...
You know I read somewhere on one of these forums that when you have a
problem
you need to ask yourself why you need to do what you are trying to do.
Then
you need to ask the same question about the answer you give yourself and
keep
asking the question about your answer until you can't answer anymore. At
that
point you will have come to the real problem you are trying to solve.

The bottom line with this problem is I want the end-user to have a visual
notification of any validation error that occurs regardless of the panel
in
which it occurs on.

I added a ValidationSumma ry control to the page visible with all panels
and
it 10 minutes my problem is over.

I thank you very much for your time Justin. You have definitly helped me
think this problem through.
--
Bill
"Bill Long" wrote:
I have a control that simply displays a list of links. Following one of
the
links doesn't post back or redirect to another page, it simply hides the
current panel and shows the one you selected... So the behavour is
similar to
a tab control.

The user is expected to fill out required data on each of the panels
before
pressing a submit button which is visible from all panels.

Problem I have is validating the data entered by the user. I can use
built
in validators to actualy do the validation but consider this type of
situation.

The user loads the page and enters some but not all of the data on the
first
panel. They then follow the link to the second panel (which sets
DISPLAY:none
on the currently visible panel and DISPLAY:block on the new panel using
javascript)

If the user then enters the required data on the second panel and presses
the submit button the validators fire and fail on the first panel but the
user cannot tell because the panel is not visible.

I want to be able to do one of the following:

A) validate a panel as it loses visiblity without a postback. This way
the
user must enter the data before they leave the panel. (server side
validation
will still occur when the submit button is pressed but the data will
already
be known good) This would be the prefered option

b) force the panel with the failed validator to be visible when the
server
side validation occurs.

c) display some kind of message on the currently visible panel indicating
that there are failed validators on the first panel so the user is aware
and
can correct the problem.

Any ideas would be helpful

--
Bill

Nov 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1319
by: amessimon | last post by:
Hi I have a long form - around 80 fields - which i have decided to break up into more manageable sections using the <asp:Panel> control. Basically i have three panels (stages) containing various form elements which i show and as the user progresses through the form.
4
1452
by: Spence Hackney | last post by:
I have noticed that within my application my button controls do not work when there are validation controls on the panel (even if the validation controls are not visible, i.e. not showing an error with the control they are validating). When I click the buttons they enter the depressed state, but nothing happens. Similar button controls work fine when on a page where their is no validation. Also, I am only experiencing this issue on one...
6
3052
by: wandali | last post by:
Hello, I have a problem in finding the status of a panel (visible or not). I have a dropdownlist that associates with a panel in which textbox are embeded in the panel. A client side VBScript is run when the value of the dropdown change. And here is the script if document.all(dropdown).value ="-1" then document.all(panel).style.display = "block"
2
2377
by: Darren Carter | last post by:
Hi, I have mutliple asp:Panel controls on a single page, each with a default button defined (each default button resides within its respective asp:Panel). All validation controls and buttons within each panel also have separate ValidationGroups defined. When an asp:Textbox has focus in one of the Panels and I press the enter key, my validation works great. If I press the enter key a second time, the first button on the page's onClick...
0
1220
by: Brooke | last post by:
I am having problems with controls on a panel not firing. The controls that are directly on the form will validate, but the controls on the panel will not validate. I have the AutoValidate property for the form set to EnableAllowFocusChange and then I call the ValidateChildren method when the save button is clicked. If I cannot get the form to validate the controls, can I loop through each control and call the validate event? Thanks
1
4860
by: mbruyns | last post by:
i have been trying (and sometimes succeeding) to use the modalpopupextender to show various panels of controls on my asp pages. the strange problem that i keep on running into is that sometimes it works, displaying an awesome popup, while other times, it doesn't show a popup at all, but rather just page posts back and the panel becomes visible at the bottom of the page (where it is situated in the designer). what is even stranger to me is that...
0
1553
by: durga2005 | last post by:
hi i just added one textbox and regular expression validator in the form and set the properties for regular expression validator control. then i placed these two controls inside update panel . when i execute this, the validation was not working before placing in update panel validation was working
1
1947
by: sweatha | last post by:
I have designed the login form with 3 panels. In the first panel I have the login verification such as login id, password, login button and forgot password link button. In the second panel I have designed the registration details with validation checks by using the validation controls. The third panel will get visible only if the "forgot password?" option is clicked in the first panel. But the issue is if I click the login button in the...
4
8432
hemantbasva
by: hemantbasva | last post by:
We have designed an aspx page having five ajax tab in it. the data of first four are designed on page whereas for the fifth tab it renders a user control named MYDOMAIN. in the tab container's even onactivetabindexchanged we have called a method loadtabpanel() which is defined in javascript in same page.the problem is it sometime give the message load tab panel undefined. this error does not come regularly. it comes in usercontrol rendering . i...
0
9999
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9849
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11285
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10878
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10986
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10501
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8049
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6094
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3324
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.