C# 以编程方式创建和显示Telerik RadNotification
我试图在我的C代码中的事件处理程序中弹出一个RadNotification。我试过类似的方法: 加价C# 以编程方式创建和显示Telerik RadNotification,c#,asp.net,notifications,telerik,C#,Asp.net,Notifications,Telerik,我试图在我的C代码中的事件处理程序中弹出一个RadNotification。我试过类似的方法: 加价 <asp:button> ... OnClick="OnClick"</asp:button> 但这不起作用。Telerik文档似乎没有太多关于在CodeBehind中创建这些通知的信息 谢谢这对我有用 标记 <telerik:RadNotification ID="RadNotification1" runat="server" VisibleOnPageLoa
<asp:button> ... OnClick="OnClick"</asp:button>
但这不起作用。Telerik文档似乎没有太多关于在CodeBehind中创建这些通知的信息
谢谢这对我有用
标记
<telerik:RadNotification ID="RadNotification1" runat="server" VisibleOnPageLoad="False" Width="300px" Height="100px" EnableRoundedCorners="true" EnableShadow="True" Title="My Notification" Position="Center" TitleIcon="none" />
<telerik:RadButton runat="server" ID="MyBtn" Text="Show Notification" OnClick="MyBtn_Click" />
根据需要修改RadNotification属性
干杯这对我有用
标记
<telerik:RadNotification ID="RadNotification1" runat="server" VisibleOnPageLoad="False" Width="300px" Height="100px" EnableRoundedCorners="true" EnableShadow="True" Title="My Notification" Position="Center" TitleIcon="none" />
<telerik:RadButton runat="server" ID="MyBtn" Text="Show Notification" OnClick="MyBtn_Click" />
根据需要修改RadNotification属性
干杯在ASP.NET WebForms中动态创建控件时,您必须:
因此,Scotty在标记中声明通知的答案可能是最简单的解决方案。在ASP.NET WebForms中动态创建控件时,您必须:
因此,Scotty的答案(通知仅在标记中声明)可能是最简单的解决方案。因此,如果不先在标记中声明控件,就无法在codebehind中创建控件?可以,但必须将其添加到页面的控件集合中。下面是MSDN的一篇基本文章:如果不先在标记中声明控件,就不能在codebehind中创建控件?可以,但必须将其添加到页面的控件集合中。以下是MSDN的一篇基本文章:
protected void MyBtn_Click(object sender, EventArgs e)
{
RadNotification1.Show("Some text");
}