Xtreme Visual Basic Talk

Xtreme Visual Basic Talk (http://www.xtremevbtalk.com/)
-   ASP.Net (http://www.xtremevbtalk.com/asp-net/)
-   -   Display today's date in aspx tableheadercell (http://www.xtremevbtalk.com/asp-net/326607-display-todays-date-aspx-tableheadercell.html)

lroyce 11-21-2013 10:57 AM

Display today's date in aspx tableheadercell
 
I know there is a way to do this but it escapes me

I have a web form with an asp:table in it. The header cell displays "Visitor Log" and I would like to enter code to make it say "Visitor Log - (today's date)"

How do I do that?

Thanks in advance :)

JustinCase2 04-04-2014 05:25 AM

Well
 
If you can do this in codebehind, it is as simple as

Code:

Header.Text="Visitor Log " & DateTime.Now.ToString("dd.MM.yyyy")
You can set any date format you wish in Place of "dd.MM.yyyy".

If you need to do it in the html code, you can do something like:

Code:

HeaderText="Visitor Log <%# DateTime.Now.ToString('dd.MM.yyyy') %>"
I am not 100% sure of the syntax of that last part, but you should be able to figure it out from there.

lroyce 04-08-2014 07:24 AM

Thanks!
 
Works great! :)


All times are GMT -6. The time now is 04:52 AM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Optimisation provided by DragonByte SEO v2.0.15 (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
All site content is protected by the Digital Millenium Act of 1998. Copyright©2001-2011 MAS Media Inc. and Extreme Visual Basic Forum. All rights reserved.
You may not copy or reproduce any portion of this site without written consent.