<!-- 6th --> <div id="info6" class="cl dn"> <MembInfo:MembershipInfo ID="MembershipInfoRegular" runat="server" BillQuaterly ='<%# Bind("BillQuaterly") %>' IsMember ='<%# Bind("IsMember") %>' PaymentMethod='<%# Bind("PaymentMethod") %>' StartDate ='<%# Bind("StartDate") %>' /> </div> <!-- /6th -->and this is my UserControl:
using System; using System.Collections; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.ComponentModel; public partial class Coordinator_UCD_MembershipInfo : System.Web.UI.UserControl { #region Custom Properties /// /// <summary>The EditMode property is responsible for the Enabled style of the controls</summary> /// private bool editMode ; [Description("The EditMode property is responsible for the Enabled style of the controls"), DefaultValue(true),Category("User-Defined")] public bool EditMode { get { return editMode ; } set { editMode = value; clseditmode.SetEnabled(this.Controls, value); } } [Bindable(true, BindingDirection.TwoWay), Category("User-Defined"),DefaultValue(false),Description("Is User a Member?") ] public bool? IsMember { get { return this.chkIsMember.Checked; } set { this.chkIsMember.Checked = Convert.ToBoolean(value); } } [Bindable(true, BindingDirection.TwoWay), Category("User-Defined"), DefaultValue(false), Description("Bill Quaterly?") ] public bool? BillQuaterly { get { return this.chkBillQuaterly.Checked; } set { this.chkBillQuaterly.Checked = Convert.ToBoolean(value); } } [Bindable(true, BindingDirection.TwoWay), Category("User-Defined"), DefaultValue(""), Description("Payment Method") ] public string PaymentMethod { get { return this.ddlPaymentMethod.SelectedValue; } set { this.ddlPaymentMethod.SelectedValue = value; } } [Bindable(true, BindingDirection.TwoWay), Category("User-Defined"), Description("Membership Begin Date") ] public DateTime? StartDate { get { return Convert.ToDateTime(this.txtMembershipStartDate.Text) ; } set { this.txtMembershipStartDate.Text = (Convert.ToDateTime(value)).ToShortDateString() ; } } #endregion protected void Page_Load(object sender, EventArgs e) { } }I'm not sure what should I do to make it work correctly with NULLs. I tried to change data types to be nullable, but this didn't help.