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

RadInputManager validation

1 Answer 86 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Kris asked on 05 Aug 2010, 08:55 AM

I'm trying to test validation with RadInputManager.
I found an issue with server validation when RadInputManager is added programmatically.

Here the code :
<%@ Page Language="VB" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<script runat="server">
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
        Dim InputMgr As RadInputManager = New RadInputManager
        InputMgr.ID = "RadInputManager1"
        InputMgr.Skin = "Vista"
        ' KO
        dim oTextBoxSetting as TextBoxSetting = new TextBoxSetting
        oTextBoxSetting.TargetControls.Add(New TargetInput(TextBox1.UniqueID, True))
        oTextBoxSetting.Validation.IsRequired = True
        oTextBoxSetting.ErrorMessage = "Text is required !"
        ' OK
    End Sub
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    <head id="Head1" runat="server">
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>Test RadInputManager Validation</title>
        <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server" />
            <asp:TextBox ID="TextBox1" runat="server" />
            <asp:Button ID="btnSubmit" runat="server" text="Submit" />
            <asp:ValidationSummary runat="server" ShowMessageBox="true" ToolTip="Must type in textbox!" HeaderText="Header Text" />        

When i add InputManager at the end of the method, it's works fine. (OK comment)
Also if it is added before settings, it's not works. (KO comment)

So, why and is it normal please ?


1 Answer, 1 is accepted

Sort by
Nikolay Rusev
Telerik team
answered on 09 Aug 2010, 04:04 PM
Hello Kris,

This is expected behavior and is caused because on Init event of RadInputManager it iterates through it's settings and builds validators for per setting.

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
Asked by
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question