Radwindow won't open if 2 requiredfieldvalidator's on the page

3 posts, 0 answers
  1. Joel
    Joel avatar
    181 posts
    Member since:
    Oct 2006

    Posted 02 Feb 2017 Link to this post

    Here is a code sample of my test page.


    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="junk2.aspx.cs" Inherits="Testing.junk2" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <%--<%@ Register Src="~/CustomControls/Header.ascx" TagPrefix="uc1" TagName="Header" %>--%>
    <!DOCTYPE html>
    <head runat="server">
        <form id="form1" runat="server">
               <telerik:RadScriptManager runat="server" ID="rsm"> </telerik:RadScriptManager>   
                        <telerik:RadTextBox runat="server" ID="txtFriendly" Width="400px"  Skin="Silk"></telerik:RadTextBox>
                        <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" ControlToValidate="txtFriendly"
                         Display="Dynamic" ErrorMessage=" * required" CssClass=" text-danger"/>
                        <telerik:RadTextBox runat="server" ID="txtSubject" Width="400px" Skin="Silk"   ></telerik:RadTextBox>
                      <%-- <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator5" ControlToValidate="txtSubject"
                         Display="Dynamic" ErrorMessage=" * required" CssClass=" text-danger"/>
                        <telerik:RadWindowManager ID="RadWindowManager1" runat="server"
            <asp:Button runat="server" ID="btntest" OnClick="btntest_Click" Text="test" CausesValidation="false" />



    And the codebehind:


    protected void btntest_Click(object sender, EventArgs e)
              RadWindow newWindow = new RadWindow();
              newWindow.NavigateUrl = "http://www.google.com";
              newWindow.VisibleOnPageLoad = true;


    If I comment out either (or both) of the 2 RequiredFieldValidator's, the modal displays.  It doesn't matter which one is commented.


    If both are on the page, I get no modal dialog.

    We are using v2016.3.1018.45



  2. Marin Bratanov
    Marin Bratanov avatar
    5332 posts

    Posted 03 Feb 2017 Link to this post

    Hello Joel,

    Could you check whether you get this error in the browser console: http://docs.telerik.com/devtools/aspnet-ajax/controls/window/troubleshooting/common-issues#uncaught-typeerror-ponevent-is-not-a-function? The jQuery mix-up is often related to unobtrusive validation that brings more jQuery instances to the page.

    The provided snippet seems otherwise fine and works as expected on my end, so the likely problem is in the validation environment.

    On a side note, I would recommend you register a script to generate a new RadWindow with client-side code instead of adding more and more instances on the server:


    Marin Bratanov
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Joel
    Joel avatar
    181 posts
    Member since:
    Oct 2006

    Posted 10 Feb 2017 Link to this post

    Thank you.  Changing the page to open the windows to javascript, and adding    <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" /> to appsettings resolved this issue.
Back to Top