我尝试在ASP.NET中的文本框占位符标记中使用Kentico CMS帮助程序,但它不起作用。当我尝试编译它时,我获得了错误:“当前上下文中不存在名称txtPassword”。
你能解释一下为什么我不能这样用吗?我该怎么做?
<asp:TextBox ID="txtPassword" runat="server" TextMode="Password" placeholder="'<%# CMS.GlobalHelper.ResHelper.GetString("Account.Password") %>'" AutoCompleteType="None"></asp:TextBox>
答案 0 :(得分:0)
假设您正在使用此
进行数据绑定控制上下文placeholder='<%# CMS.GlobalHelper.ResHelper.GetString("Account.Password") %>'
注意我已删除了外"
如果您不在数据绑定上下文中,请将#
替换为=
placeholder='<%= CMS.GlobalHelper.ResHelper.GetString("Account.Password") %>'