Navigation Control and Validation
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
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,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 >>
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
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
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" %>
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,