我根本不是一个ASP程序员。我只是想通过在现有的AbleCommerce页脚中添加动态版权日期来帮助朋友。我当前的代码没有导致错误,但也没有输出:
StoreFooter.ascx
<asp:Literal runat="server" ID="thisYear"></asp:Literal>StoreFooter.ascx.cs
protected void Page_Load(object sender, EventArgs e)
{
AdminLink.Visible = AbleContext.Current.User.IsAdmin;
MobileLinkPanel.Visible = Request.Browser.IsMobileDevice;
MobileStoreLink.NavigateUrl = NavigationHelper.GetMobileStoreUrl("~/Default.aspx?FSIntent=false");
int thisYearInt = LocaleHelper.LocalNow.Year;
thisYear.Text = thisYearInt.ToString();
}还尝试将日期设置为DateTime.Now.Year。有人能看到我错过了什么吗?如果我给thisYear.Text赋值一个字符串,我也得不到任何输出。
发布于 2014-06-28 04:36:26
使用Label控件而不是文字。试一试
<asp:Label runat="server" ID="thisYear"></asp:Label>https://stackoverflow.com/questions/21168795
复制相似问题