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

CheckBox Checked value in RadWindow

1 Answer 149 Views
Window
This is a migrated thread and some comments may be shown as answers.
Anders
Top achievements
Rank 1
Anders asked on 10 Sep 2013, 08:21 AM
In a UserControl I have RadWindow with a CheckBox and RadButton - see attached image.
The UserControl sits in the sidebar contenplaceholder and is included in the RadAjaxManagerProxy control

<telerik:AjaxUpdatedControl ControlID="paSidebar" LoadingPanelID="raLoadingPanel"></telerik:AjaxUpdatedControl>

The code for the RadWindow:

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
    <telerik:RadWindow ID="modalPopup" runat="server" Width="400px" Height="275px" Title="Subscription" Modal="true">
        <ContentTemplate>
            <div style="padding: 0 8px 8px 8px;">
                <h2>Email messages from dealer network</h2>
                <p>You can here subscribe or unsubscribe to the dealer network mailings list.</p>
                <p>From the network mailings list you receive messages of used trucks for sale or request for a truck from your colleague.</p>
                <p>
                    <asp:CheckBox Text="Subscribed" runat="server" ID="cbSubscribed" />
                </p>
                <p>
                    <telerik:RadButton ID="buSaveSubscribtion" runat="server" Text="Save" OnClick="BuSaveSubscribtion_Click" />
                </p>
            </div>           
        </ContentTemplate>
    </telerik:RadWindow>   
</telerik:RadAjaxPanel>

In the OnClick of the button I read out the value of the CheckBox.Checked:

protected void BuSaveSubscribtion_Click(object sender, EventArgs e)
        {
            GetUserID();
            NMHG.Data.Truck_marketplace.Users.Users mailListUser = new NMHG.Data.Truck_marketplace.Users.Users();
            mailListUser.UserID = userID;
            mailListUser.MailMessages = cbSubscribed.Checked;
            mailListUser.Update2();
 
            if (mailListUser.Archived && cbSubscribed.Checked)
            {
                mailListUser.Archived = false;
                mailListUser.Archive();
            }
        }

But the value don't change if I check or uncheck the CheckBox.

Please help - What do I do wrong?

Thanks in advance 

Anders

1 Answer, 1 is accepted

Sort by
0
Anders
Top achievements
Rank 1
answered on 10 Sep 2013, 08:47 AM
Sorry,

I have solved my problem in some point. In the LoadPage I was overwriting the value again - Stupid, I was the !IsPostBack forgotten.

But that is of course not what I want a PostBack in an AJAX application. So I still need a solution for this.

Anders
Tags
Window
Asked by
Anders
Top achievements
Rank 1
Answers by
Anders
Top achievements
Rank 1
Share this question
or