Home All Groups Group Topic Archive Search About

Menu Control and Page Validation

Author
17 Jan 2006 12:50 PM
Ken McBryde
Is there a simple way in which I can get the Menu control to cause page
validation to happen on the client side - thus causing client side validator
components to execute before a postback is attempted?

Reason:
I have a web app that will always be accessed by the client group from IE
therefore I can fully take advantage of client side validation.  To simplify
the UI I have created a tabbed dialog and have used the menu control to
manage the tabs.  I'd like the client side validation to fire if the user
attempts to switch tabs whilst there is invalid data on the current tab. 

I can achieve the desired Tabbed effect using panels and linkbuttons but its
not a neat as the menu control.

Thanks

Author
17 Jan 2006 1:01 PM
Wouter van Vugt
Hi Ken,

maybe you should reconsider the behavior. The users might just close
the browser, reopen it and then go to the tab they are after. But if
you really do want this behavior, it will be difficult to add
validation logic, the Menu doesn't support this by default. I am also
doubtfull it will work using the extensibility model of the Menu
control.

Grtz, Wouter van Vugt
Trainer - Info Support
blogs.infosupport.com/wouterv
Author
17 Jan 2006 5:59 PM
Peter Blum
You may be able to take advantage of the MenuItem.NavigateUrl property. (I
use this to attach my validation system, Professional Validation And More,
into the ASP.NET 2.0 menu control to achieve the same goal.)

MenuItem1.NavigateUrl = "javascript: if (Page_ClientValidate('validation
group name')) document.location.href='new url';"


--- Peter Blum
www.PeterBlum.com
Email: PLB***@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

Show quoteHide quote
"Ken McBryde" <KenMcBr***@discussions.microsoft.com> wrote in message
news:B4356DEA-7AB0-4C3F-8223-B2AE46ADF370@microsoft.com...
> Is there a simple way in which I can get the Menu control to cause page
> validation to happen on the client side - thus causing client side
> validator
> components to execute before a postback is attempted?
>
> Reason:
> I have a web app that will always be accessed by the client group from IE
> therefore I can fully take advantage of client side validation.  To
> simplify
> the UI I have created a tabbed dialog and have used the menu control to
> manage the tabs.  I'd like the client side validation to fire if the user
> attempts to switch tabs whilst there is invalid data on the current tab.
>
> I can achieve the desired Tabbed effect using panels and linkbuttons but
> its
> not a neat as the menu control.
>
> Thanks