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

Problem While use RequiredFieldValidator & AjaxUpdatedControls

7 Answers 148 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Prabha
Top achievements
Rank 1
Prabha asked on 25 Dec 2013, 06:22 AM
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?

7 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 25 Dec 2013, 07:43 AM
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.
0
Prabha
Top achievements
Rank 1
answered on 09 Jan 2014, 06:52 AM
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.

0
Shinu
Top achievements
Rank 2
answered on 09 Jan 2014, 08:32 AM
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.
0
Prabha
Top achievements
Rank 1
answered on 22 Jan 2014, 12:38 PM
How can we use required field validator on User Control in aspx page?
0
Eyup
Telerik team
answered on 27 Jan 2014, 10:34 AM
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.
0
Prabha
Top achievements
Rank 1
answered on 28 Jan 2014, 09:53 AM
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 ?
0
Nencho
Telerik team
answered on 31 Jan 2014, 09:10 AM
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.
Tags
Ajax
Asked by
Prabha
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Prabha
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Nencho
Telerik team
Share this question
or