Hello,
I am trying to print current date on repeater control .Date should be print on Label .Date is not from DataBase
I find control i.e. Label but not work my code is..
DateTime dt = DateTime.Now;
Label lbl = Repeater1.FindControl("lblcurrentdate") as Label;
lbl.Text = String.Format("{0:dd/MM/yyyy}", dt);
Label lbl = Repeater1.FindControl("lblcurrentdate") as Label;
lbl.Text = String.Format("{0:dd/MM/yyyy}", dt);

Prasham SabadraRank #116 · 19.3K reputationPosted Feb 14, 2015, 7:30 PM EST
Please have a look once following link:
http://stackoverflow.com/questions/275194/formatting-databinder-eval-data
jeet gupta38 reputationPosted Feb 18, 2015, 9:26 PM EST
You can use like this way also to print date in label.
Label lbl = Repeater1.FindControl("lblcurrentdate") as Label;
lbl.Text = DateTime.Now.ToString("dd-MM-yyyy");