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

Radiobuttonlist performing a full postback

6 Answers 173 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
MBEN
Top achievements
Rank 2
Veteran
MBEN asked on 13 May 2015, 08:31 PM

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.

6 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 14 May 2015, 06:44 AM
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
0
MBEN
Top achievements
Rank 2
Veteran
answered on 14 May 2015, 04:04 PM

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

0
Maria Ilieva
Telerik team
answered on 18 May 2015, 06:57 AM
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
0
MBEN
Top achievements
Rank 2
Veteran
answered on 18 May 2015, 05:52 PM

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>     

0
MBEN
Top achievements
Rank 2
Veteran
answered on 18 May 2015, 09:18 PM

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

The support ticket ID : 936495

0
Maria Ilieva
Telerik team
answered on 19 May 2015, 08:23 AM
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
Tags
Ajax
Asked by
MBEN
Top achievements
Rank 2
Veteran
Answers by
Maria Ilieva
Telerik team
MBEN
Top achievements
Rank 2
Veteran
Share this question
or