Telerik Forums
UI for ASP.NET AJAX Forum
26 answers
3.9K+ views
As briefly explained in the topic I can't seem to have client side asp.net validators to work. Server side is all ok, infacat since the Page_Validators is undefined, the Page_IsValid is always true (clientside) so the client validation always pass BUT server side, after the postback that shouldn't occur, I get the correct error messages reported.

I copied exactly your example on demo page of RadInput validation do do further testing but with no results (I even stripped it down a basic 1 textbox + 1 validator, I tryed with standard asp textboxes, I searched the web for 4 hours now finding all kind of answers even in this forum, all with no luck).

Things I can say in advance:

- The .axd script resources all loads correctly (checked both in Google Chrome developers console and Firefox Firebug consol. No 404 or 500 errors)
- The ScriptResources.axd starts with those public js variables (no hint at Page_Validators there is it normal?)

var Page_ValidationVer = "125";
var Page_IsValid = true;
var Page_BlockSubmit = false;
var Page_InvalidControlToBeFocused = null;
var Page_TextTypes = /^(text|password|file|search|tel|url|email|number|range|color|datetime|date|month|week|time|datetime-local)$/i;


- Checking with Google Chrome developers tools console for alert(Page_Validators.length) returns ReferenceError: Page_Validators is not defined
- If I set in the web.config <add key="Telerik.ScriptManager.TelerikCdn" value="Enabled" /> (instead of "Disabled") I also experience a js error: Uncaught ReferenceError: $telerik is not defined This doesn't happen in my real code btw, just happens on the page I copy/pasted from your on-line example to make tests (I will report the code down here). This means that somehow I fixed that second bug in my real project but I don't remember how.
- I tryed with both CDN enabled and disabled in the RadScriptManager.
- I tryed with both your Jquery and with Google CDN served JQuery (1.9.1)

I really don't know where else look at... after 4/5 unsuccessfull hours at a simple task like validation should be, even in the simpliest scenarios I tested, I really give up. Please give me some hint on where to look for more.
Here is the code:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="Test" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" CdnSettings-TelerikCdn="Enabled" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" />
    <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" />
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
        <fieldset>
            <legend>Registration form</legend>
            <br/>
            <table border="0" cellpadding="5">
                <colgroup>
                    <col width="100"/>
                    <col width="500"/>
                </colgroup>
                <tr class="FormContainer">
                    <td>
                        Name:
                    </td>
                    <td>
                        <telerik:RadTextBox ID="RadTextBox1" runat="server"></telerik:RadTextBox>
                        <asp:RequiredFieldValidator ID="TextBoxRequiredFieldValidator" runat="server" Display="Dynamic"
                            ControlToValidate="RadTextBox1" ErrorMessage="The textbox can not be empty!"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr class="FormContainer">
                    <td>
                        Age:
                    </td>
                    <td>
                        <telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server" Type="Number" NumberFormat-DecimalDigits="0">
                        </telerik:RadNumericTextBox>
                        <asp:RequiredFieldValidator ID="NumercTextBoxRequiredFieldValidator" runat="server"
                            Display="Dynamic" ControlToValidate="RadNumericTextBox1" ErrorMessage="Please, select an year number!"></asp:RequiredFieldValidator>
                        <asp:RangeValidator ID="NumericTextBoxRangeValidator" runat="server" ControlToValidate="RadNumericTextBox1"
                            ErrorMessage="Year number should be a non negative less than 50." Display="Dynamic"
                            MaximumValue="50" MinimumValue="0" Type="Double"></asp:RangeValidator>
                    </td>
                </tr>
                <tr class="FormContainer">
                    <td valign="top">
                        Phone:
                    </td>
                    <td>
                        <telerik:RadMaskedTextBox ID="RadMaskedTextBox1" runat="server" Mask="(###)-######">
                        </telerik:RadMaskedTextBox>
                        <asp:RequiredFieldValidator Display="Dynamic" ID="MaskedTextBoxRequiredFieldValidator"
                            runat="server" ErrorMessage="Please, enter a phone number." ControlToValidate="RadMaskedTextBox1"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator Display="Dynamic" ID="MaskedTextBoxRegularExpressionValidator"
                            runat="server" ErrorMessage="Format is (###)-######" ControlToValidate="RadMaskedTextBox1"
                            ValidationExpression="\(\d{3}\)-\d{6}"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr class="FormContainer">
                    <td valign="top">
                        Email
                    </td>
                    <td>
                        <telerik:RadTextBox ID="Radtextbox2" runat="server"></telerik:RadTextBox>
                        <asp:RegularExpressionValidator ID="emailValidator" runat="server" Display="Dynamic"
                            ErrorMessage="Please, enter valid e-mail address." ValidationExpression="^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$"
                            ControlToValidate="Radtextbox2">
                        </asp:RegularExpressionValidator>
                        <asp:RequiredFieldValidator ID="Requiredfieldvalidator1" runat="server" Display="Dynamic"
                            ControlToValidate="Radtextbox2" ErrorMessage="Please, enter an e-mail!"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr class="FormContainer">
                    <td>
                        Hire Date:
                    </td>
                    <td>
                        <telerik:RadDateInput ID="RadDateInput1" runat="server" DateFormat="d" MinDate="01/01/1990"
                            MaxDate="01/01/3000"></telerik:RadDateInput>
                        <asp:RangeValidator ID="DateInputRangeValidator" runat="server" ControlToValidate="RadDateInput1"
                            ErrorMessage="Choose a date between 5th of January 2005 and 1st of September 2005"
                            Display="Dynamic" MaximumValue="2005-09-01-00-00-00" MinimumValue="2005-01-05-00-00-00"></asp:RangeValidator>
                        <asp:RequiredFieldValidator ID="PickerRequiredFieldValidator" runat="server" Display="Dynamic"
                            ControlToValidate="RadDateInput1" ErrorMessage="Please select a date"></asp:RequiredFieldValidator>
                    </td>
                </tr>
            </table>
            <br/>
            <br/>
            <asp:CheckBox ID="CheckBox1" runat="server" CssClass="CheckBox" Text="Client Side Validation" Checked="True"
                AutoPostBack="True"></asp:CheckBox>
            <br/>
            <br/>
            <asp:Button ID="Button1" runat="server" Text="Postback"></asp:Button>
            <input type="reset" value="Reset"/>
        </fieldset>
    </telerik:RadAjaxPanel>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"></telerik:RadAjaxLoadingPanel>
    </form>
