Validation problem when use RadAjaxManagerProxy on content page

5 posts, 0 answers
  1. Sagar
    Sagar avatar
    17 posts
    Member since:
    Sep 2010

    Posted 22 Sep 2011 Link to this post

    On my content page if I remove RadAjaxManagerProxy control then validations for controls on save button click works properly.but if I insert RadAjaxManagerProxy ,save button click does not validate any control.It comes to sever side save button click event.
    I read about Page_ClientValidate() or Page_IsValid but it is not working.
    Can u plz help me?
    Sample code is as below -

    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="mvEmployment">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="mvEmployment" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="rgPrepaidBenefits">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rgPrepaidBenefits" />
                    </UpdatedControls>
                </telerik:AjaxSetting>              
            </AjaxSettings>
        </telerik:RadAjaxManagerProxy>

    Control to validate on Save button click -

    <asp:TextBox ID="txtEmployer" CausesValidation="true" MaxLength="50" runat="server"
                                Width="200px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="rfvEmployer" runat="server" ControlToValidate="txtEmployer"
                                ErrorMessage="Please Enter The Name" ToolTip="Please Enter The Name" ValidationGroup="Validatetest"
                                Display="Dynamic">*</asp:RequiredFieldValidator>
                            <ajaxtoolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server"
                                TargetControlID="rfvEmployer">
                            </ajaxtoolkit:ValidatorCalloutExtender>
                            <asp:RegularExpressionValidator ID="revEmployer" runat="server" ErrorMessage="Please insert alphabets."
                                ControlToValidate="txtEmployer" ValidationExpression="^[a-zA-Z]+$" ValidationGroup="Validatetest"
                                Display="Dynamic" Text="*"></asp:RegularExpressionValidator>
                            <ajaxtoolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender5" runat="server"
                                TargetControlID="revEmployer">
                            </ajaxtoolkit:ValidatorCalloutExtender>

    Save Button -

     <asp:Button ID="rbtnSave" runat="server" CausesValidation="true"
                                Text="Save" ValidationGroup="Validatetest" OnClick="btnSave_Click" />
  2. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 22 Sep 2011 Link to this post

    hello,

    try with below code

      <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="rbtnSave">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="Panel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManagerProxy>


    or

      <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="Panel1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="Panel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManagerProxy>


    Note :put  textbox and their validators inside panel1.
    You can also put savebutton inside panle1

    Let me know if any concern.

    Thanks.
    Jayesh Goyani
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sagar
    Sagar avatar
    17 posts
    Member since:
    Sep 2010

    Posted 23 Sep 2011 Link to this post

    Hi Jayesh,
    Thanks for your rpy.but it is not working too.When I wrap my controls and there validators inside panel, it works weird.
    When I click on Save button for first time,it still goes to server side event.then panel automatically gets hide.when I again click on save button then it won't fire server side event.means from second time it works accordingly but panel is not visible.
  5. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 23 Sep 2011 Link to this post

    Hello Sagar,

    please provide your code.

    Thanks,
    Jayesh Goyani
  6. Sagar
    Sagar avatar
    17 posts
    Member since:
    Sep 2010

    Posted 24 Sep 2011 Link to this post

    Hi Jayesh,
    Thanks for rpy

    I figured it out.
    I used asp:MultiView named mvEmployment ,in my one View I've this text box and button.
    In RadAjaxManagerProxy I've mention mvEmployment that't why it's giving me problem. when I removed it,validation works as expected.

    but still I've one doubt
    How can I ajaxify Multiview and at the same time able to perform validations then?
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017