Search code examples
asp.netteleriknoty

notification using 'noty' is not working with telerik script manager



I am using Noty plugin for generating the notification.but its not working corrently. I am using rad ajax manager also. My code is as follows

<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>


in the click event if the text box content is null, i need to generate the notification and my code is

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


I am in need of immediate solution .please help me.


Solution

  • Make sure to include this on your .aspx page somewhere before trying to create your noty.