Problem While use RequiredFieldValidator & AjaxUpdatedControls

8 posts, 0 answers
  1. Prabha
    Prabha avatar
    26 posts
    Member since:
    Dec 2013

    Posted 25 Dec 2013 Link to this post

    hai All,

             I have used a page with "RequiredFieldValidator" . And also i need to use AjaxUpdatedControls for avoid reload entire page. 
          <rad:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <rad:AjaxSetting AjaxControlID="SaveBtn">
                <UpdatedControls>
                    <%--  <rad:AjaxUpdatedControl ControlID="namevalidate" />
                </UpdatedControls>
            </rad:AjaxSetting>
    </rad:RadAjaxManager>

      <rad:RadTextBox ID="rtxtname" runat="server" Width="120px">
                </rad:RadTextBox>
                <asp:RequiredFieldValidator ID="namevalidate
    " ControlToValidate="rtxtmoctypename"
                    runat="server" ErrorMessage="MOC Type Name is required" Display="Static">*</asp:RequiredFieldValidator>
       <asp:Button ID="SaveBtn" runat="server" CssClass="FormButton" Text="Save" Width="59px"
                    CommandName="Insert" OnClick="SaveBtn_Click" />
    Even i will give data in the  rtxtname, the error message coming. what to do for that?
  2. Eyup
    Admin
    Eyup avatar
    3012 posts

    Posted 25 Dec 2013 Link to this post

    Hello Prabha,

    I have created a sample RadGrid web site to test the described behavior. Can you please run the attached application and verify that it works as expected on your side, too?

    Regards,
    Eyup
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Prabha
    Prabha avatar
    26 posts
    Member since:
    Dec 2013

    Posted 09 Jan 2014 Link to this post

    hai Eyup ,

         Thank you for your reply. Actually i my problem is in Popup screens. In Popup(using RadWindowManager) only the page blinking is happens. And also that popup controls are placed in .ascx page. That is , .aspx page refer an .ascx which is my popup.

    My coding is(.ascx):
    ----------------------------------------
    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AddMOCActionItem.ascx.cs"
        Inherits="Sampige.Web.iprocessWebPortal.MOC.Administration.UserControls.AddMOCActionItem" %>
    <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="false"
        HeaderText="The following error(s) have occurred:" ShowSummary="true" />
    <rad:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </rad:RadScriptManager>
    <rad:RadAjaxManager ID="RadAjaxManager1" runat="server" UpdatePanelsRenderMode="Inline">
        <AjaxSettings>
            <rad:AjaxSetting AjaxControlID="SaveBtn">
                <UpdatedControls>
                    <rad:AjaxUpdatedControl ControlID="rtxtmocactionitem" />
                </UpdatedControls>
            </rad:AjaxSetting>
        </AjaxSettings>
    </rad:RadAjaxManager>

    <table class="form" cellspacing="1" cellpadding="1" border="0" style="width: 100%">
        <tr>      
            <td>
                <rad:RadTextBox ID="rtxtmocactionitem" runat="server" TextMode="MultiLine" Width="200px"
                    MaxLength="2000">
                </rad:RadTextBox>
                <asp:RequiredFieldValidator ID="mocactionitemValidator" ControlToValidate="rtxtmocactionitem"
                    runat="server" ErrorMessage="Workflow Action Item is required" Display="Static">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td colspan="4" align="center">
                <asp:Button ID="SaveBtn" runat="server" CssClass="FormButton" Text="Save" Width="59px"
                    OnClick="SaveBtn_Click" />        
            </td>
        </tr>
    </table>
    -------------------------------------------------------------------
    still im getting blinking of the screen.

  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 09 Jan 2014 Link to this post

    Hi Prabha,

    Please have a look into the following code snippet which works fine at my end.

    ASPX:
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <telerik:RadButton ID="RadButton1" AutoPostBack="false" runat="server" Text="show window"
        OnClientClicked="click">
    </telerik:RadButton>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        <Windows>
            <telerik:RadWindow ID="RadWindow1" runat="server">
                <ContentTemplate>
                    <uc1:WebUserControl4 ID="WebUserControl41" runat="server" />
                </ContentTemplate>
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
    </telerik:RadWindow>

    JavaScript  in ASPX page:
    <script type="text/javascript">
        function click(sender, args) {
            var win = $find("<%=RadWindow1.ClientID %>");
            win.Show();
        }
    </script>

    ASCX:
    <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="false"
        HeaderText="The following error(s) have occurred:" ShowSummary="true" />
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="SaveBtn">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rtxtmocactionitem" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <table class="form" cellspacing="1" cellpadding="1" border="0" style="width: 100%">
        <tr>
            <td>
                <telerik:RadTextBox ID="rtxtmocactionitem" runat="server" TextMode="MultiLine" Width="200px"
                    MaxLength="2000">
                </telerik:RadTextBox>
                <asp:RequiredFieldValidator ID="mocactionitemValidator" ControlToValidate="rtxtmocactionitem"
                    runat="server" ErrorMessage="Workflow Action Item is required" Display="Static">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td colspan="4" align="center">
                <asp:Button ID="SaveBtn" runat="server" CssClass="FormButton" Text="Save" Width="59px" />
            </td>
        </tr>
    </table>

    Let me know if you have any concern.
    Thanks,
    Shinu.
  6. Prabha
    Prabha avatar
    26 posts
    Member since:
    Dec 2013

    Posted 22 Jan 2014 Link to this post

    How can we use required field validator on User Control in aspx page?
  7. Eyup
    Admin
    Eyup avatar
    3012 posts

    Posted 27 Jan 2014 Link to this post

    Hello Prabha,

    You can set the ControlToValidate property of the RequiredFieldValidator programmatically:
    protected void Page_Init(object sender, EventArgs e)
    {
        WebUserControlSample userControl = Page.LoadControl("~/WebUserControlSample.ascx") as WebUserControlSample;
        Form.Controls.Add(userControl);
        RequiredFieldValidator1.ControlToValidate = userControl.FindControl("TextBox1").UniqueID;
    }

    Hope this helps.

    Regards,
    Eyup
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  8. Prabha
    Prabha avatar
    26 posts
    Member since:
    Dec 2013

    Posted 28 Jan 2014 Link to this post

    Hi All,

         Is it possible to assign multiple value field/tag for a node in Radtreeview? i had try with Attribute property but does not like what i need. is there any other property for this ?
  9. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 31 Jan 2014 Link to this post

    Hello Prabha,

    Using the AttributesCollection of a certain node is the correct approach to persist additional information (multiple values) of the Node. Could you elaborate a bit more on your scenario and on the issue you had faced, using the AttributesCollection?

    Regards,
    Nencho
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017