Radiobuttonlist performing a full postback

7 posts, 0 answers
  1. MBEN
    MBEN avatar
    159 posts
    Member since:
    Nov 2011

    Posted 13 May 2015 Link to this post

    Hi,

    I have a radtabstrip which has sercontrols in it's pageview.

    On the usercontrol I have a radiobuttonlist and I want to update a textbox on selection of a radiobutton. Howevere, the code is performing a full postback.

    Below is my code.

    ASCX:

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucElection.ascx.cs"
        Inherits="enrollment_ucElection" %>
    <telerik:RadAjaxManagerProxy ID="RadAJAXManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="_ElectionsOptions">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Panel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
    </asp:ScriptManagerProxy>
     
    <table >
        <tr>
            <td>    
                        <asp:RadioButtonList ID="_ElectionsOptions" runat="server" RepeatDirection="Vertical" AutoPostBack="true" OnSelectedIndexChanged="_ElectionsOptions_SelectedIndexChanged"
                            RepeatLayout="Flow" />
                     
                    <asp:Panel ID="Panel1" runat="server" >
                        <telerik:RadNumericTextBox ID="txtBuyUpPercent" Type="Percent" runat="server">
                            <NumberFormat DecimalDigits="0" />
                        </telerik:RadNumericTextBox>  (max 10%). 
                    </asp:Panel>           
            </td>
        </tr>
    </table>

    .CS:

    protected void _ElectionsOptions_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (_deferralElectionsOptions.SelectedIndex == 0)
            {
                txtBuyUpPercent.ReadOnly = true;
                txtBuyUpPercent.Text = "";
            }
            else
            {
                txtBuyUpPercent.ReadOnly = false;
            }
        }

     Content ASPX page:

    <%@ Page Language="C#" MasterPageFile="~/enrollment/enrollmentWizard.master" AutoEventWireup="true"
        CodeFile="ELIP.aspx.cs" Inherits="enrollment" Title="Enrollment" %>
     
    <%@ Register TagPrefix="iSys" TagName="insuranceApplication" Src="~/enrollment/ucInsuranceApplication.ascx" %>
    <%@ Register TagPrefix="iSys" TagName="deferralElections" Src="~/enrollment/ucElection.ascx" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
        <div>
            <telerik:RadTabStrip ID="rtsEnrollment" runat="server" MultiPageID="rmpEnrollment"
                OnTabClick="rtsEnrollment_TabClick" SelectedIndex="0" CausesValidation="true"
                 AutoPostBack="true">
                <Tabs>
                    <telerik:RadTab Text="Deferral Election" PageViewID="ElectionsTab"></telerik:RadTab>
                    <telerik:RadTab Text="Insurance Application" PageViewID="insuranceApplicationTab"></telerik:RadTab>
                </Tabs>
            </telerik:RadTabStrip>
            <telerik:RadMultiPage ID="rmpEnrollment" runat="server" OnPreRender="rmpEnrollment_PreRender" RenderSelectedPageOnly="true">
                <telerik:RadPageView runat="server" ID="ElectionTab" Selected="true">
                    <iSys:deferralElections ID="ucElection" runat="server" />
                </telerik:RadPageView>
               <telerik:RadPageView runat="server" ID="insuranceApplicationTab">
                    <iSys:insuranceApplication ID="ucInsuranceApplication" runat="server" />
                </telerik:RadPageView>
            </telerik:RadMultiPage>
        </div>
    </asp:Content>

    RADAjaxManager is declared on the master Page file.

    Please suggest what am I doing wrong.

  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 14 May 2015 Link to this post

    Hi,

    Please try to add the RadioButtonList to update itself in the RadAjax settings like this:

    <telerik:RadAjaxManagerProxy ID="RadAJAXManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="_ElectionsOptions">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Panel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
    <telerik:AjaxSetting AjaxControlID="_ElectionsOptions">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="_ElectionsOptions" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
     
    and see how it goes.


    Regards,
    Maria Ilieva
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. MBEN
    MBEN avatar
    159 posts
    Member since:
    Nov 2011

    Posted 14 May 2015 in reply to Maria Ilieva Link to this post

    I tried that but it's still causing a full postback.

  5. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 18 May 2015 Link to this post

    Hello,

    Can you please ensure that the ScriptManger control is placed on the main page before the RadAjaxManager declaration? In case it is declared after the RadAjaxManager the ajax control can not register its scripts and doe snot works properly.

    Regards,
    Maria Ilieva
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  6. MBEN
    MBEN avatar
    159 posts
    Member since:
    Nov 2011

    Posted 18 May 2015 in reply to Maria Ilieva Link to this post

    Yes on the main page the scriptmanager is declared before the AJAXManager declaration. Any other ideas?

    <telerik:RadScriptManager ID="Scriptmanager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManagerMain" runat="server">
    </telerik:RadAjaxManager>     

  7. MBEN
    MBEN avatar
    159 posts
    Member since:
    Nov 2011

    Posted 18 May 2015 in reply to MBEN Link to this post

    I have submitted a working sample in a support ticket regarding this.

    The support ticket ID : 936495

  8. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 19 May 2015 Link to this post

    Hello,

    Thank you for your cooperation. I will check the project in the ticket and will get back to you with my findings as soon as possible.

    Regards,
    Maria Ilieva
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017