コード例 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         CounterValue    = StartValue;
         lblCounter.Text = CounterValue.ToString();
     }
 }
コード例 #2
0
        public CounterBox()
        {
            InitializeComponent();

            CounterValue = DefaultValue;

            CounterTextBox.SetBinding(TextBox.TextProperty, new Binding("CounterText")
            {
                Source = this,
                Mode   = BindingMode.TwoWay
            });
            CounterTextBox.Text = CounterValue.ToString();
        }
コード例 #3
0
 protected void btnDecrement_Click(object sender, EventArgs e)
 {
     CounterValue--;
     lblCounter.Text = CounterValue.ToString();
 }