gormit
gormit

Reputation: 807

asp.net - Disable some content during certain period of time

I want to change my content for example since 15:00 until 17:00. Disable labels or something like that. What can I use to do that?

Upvotes: 1

Views: 187

Answers (1)

Brian Webster
Brian Webster

Reputation: 30865

VB.NET

If DateTime.Now >= New DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 15, 0, 0) AndAlso DateTime.Now <= New DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 17, 0, 0) then
   MyPanel.Visible = false
End If

Contain the UI Elements, such as labels, that you want to hide within MyPanel.

Upvotes: 1

Related Questions