This is a migrated thread and some comments may be shown as answers.

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

2 Answers 14 Views
Window
This is a migrated thread and some comments may be shown as answers.
Joel
Top achievements
Rank 2
Joel asked on 02 Feb 2017, 04:06 PM

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">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
           <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"
</telerik:RadWindowManager
 
        <asp:Button runat="server" ID="btntest" OnClick="btntest_Click" Text="test" CausesValidation="false" />
 
    </div>
    </form>
</body>
</html>

 

 

And the codebehind:

 

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

 

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 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 03 Feb 2017, 11:19 AM

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:


Regards,

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.
0
Joel
Top achievements
Rank 2
answered on 10 Feb 2017, 10:40 PM
Thank you.  Changing the page to open the windows to javascript, and adding    <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" /> to appsettings resolved this issue.
Tags
Window
Asked by
Joel
Top achievements
Rank 2
Answers by
Marin Bratanov
Telerik team
Joel
Top achievements
Rank 2
Share this question
or