Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get firing twice
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01166560
Message ID:
01168029
Views:
13
Just to update you all, it appears that overriding the ucs' "Text" property was the cause of my problem, I changed my property declaration from
public override string Text

to

public string xText
and obviously renamed all the references to "Text", and the "get" was correctly called only once, does anyone know why this should happen ? the functional code for the uc is shown below
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace CMSUserControls
{
    public partial class CMSUpdateDateTextBox : UserControl
    {
        public CMSUpdateDateTextBox()
        {
            InitializeComponent();
            this.xText = null;
        }

        private void btnUpdate_Click(object sender, EventArgs e)
        {
            this.xText = DateTime.Now.ToString("dd-MM-yy");
        }

        public string xText
        {
            get
            {
                DateTime dt;
                string s = null;
                try
                {
                    dt = DateTime.Parse(this.dtPicker.Text);
                    s = dt.ToString("yyyyMMdd");
                }
                catch
                {
                }
                return s;
            }
            set
            {
                this.dtPicker.Text = value;
            }
        }
   }
}
Regards,
Peter J. Kane



Pete
Previous
Reply
Map
View

Click here to load this message in the networking platform