protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         CounterValue    = StartValue;
         lblCounter.Text = CounterValue.ToString();
     }
 }
Exemplo n.º 2
0
        public CounterBox()
        {
            InitializeComponent();

            CounterValue = DefaultValue;

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