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

RadioButton not firing OnCheckedChanged in ajax

1 Answer 213 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Mattias Jöraas
Top achievements
Rank 1
Mattias Jöraas asked on 09 Jun 2011, 02:23 PM
I got 3 radiobuttons who all are linked to execute the same OnCheckedChanged command when they are selected, here is my code:
<asp:RadioButton ID="RadioButtonWork" runat="server" Checked="true" GroupName="Invoice" AutoPostBack="true" OnCheckedChanged="RadioButtonsInvoice_OnCheckedChange" />
<asp:RadioButton ID="RadioButtonInvoice" runat="server" Checked="false" GroupName="Invoice" AutoPostBack="true" OnCheckedChanged="RadioButtonsInvoice_OnCheckedChange" />
<asp:RadioButton ID="RadioButtonHome" runat="server" Checked="false" GroupName="Invoice" AutoPostBack="true" OnCheckedChanged="RadioButtonsInvoice_OnCheckedChange" />

They do work as they should when i have put my RadAjaxManager to not enable Ajax.
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnableAJAX="false">...</telerik:RadAjaxManager>

Rad Ajax settings
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadioButtonWork">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="PlaceHolderInvoiceAddress" />
                <telerik:AjaxUpdatedControl ControlID="PlaceHolderHomeAddress" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="RadioButtonInvoice">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="PlaceHolderInvoiceAddress" />
                <telerik:AjaxUpdatedControl ControlID="PlaceHolderHomeAddress" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="RadioButtonHome">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="PlaceHolderInvoiceAddress" />
                <telerik:AjaxUpdatedControl ControlID="PlaceHolderHomeAddress" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>

But when i enable ajax, the default radiobutton (checked="true") never fire the event. Why is this ?
We are using Telerik.Web.UI version 2011.1.315.40.
Also worth mentioning is that this is inside a usercontrol, thats why the proxy control is used and not a managager for ajax.

1 Answer, 1 is accepted

Sort by
0
Fortune
Top achievements
Rank 1
answered on 09 Jun 2011, 06:48 PM
Hi, Mattias

Try using following RadAjaxManagerProxy settings:
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadioButtonWork">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="PlaceHolderInvoiceAddress" />
                    <telerik:AjaxUpdatedControl ControlID="PlaceHolderHomeAddress" />
                    <telerik:AjaxUpdatedControl ControlID="RadioButtonInvoice" />
                    <telerik:AjaxUpdatedControl ControlID="RadioButtonHome" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadioButtonInvoice">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="PlaceHolderInvoiceAddress" />
                    <telerik:AjaxUpdatedControl ControlID="PlaceHolderHomeAddress" />
                      <telerik:AjaxUpdatedControl ControlID="RadioButtonWork" />
                    <telerik:AjaxUpdatedControl ControlID="RadioButtonHome" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadioButtonHome">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="PlaceHolderInvoiceAddress" />
                    <telerik:AjaxUpdatedControl ControlID="PlaceHolderHomeAddress" />
                    <telerik:AjaxUpdatedControl ControlID="RadioButtonWork" />
                    <telerik:AjaxUpdatedControl ControlID="RadioButtonInvoice" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>

Regards,
F




Tags
Ajax
Asked by
Mattias Jöraas
Top achievements
Rank 1
Answers by
Fortune
Top achievements
Rank 1
Share this question
or