tabstrip - limit validating on one pageview

5 posts, 0 answers
  1. Martin Gartmann
    Martin Gartmann avatar
    51 posts
    Member since:
    Apr 2004

    Posted 03 Oct 2010 Link to this post

    Dear forum,
    i have a tabstrip with one multipage and severall pageviews.
    Just in one (of up to 5) pageviews i have input controls and a submit button.
    This input controls should be validated only if this button is pressed,
    but i don't want validating, when the user just want to switch to another tab/pageview.
    Is this possible.
    Currently i can just switch tabs when all date in the input controls are correct (in case causevalidate = true for the tabstrip) because of validating.
    But no validating is done at all when causevalidate = true for the button and false for the tabstrip.
    Any suggestions how to realize my szenario ?
    Kind regards
    Martin
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 04 Oct 2010 Link to this post

    Hello Martin,

    You should set CausesValidation property of the tabstrip to "false".

    All the best,
    Yana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Martin Gartmann
    Martin Gartmann avatar
    51 posts
    Member since:
    Apr 2004

    Posted 04 Oct 2010 Link to this post

    Dear Yana,
    thanks for the reply. that was exactly that what i did. But i  have found a fix for my needs.
    My button (casuevalidation=true) was inside a pageview (connected with my tabstrip with causesvalidating=false).
    When i pressed the button there not validation was done, but when i placed the button outside 
    the toolstrip validating is working and i can switch between tabs.
    Could it be thas causevalidate will inherit from the tabstrip to the button.
    Kind regards
    Martin

  5. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 04 Oct 2010 Link to this post

    Hello Martin,

    Why don't you use ValidationGroup, to contain which controls should be part of the button's validation process.

    I hope that helps.
  6. Martin Gartmann
    Martin Gartmann avatar
    51 posts
    Member since:
    Apr 2004

    Posted 04 Oct 2010 Link to this post

    Sorry all,
    the descriped problem is currently gone. No plan what was the cause.
    Hopefully it will not return.
    Now my button events is fired and the validating is working as expected.
    Also i can switch between tabs without firing validating.
    Thanks for the replies anyway.
    Kind regards.
    Martin




    Dear Cori,

    my current problem is, that validation is working, but when all valiadators are valid, my button event is not fired.

    See my aspx code:

    <telerik:RadTabStrip ID="rtsOrder" runat="server" Skin="Black" MultiPageID="RadMultiPage1" SelectedIndex="0" CssClass="tabStrip" CausesValidation="False">
        <Tabs>
            <telerik:RadTab runat="server" Text="Persönliche Daten" PageViewID="RadPageView1" Selected="True">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="Meine Wunschkonfiguration" PageViewID="RadPageView2">
            </telerik:RadTab>           
            <telerik:RadTab runat="server" Text="Angaben aus Detailcheck" PageViewID="RadPageView4"   >
            </telerik:RadTab>
               <telerik:RadTab runat="server" Text="Angaben zur Maßanfertigung" PageViewID="RadPageView5"  >
            </telerik:RadTab>
        </Tabs>
    </telerik:RadTabStrip>
    <telerik:RadMultiPage ID="RadMultiPage1" Runat="server" CssClass="multiPage" SelectedIndex="0">
        <telerik:RadPageView ID="RadPageView1" runat="server" Selected="true"><table cellpadding="4" class="orderform"><tr><td class="normal">Vorname:</td><td><telerik:RadTextBox ID="rtbVorname" Runat="server"></telerik:RadTextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                            ErrorMessage="* Wird benötigt" ControlToValidate="rtbVorname"></asp:RequiredFieldValidator></td></tr><tr><td class="normal" >Name:</td><td><telerik:RadTextBox ID="rtbName" Runat="server"></telerik:RadTextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                            ErrorMessage="* Wird benötigt" ControlToValidate="rtbName"></asp:RequiredFieldValidator></td></tr><tr><td class="normal">Anschrift:</td><td><telerik:RadTextBox ID="rtbAnschrift" Runat="server"></telerik:RadTextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" 
                            ErrorMessage="* Wird benötigt" ControlToValidate="rtbAnschrift"></asp:RequiredFieldValidator></td></tr><tr><td class="normal" valign="top">PLZ & Ort:</td><td class="normal" valign="top"><telerik:RadTextBox ID="rtbPLZ" Runat="server"></telerik:RadTextBox> - <telerik:RadTextBox ID="rtbOrt" Runat="server"></telerik:RadTextBox>
                 <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                    ControlToValidate="rtbPLZ" ErrorMessage="* PLZ wird benötigt"></asp:RequiredFieldValidator>
                 <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                            ErrorMessage="* Ort wird benötigt" ControlToValidate="rtbOrt"></asp:RequiredFieldValidator></td></tr><tr><td class="normal" >Land:</td><td><telerik:RadTextBox ID="rtbLand" runat="server"></telerik:RadTextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                            ControlToValidate="rtbLand" ErrorMessage="* Wird benötigt"></asp:RequiredFieldValidator></td></tr><tr><td class="normal">Telefon:</td><td><telerik:RadTextBox ID="rtbTelefon" runat="server"></telerik:RadTextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                            ControlToValidate="rtbTelefon" ErrorMessage="* Wird benötigt"></asp:RequiredFieldValidator></td></tr><tr><td class="normal">eMail:</td><td><telerik:RadTextBox ID="rtbeMail" runat="server"></telerik:RadTextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                            ErrorMessage="* Wird benötigt" ControlToValidate="rtbeMail"></asp:RequiredFieldValidator></td></tr><tr><td class="normal"></td><td class="normal"><asp:CheckBox ID="cbxTSAGB" runat="server"  />Ich habe die <a href="~/agbs.aspx">AGB&apos;s des Tauchshops</a> gelesen und akzeptiert!<br /><cc1:CheckBoxValidator ID="cbvTSAGB"  runat="server" 
                            ControlToValidate="cbxTSAGB" MustBeChecked="True" 
                            ErrorMessage="* Sie müssen die AGB's des Tauchshop's akzeptieren"></cc1:CheckBoxValidator></td></tr><tr><td class="normal"></td><td class="normal"><asp:CheckBox ID="cbxD2NAGB" runat="server" />Ich habe die <a href="~/agbs.aspx">AGB's von dive2gether.net</a> gelesen und akzeptiert!<br /><cc1:CheckBoxValidator ID="cbvD2NAGB"  runat="server" 
                            ControlToValidate="cbxD2NAGB" MustBeChecked="True" 
                            ErrorMessage="* Sie müssen die AGB's von dive2gether akzeptieren"></cc1:CheckBoxValidator></td></tr><tr><td class="normal" valign="top">Kommentar:</td><td class="normal"><telerik:RadTextBox ID="rtbKommentar" Runat="server" Height="200px" 
                            Width="600px"></telerik:RadTextBox></td></tr><tr><td class="normal">
                            </td><td></td></tr></table></telerik:RadPageView>
        <telerik:RadPageView ID="RadPageView2" runat="server"><table cellpadding="4" class="orderform"><tr><td colspan="4" class="normalbold">Ihre aktuelle Konfiguration</td></tr><tr><td class="normalbold" width="140">Model:</td><td><asp:Label ID="lblModel" runat="server" CssClass="normal"></asp:Label></td><td><asp:Label ID="lblBPV" runat="server" Text="Basispreis: "  CssClass="normal" ></asp:Label></td><td align="right"><asp:Label ID="lblBasePrice" runat="server" CssClass="normal" ></asp:Label></td></tr><tr><td class="normalbold" width="140">Größe:</td><td ><asp:Label ID="lblHeight" runat="server" CssClass="normal" ></asp:Label></td></tr><tr><td class="normalbold" width="140">Gewicht:</td><td ><asp:Label ID="lblWeight" runat="server" CssClass="normal" ></asp:Label></td><td></td><td></td></tr><tr><td class="normalbold" width="140">Geschlecht:</td><td ><asp:Label ID="lblGender" runat="server" CssClass="normal" ></asp:Label></td></tr><tr><td class="normalbold"  width="140">Konfektion:</td><td ><asp:Label ID="lblKonfektion" runat="server" CssClass="normal" ></asp:Label></td><td></td><td></td></tr><tr><td class="normalbold"  width="140">Passende Größe:</td><td ><asp:Label ID="lblSize" runat="server" CssClass="normal" ></asp:Label></td><td></td><td></td></tr><tr><td class="normalbold"  width="140">Farbe des Overlays:</td><td ><asp:Label ID="lblOverlay" runat="server" CssClass="normal" ></asp:Label></td><td></td><td></td></tr><tr><td class="normalbold"  width="140">Materialmix:</td><td ><asp:Label ID="lblMaterialmix" runat="server" CssClass="normal" ></asp:Label></td><td></td><td></td></tr><tr><td class="normalbold"  width="140">Halsmanschetten:</td><td ><asp:Label ID="lblHalsmanschetten" runat="server" CssClass="normal" ></asp:Label></td><td><asp:Label ID="lblHals" runat="server" Text="Aufpreis : "  CssClass="normal" ></asp:Label></td><td align="right"><asp:Label ID="lblHalsAufpreis" runat="server" CssClass="normal" ></asp:Label></td></tr><tr><td class="normalbold"  width="140">Armmanschetten:</td><td ><asp:Label ID="lblArmmanschetten" runat="server" CssClass="normal" ></asp:Label></td><td><asp:Label ID="lblAM" runat="server" Text="Aufpreis : "  CssClass="normal" ></asp:Label></td><td align="right"><asp:Label ID="lblAMAufpreis" runat="server" CssClass="normal" ></asp:Label></td></tr><tr><td class="normalbold"  width="140">Taschen:</td><td ><asp:Label ID="lblTaschen" runat="server" CssClass="normal" ></asp:Label></td><td><asp:Label ID="lblTaschenAP" runat="server" Text="Aufpreis : "  CssClass="normal" ></asp:Label></td><td align="right"><asp:Label ID="lblTaschenAufpreis" runat="server" CssClass="normal" ></asp:Label></td></tr><tr><td class="normalbold"  width="140">Auslassventil:</td><td ><asp:Label ID="lblAuslassventil" runat="server" CssClass="normal" ></asp:Label></td><td><asp:Label ID="lblValve" runat="server" Text="Aufpreis : "  CssClass="normal" ></asp:Label></td><td align="right"><asp:Label ID="lblValveAufpreis" runat="server" CssClass="normal" ></asp:Label></td></tr><tr><td class="normalbold"  width="140">Boots:</td><td ><asp:Label ID="lblBoots" runat="server" CssClass="normal" ></asp:Label></td><td><asp:Label ID="lblBAP" runat="server" Text="Aufpreis : "  CssClass="normal" ></asp:Label></td><td align="right"><asp:Label ID="lblBootsAufpreis" runat="server" CssClass="normal" ></asp:Label></td></tr><tr><td class="normalbold" width="140">Ihre Schuhgröße:</td><td><asp:Label ID="lblBootSize" runat="server"></asp:Label></td><td> </td><td align="right"> </td></tr><tr><td class="normalbold" valign="top"  width="140">Zubehör:</td><td ><asp:ListBox ID="lbxAccessoires" runat="server"  Width="250"></asp:ListBox></td><td valign="top"><asp:Label ID="lblAPACC" runat="server" Text="Aufpreis : "  CssClass="normal" ></asp:Label></td><td align="right" valign="top"><asp:Label ID="lblAufpreisACC" runat="server" CssClass="normal" ></asp:Label></td></tr><tr><td class="normalbold"   valign="top"  width="140">Unterzieher:</td><td ><asp:ListBox ID="lbxUnterzieher" runat="server" Width="250"></asp:ListBox></td><td valign="top"><asp:Label ID="lblSAPUZ" runat="server" Text="Aufpreis : "  CssClass="normal" ></asp:Label></td><td align="right" valign="top"><asp:Label ID="lblAufpreisUZ" runat="server" CssClass="normal" ></asp:Label></td></tr><tr><td class="normalbold"   valign="top"  width="140"></td><td ></td><td><asp:Label ID="lblSumme" runat="server" Text="Summe : "  CssClass="normal" ></asp:Label></td><td align="right"><asp:Label ID="lblSummeKonfiguration" runat="server" CssClass="normal" ></asp:Label></td></tr><tr><td class="normalbold"   valign="top"  width="140"></td><td ></td></tr></table></telerik:RadPageView>
        <telerik:RadPageView ID="RadPageView4" runat="server" CssClass="orderform" ><uc2:dco ID="dco1" runat="server" /></telerik:RadPageView>
        <telerik:RadPageView ID="RadPageView5" runat="server" CssClass="orderform" ><uc1:cmo ID="cmo1" runat="server" /></telerik:RadPageView>
    </telerik:RadMultiPage><asp:Button ID="btnOrder" runat="server" 
        Text="Bestellung jetzt abschicken!" PostBackUrl="~/proceed.aspx" 
        CausesValidation="True" UseSubmitBehavior="True" />


    See my button event on server side

    Protected Sub btnOrder_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOrder.Click
          If Page.IsValid Then
              If Session("Modus") = "Quickcheck" Then
                  Send_Quick_Order_Seller()
                  Send_Quick_Order_Customer()
                  Response.Redirect("~/proceed.aspx")
              ElseIf Session("Modus") = "Detailcheck" Then
                  Send_Detail_Order_Seller()
                  Send_Detail_Order_Customer()
                  Response.Redirect("~/proceed.aspx")
              ElseIf Session("Modus") = "Custom" Then
                  Send_Custom_Order_Seller()
                  Send_Custom_Order_Customer()
                  Response.Redirect("~/proceed.aspx")
              End If
          End If
      End Sub

    in my page load i have

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
          If Not Page.IsPostBack Then
              btnOrder.Attributes.Add("onclick", String.Format("realPostBack('{0}', ''); return false;", btnOrder.UniqueID))
          End If

    to force a server postbackon button click. With the above code the validating is working, but my server code is never fired.

    When i remove the
     
    If Not Page.IsPostBack Then
        btnOrder.Attributes.Add("onclick", String.Format("realPostBack('{0}', ''); return false;", btnOrder.UniqueID))
    End If

    my buttons postback adress will be called, but the button event in code behind is not fired.

    Any idear on this ?

    Kind regards

    Martin Gartmann

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017