Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/420.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript js客户端脚本注册客户端脚本块C#_Javascript_C#_Popup - Fatal编程技术网

Javascript js客户端脚本注册客户端脚本块C#

Javascript js客户端脚本注册客户端脚本块C#,javascript,c#,popup,Javascript,C#,Popup,我想在我的网页中显示以下javascript代码。但它没有显示任何东西。 以下是我的代码: C#代码: Aspx: 函数alert3(){ 警报(“Pnr已存在”); } 我不知道JavaScript,但我的上司要求他用JavaScript显示消息。你试过ScriptManager而不是Page.ClientScript吗 ScriptManager.RegisterStartupScript(Page, this.GetType(), "alert3", "alert3();", true

我想在我的网页中显示以下javascript代码。但它没有显示任何东西。 以下是我的代码:
C#代码:

Aspx:


函数alert3(){
警报(“Pnr已存在”);
}

我不知道JavaScript,但我的上司要求他用JavaScript显示消息。

你试过ScriptManager而不是Page.ClientScript吗

ScriptManager.RegisterStartupScript(Page, this.GetType(), "alert3", "alert3();", true);

您的
alert3
函数是否位于
标记上?@user3378165 yes
函数alert3(){alert(“Pnr已存在”);}函数alert2(){alert(“您的记录已成功保存”);}
它的工作现在有一个额外的(-)在我的aspx代码内部脚本中
 <script type="text/javascript">
    function alert3() {

        alert("Pnr Already Exist");
    }
ScriptManager.RegisterStartupScript(Page, this.GetType(), "alert3", "alert3();", true);