我有以下代码:
Reference.svcmap: Inheritance security rules violated by type: 'DotNetNuke.Services.Localization.LocalizationExpressionBuilderEditor'. Derived types must either match the security accessibility of the base type or be less accessible.
我不想说输入信息,而是根据我后面的代码中的某些条件动态更改文本。
我在ItemCommand后面的代码中尝试了以下内容:
<telerik:GridTemplateColumn >
<ItemTemplate>
<asp:LinkButton ID="lnkBtn" runat="server" CommandName="OpWin" CommandArgument='<%# Eval("OrgId").ToString() %>'></asp:LinkButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
答案 0 :(得分:1)
我没有亲自使用Telerik,但大多数(基于模板的).NET控件都有类似&#34; ItemCreated&#34; (或&#34; RowCreated&#34;)您可以通过执行以下操作来运行逻辑并更改按钮的文本:
private void OnItemCreated(object sender, ItemCreatedEventArgs e)
{
LinkButton btn = (e.Item.FindControl("LinkButtonName") as LinkButton);
if(btn != null)
{
// Logic to determine button text.
btn.Text = "Whatever";
}
}