【问题标题】:notification using 'noty' is not working with telerik script manager使用“noty”的通知不适用于 Telerik 脚本管理器
【发布时间】:2013-12-19 14:25:25
【问题描述】:


我正在使用 Noty 插件来生成通知。但它不能正常工作。我也在使用 rad ajax 管理器。我的代码如下

<script type="text/javascript">
function noty_error(type_, text_) {
    var n = noty({
    text: text_,
    type: type_,
    dismissQueue: true,
    layout: 'topCenter',
    theme: 'defaultTheme',
    timeout:2000
});

}


 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="btn_add">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="txt_dept" />
                            <telerik:AjaxUpdatedControl ControlID="grid_dept" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="btn_cncl">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="txt_dept" />
                            <telerik:AjaxUpdatedControl ControlID="btn_add" />
                            <telerik:AjaxUpdatedControl ControlID="grid_dept" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="grid_dept">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="txt_dept" />
                            <telerik:AjaxUpdatedControl ControlID="btn_add" />
                            <telerik:AjaxUpdatedControl ControlID="grid_dept" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>


在点击事件中如果文本框内容为空,我需要生成通知,我的代码是

ScriptManager.RegisterStartupScript(this, typeof(Page), "onclick", "noty_error('warning','Oops!!! it looks like you have not entered anything');", true); 


我需要立即解决。请帮助我。

【问题讨论】:

  • 您遇到错误了吗?尝试在浏览器中查看调试器,看看会发生什么。
  • 是的,我在控制台看到的错误是'Cannot read property 'options' of undefined' from jquery.noty.js。
  • 如果我写一个函数 myfun{alert("hai")} 它将与 RadAjaxManager1.ResponseScripts.Add(@"myfun();");但它不会在 jquery 或任何其他功能的情况下工作。

标签: asp.net telerik noty


【解决方案1】:

在尝试创建您的通知之前,请确保将其包含在您的 .aspx 页面上。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-01-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-19
    • 1970-01-01
    • 2020-06-14
    • 2014-08-18
    相关资源
    最近更新 更多