CheckBox Checked value in RadWindow

2 posts, 0 answers
  1. Anders
    Anders avatar
    30 posts
    Member since:
    Jul 2013

    Posted 10 Sep 2013 Link to this post

    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

  2. Anders
    Anders avatar
    30 posts
    Member since:
    Jul 2013

    Posted 10 Sep 2013 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top