Validating Tabstrip with Multipage Control

D

DotNetTechi

hi all,
i am using tabstrip with multipage control in asp.net.i have put
some textboxes on the first tab.my requirement is that i whenever user
make somechanges in any of textbox and moves to next tab without saving
this data i want to display a alert message and stop user from moving
to another tab.
For this i have written a javascript function and called it
onSelectedIndexChange event.This function stops database processings
for the next tab but the html part get displays.
i just want not to allow user to change the tab if anything is unsaved
on current page.
please help me ....
Thanx in Advance
Sam
 
V

V.Balaji

This can be done by Group Validation.This feature is included in the ASP.NET
2.0.This can also be done in ASP.NET 1.x with slight changes(addition) in
our web server controls.

Rgds,
 
S

Sam Sam

Thanx for your help.
but i am still not clear how can i prevent a user from naviagting to
next page without saving data on current page.
 
D

Do Quyet Tien

what is "our web server controls"?

V.Balaji said:
This can be done by Group Validation.This feature is included in the ASP.NET
2.0.This can also be done in ASP.NET 1.x with slight changes(addition) in
our web server controls.

Rgds,
 
P

Peter Blum

"Validation Groups" is the correct approach because it allows client-side
validation of a group of controls. In your case, those will be controls on a
single tab page.
Since ASP.NET 2.0 is not available yet, you cannot use this feature without
some clever hacks.

I wrote a replacement to Microsoft's validators that addresses its numerous
limitations and greatly expands validation. "Professional Validation And
More" (http://www.peterblum.com/vam/home.aspx) includes validation groups
today. It also has 22 validators and they provide client-side validation on
many more browsers than just IE and IE/Mac that your current validators use.
It includes a utility to quickly migrate a page to my validators.

Here's how you would solve this with Professional Validation And More:
1. Convert the page using the utility
2. On each page, assign a name to the Group property of each validator. The
name should be the same across one tab page.
3. If you have a submit button on each tab page, set its Group property to
match.
4. If you have a submit button outside of the tabbed section, assign
Group="*" so it validates all pages.
5. In your onSelectedIndexChange event, call my function
VAM_ValidateGroup("[groupname]", true). It will return true if validation
succeeds. Always validate the group associated with the tabbed page.

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
 

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,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top