我有 javascript 函数,它使用 noty javascript 插件创建通知,
    <script type="text/javascript">
    function generateAnoty(message) {
        var noty_id = noty({
            layout: 'center',
            text: message,
            modal: true,
            type: 'success',
        });
    }
    </script>
我使用 razor v2 作为带有 C# 的视图引擎和 web 表单框架,而不是 mvc。提交表单后,我想调用上面的 javascript 函数。这是我正在尝试做的一个例子;
   //place for c#
   if (IsPost)
   {
       //after submitting the form
       //I wanna somehow call the js to show noty message
       generateAnoty("You have successfully submitted the form!")
   }
ps 如果我尝试使用任何 html 按钮 onclick 事件处理程序调用 generateAnoty(message) js 方法,它运行良好。