Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 current datetime

Author  Topic 

yvette
Yak Posting Veteran

74 Posts

Posted - 2010-10-17 : 08:10:45
Hi,
i have a label name lblTime.
i want to display current datetime to lblTime in my master page.
How to do that??
thanks..

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-10-17 : 09:13:28
use System.DateTime.Now

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2010-10-17 : 11:09:31
or DateTime.UtcNow for utc time


elsasoft.org
Go to Top of Page

yvette
Yak Posting Veteran

74 Posts

Posted - 2010-10-17 : 22:38:54
Thanks for reply..

but i try in page load, it have error.


Cannot implicitly convert type 'System.DateTime' to 'DevExpress.Web.ASPxEditors.ASPxLabel'


Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2010-10-18 : 00:54:51
yourlabel.text=System.DateTime.Now.ToString()



PBUH

Go to Top of Page

yvette
Yak Posting Veteran

74 Posts

Posted - 2010-10-18 : 10:30:28
Sorry for tell you that, it still have error..

i try lblTime.text = System.DateTime.Now.ToString(); in page load of my master page.

error:


'DevExpress.Web.ASPxEditors.ASPxLabel' does not contain a definition for 'text' and no extension method 'text' accepting a first argument of type 'DevExpress.Web.ASPxEditors.ASPxLabel' could be found (are you missing a using directive or an assembly reference?)
Go to Top of Page

jafrywilson
Constraint Violating Yak Guru

379 Posts

Posted - 2010-10-19 : 01:03:43
Try this..

lblTime.Text = DateTime.Now.ToString();
Go to Top of Page
   

- Advertisement -