473,378 Members | 1,119 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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 3148
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******@discussions.microsoft.com> wrote in message
news:6E**********************************@microsof t.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******@discussions.microsoft.com> wrote in message
news:6E**********************************@microsof t.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******@discussions.microsoft.com> wrote in message
news:8C**********************************@microsof t.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******@discussions.microsoft.com> wrote in message
news:6E**********************************@microsof t.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**************@TK2MSFTNGP10.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******@discussions.microsoft.com> wrote in message
news:8C**********************************@microsof t.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******@discussions.microsoft.com> wrote in message
news:6E**********************************@microsof t.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**************@TK2MSFTNGP10.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******@discussions.microsoft.com> wrote in message
news:8C**********************************@microsof t.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******@discussions.microsoft.com> wrote in message
news:6E**********************************@microsof t.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**************@TK2MSFTNGP10.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******@discussions.microsoft.com> wrote in message
news:8C**********************************@microsof t.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******@discussions.microsoft.com> wrote in message
>> news:6E**********************************@microsof t.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 ValidationSummary 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******@discussions.microsoft.com> wrote in message
news:49**********************************@microsof t.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**************@TK2MSFTNGP10.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******@discussions.microsoft.com> wrote in message
> > news:8C**********************************@microsof t.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******@discussions.microsoft.com> wrote in message
> >>> news:6E**********************************@microsof t.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******@discussions.microsoft.com> wrote in message
news:EC**********************************@microsof t.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 ValidationSummary 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
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...
4
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...
6
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...
2
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...
0
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...
1
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...
0
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 ....
1
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...
4
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.