1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Navigation Control and Validation

Navigation Control and Validation

6 posts, 0 answered
  1. David
    David avatar
    4 posts
    Registered:
    28 Jul 2011
    06 Sep 2011
    Link to this post
    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
  2. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    08 Sep 2011
    Link to this post
    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 >>

  3. Peter
    Peter avatar
    30 posts
    Registered:
    08 Dec 2010
    31 Oct 2011
    Link to this post
    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
  4. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    01 Nov 2011
    Link to this post
    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
  5. Peter
    Peter avatar
    30 posts
    Registered:
    08 Dec 2010
    01 Nov 2011
    Link to this post
    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.
  6. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    03 Nov 2011
    Link to this post
    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
6 posts, 0 answered