1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Adding Date to Footer without Custom Module

Adding Date to Footer without Custom Module

3 posts, 0 answered
  1. briankb
    briankb avatar
    56 posts
    Registered:
    23 Feb 2004
    04 Dec 2007
    Link to this post
    I tried to modify the default.master to have the current year for the copyright year by adding the following.

    <table width=100border=0><tr><td align="left"><%Response.Write(DateTime.Now.Year);%> &copy; BLah. All rights reserved.</td><td align="right">Site Design by Us</td></tr></table> 

    of course as soon as I did it gave the error about the control having code blocks. Is there a way to do this without making a custom control and without the code blocks?

  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    04 Dec 2007
    Link to this post
    Hi Brian,

    For example you could achieve the required functionality as follows:

           <table width="100%" border="0"
               <tr> 
                   <td align="left"><asp:Literal ID="Year" runat="server"></asp:Literal>&copy; BLah. All rights reserved.</td> 
                   <td align="right">Site Design by Us</td> 
               </tr> 
           </table> 
           <script runat="server"
               protected void Page_Load(object sender, EventArgs e) 
               { 
                   this.Year.Text = DateTime.Now.Year.ToString(); 
               } 
           </script> 

    Hope this is helpful.

    All the best,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. briankb
    briankb avatar
    56 posts
    Registered:
    23 Feb 2004
    04 Dec 2007
    Link to this post
    Fantastic! I added it and it works as expected. Thanks a ton. I've been using .net for a while now but simple stuff like this still baffle me.
Register for webinar
3 posts, 0 answered