</body>
</html>

The VB code is taken exactly from your example as well:

Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
 
Partial Public Class test
    Inherits System.Web.UI.Page
    Private Sub CheckBox1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
        MaskedTextBoxRequiredFieldValidator.EnableClientScript = CheckBox1.Checked
        DateInputRangeValidator.EnableClientScript = CheckBox1.Checked
        PickerRequiredFieldValidator.EnableClientScript = CheckBox1.Checked
        TextBoxRequiredFieldValidator.EnableClientScript = CheckBox1.Checked
        NumercTextBoxRequiredFieldValidator.EnableClientScript = CheckBox1.Checked
        MaskedTextBoxRegularExpressionValidator.EnableClientScript = CheckBox1.Checked
        NumericTextBoxRangeValidator.EnableClientScript = CheckBox1.Checked
        Requiredfieldvalidator1.EnableClientScript = CheckBox1.Checked
        emailValidator.EnableClientScript = CheckBox1.Checked
    End Sub
End Class

Thanks in advance... I really had other frustrating similar issues that went on for hours, but finally come to spot a solution. This time I'm really knocked down.

EDIT: as a side note I tryed an even more "minimalistic" test wit .NET script manager instead of RadScriptManager and it works perfectly. Checking in the Google js console for alert(Page_Validators.lenght); also returns correctly: 1
So the issue must be somewhere in the RadScriptManager OR in the RadAjax solution I guess.
This is the code:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test2.aspx.vb" Inherits="test2" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:TextBox ID="test" runat="server"></asp:TextBox>
            <asp:RequiredFieldValidator ID="TextBoxRequiredFieldValidator" runat="server" Display="Dynamic"
                ControlToValidate="test" ErrorMessage="The textbox can not be empty!"></asp:RequiredFieldValidator>
            <asp:Button ID="but" runat="server" Text="submit" />
        </div>
    </form>
</body>
</html>

Allen
Top achievements
Rank 2
Iron
Veteran
 answered on 19 Aug 2019
5 answers
253 views

