Last post Jul 15, 2008 12:00 PM by gerunddev
Jul 14, 2008 05:17 PM|suresh_dotnet|LINK
I just want to create webcustom control in which the textbox should display currentdate and time.While drag and drop that custom control on ASPX page the textbox which is placed on custom control should display current time.Can any one send
me code for the above task.
Thanks in advance
Jul 14, 2008 05:30 PM|gerunddev|LINK
Why do you need a custom control, why not just put a text box on your page and set it like:
public partial class _Default : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
TextBox1.Text = DateTime.Now.ToLongDateString();
Jul 15, 2008 04:42 AM|My Crystal|LINK
if i understand you correctly, you want to develop a custom text box server control which is used in many pages of your web site. when dragged on aspx page, the text box's show the current time. Right?
you just have to extend the TextBox, compile the following code into a assembly and then add it to the tool box in the VS.
public class ExTextBox : TextBox
base.Text = DateTime.Now.ToString();
Jul 15, 2008 12:00 PM|gerunddev|LINK
My Crystal that would be a good way to do it...
Give that man (or woman) some answer points [:)]