Navigation Control and Validation

Posted by Community Admin on 04-Aug-2018 10:14

Navigation Control and Validation

All Replies

Posted by Community Admin on 06-Sep-2011 00:00
Hello,

We have a standard Navigation control added to our base template but we are having a problem with validation.  On many of our pages we have user controls which are complex forms but they are contained within their own validation groups.  However when on these pages and we click on the navigation links the validation on these forms kicks in and we cannot leave the page.

I have set the option 'HeadingsShouldBeLinks' which I can see is causing anchor tags to be rendered with the correct hrefs but they still seem to be plumbed into the JavaScript validation.  I can see no way of setting a validation group on the control.

So I need to know if there is anyway of completely disabling the JavaScript for this control so that it becomes what I want it to be - a list of anchor tags.

Thanks
Posted by Community Admin on 08-Sep-2011 00:00
Hello David,

Most of our navigation control layouts are based on telerik RadControls like RatTabStrip. These controls have a property named CausesValidation. If you override, for example SiteMapNavigationTabStrip, and in its OnInit method set this property to true, then clicking on items will not cause a validation. You can then replace this control in the NavigationControl.ascx template.

Greetings,
Lubomir Velkov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Posted by Community Admin on 31-Oct-2011 00:00
Hi Lubomir,

Would it be possible for you to provide a step by step instructions for this process? Unfortunately I'm not too familiar with this stuff. 

Thanks!

Pete
Posted by Community Admin on 01-Nov-2011 00:00
Hi Peter,

You can check this article at first -

http://www.sitefinity.com/blogs/joshmorales/posts/11-05-10/mapping_external_templates_for_sitefinity_4_widgets.aspx

To map a template you can also go to Administration -> Settings -> Advanced -> Controls -> ViewMap and add a new map for 

Telerik.Sitefinity.Web.UI.NavigationControls.NavigationControl as HostType and set the LayoutTemplatePath to some external .ascx file like ~/Navigation.ascx

Regards,
Lubomir Velkov
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Posted by Community Admin on 01-Nov-2011 00:00
I followed the instructions on the post and succesfully linked the layout template to a blank control with the property CausesValidation set to false.

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Navigation.ascx.cs" Inherits="Modules_Navigation" CausesValidation="false" %>


This results in an error. I need a lot more specific information. As I said before, I am not experienced.
Posted by Community Admin on 03-Nov-2011 00:00
Hello Peter,

You do not set CausesValidation="false" in the <%@ Control %> definition. You set it in the <telerik:RadTabStrip> control or any other navigation control that you will be using. I hope this answers your question.

Greetings,
Lubomir Velkov
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
This thread is closed