Hello, I'm trying to do something pretty straightforward, I'd like to remove the filter parameters from my grid results when clearing the two datepickers from the griddatetime column daterange filter. Example (From: 01/01/2015 To: 02/01/2015....results in data between that date range, If I were to clear the two datepickers, the grid does not return ALL records nor does it even do a postback like any other filter types that get cleared.

 

Here is my markup.

<telerik:GridDateTimeColumn DataField="AssignedDate" DataType="System.DateTime"   DataFormatString="{0:d}" FilterControlAltText="Filter AssignedDate column" HeaderText="Assigned Date" SortExpression="AssignedDate" EnableRangeFiltering="true" PickerType="DatePicker" UniqueName="AssignedDate" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
 <HeaderStyle  HorizontalAlign="Center" Width="300px" />
<ItemStyle   HorizontalAlign="Center" />
</telerik:GridDateTimeColumn>

Eyup
Telerik team
 answered on 19 Aug 2019
1 answer
116 views

Hi,

I am updating some old telerik components to a newer version, now I downloaded the latest version of the "vista" skin and set my preferred color in one of the components and pressed saved all. It looked like all the sprite where converted the asked color set. However the only sprites which don't seem to have the correct color are the ones in the "common" folder, they are still the default color of the theme "blueish". How do I obtain the sprites in the common folder for my preferred color?

Attila Antal
Telerik team
 answered on 16 Aug 2019
4 answers
164 views

When I am using the statistics module I'm getting a completely different character count than when I process the content on the backend using controlName.Content.  When comparing the text, the content I receive on the backend is processed with paragraph tags instead of line breaks where the content on the front end is not.

Is there a way to get an accurate count of characters on the front end?  Because my customer is complaining that the statistics module says they have 34 characters left when our back-end validation is showing they are over by a few characters.

The first characters in the text processed by the backend is "<p>".  This does not appear at all in the front-end validation text string.

Danielle
Top achievements
Rank 1
 answered on 16 Aug 2019
3 answers
74 views
Is it possible For displaying the message in radfileexplorer while create the folder name as exisiting folder. want to show my custom message and disble the default message (An object with the same name already exists in this directory!).
Vessy
Telerik team
 answered on 16 Aug 2019
12 answers
2.7K+ views
Can anyone tell me how to align the button text to the left instead of center?  I don't see any properties to manipulate that.

Thanks!
Attila Antal
Telerik team
 answered on 16 Aug 2019
3 answers
279 views
What's the most straightforward way to make a RadButton CheckBox show its checkbox to the right of the text instead of to the left?  I see a few examples that use right-to-left and setting of toggle states, but these all seem way too complicated for such a simple thing.
Attila Antal
Telerik team
 answered on 16 Aug 2019
5 answers
283 views
Hi there,

I am looking for some advice on the best way to go forward with adding a new custom skin to our project. We are looking to modify the built-in bootstrap skin to match our bootstrap customisation. We would like to be able to:
- Build from scss - so we can use the same scss variables etc we use for our bootstrap customisation
- Have a good way to merge updates to the built-in bootstrap skin into our custom skin so that if controls are added or changed we can easily keep our skin up to date

So far we have come up with the following workflow:
- Create a new skin repository containing the Bootstrap and Common folders from the Telerik Skin Source
- Create a branch off that repository and rename and modify the Bootstrap with our customisations
- Add a build task to compile the sass and place in zip along with the image folders in the Bootstrap folders
- Pass through the skins assembly builder to create a dll to include in our web application

This approach means when there is an update to the telerik controls we can update the master of the skin repository with the changes, and then merge out to the skin branch and resolve any conflicts.

The issue we are running into is that the compiled SASS from the telerik source has already subbed out the image url references with WebResource tags, so we cannot then pass through the Skin's Assembly builder without error.

We are looking for some advice on this, so far the ideas we have come up with are:
1. Updated our scss build task to add a job to revert the WebResource entries back to their url counterparts (so they can then be converted back in the Skin's Assembly Builder)
2. Obtain the source of the Skin's Assembly Builder and remove the parts that sub out the urls with WebResource entries.

The second option is the preferred and we had a look at the source provided by Alain in this post: http://www.telerik.com/forums/tool-for-embedding-custom-skins-into-an-assembly
Unfortunately it does not seem to be up to date as even running output through it straight from the Visual Style Builder does not produce valid css in the dll.

Is there another obvious way to carry out a task such as this? and is the source for the Skin's Assembly Builder available anywhere?

Kind Regards,
Daniel
Attila Antal
Telerik team
 answered on 16 Aug 2019
1 answer
95 views
1 answer
644 views

We are upgrading visual studio 2010 solution using Telerik (v 2012.2.607) controls to visual studio 2017. I have a doubt that after upgrading the solution to visual studio 2017, will telerik controls of old version works or not?

If incase, it works then for that do I need to make any changes in that?

If not, please provide the alternate solution to get the upgraded solution work.

Also, will it get impacted if I upgrade the .Net framework version to some latest.

 

Thanks in advance.

Yana
Telerik team
 answered on 16 Aug 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?