0

我在我的 aspx 页面上遇到了一些关于 javascript 的不同问题。我目前没有使用任何Masterpage,上述配置在另一个项目中运行良好,但我敲了敲头,用谷歌搜索了解决方案,但仍在搜索......

我的 ASPX 代码

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="comp1.aspx.cs"      Inherits="StudentManagement.comp1" %>

   <!DOCTYPE html>

   <html xmlns="http://www.w3.org/1999/xhtml">
   <head runat="server">
    <title>
        Submit / Update Complains
    </title>
    <!-- CSS -->
    <link rel="stylesheet" type="text/css" href="Style/structure.css" />
    <link rel="stylesheet" type="text/css" href="Style/form.css"/>
    <link rel="stylesheet" type="text/css" href="Style/Submitbtn.css" />
    <link rel="stylesheet" type="text/css" href="Style/MenuMaster.css"/>
    <link rel="stylesheet" type="text/css" href="Style/Logout.css"/>
    <link rel="stylesheet" type="text/css" href="Style/Logoutbtn.css"/>
    <link rel="stylesheet" type="text/css" href="Style/impromptu.css"/>

     <!-- JavaScript -->
     <script type="text/javascript" src="Scripts/jquery.js"></script>
     <script type="text/javascript" src="Scripts/jquery-latest.min.js"></script> 
     <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js">     </script> 
      <script type="text/javascript" src="Scripts/wufoo.js"></script>
      <script type="text/javascript" src="Scripts/jquery-impromptu.2.6.min.js"></script>


      <script type="text/javascript">

        function confirmSubmit() {
        $.prompt('Are you sure you want to submit?'
            , {
                buttons: { Ok: true, Cancel: false }
                , callback: confirmSubmitResult
            }
        );
        return false;
    }

    function confirmSubmitResult(v, m, f) {
        if (v) //post back if the user clicked OK
            $('#<%= btnSubmit.ClientID %>').click();
    }
    </script>


</head>

很少的帮助将非常有义务

4

1 回答 1

1

您不能在 runat="server" 标记中使用 Response.Write 块。看看这篇文章背后的原因和修复:

Javascript:

 function confirmSubmitResult(v, m, f) {
        if (v) //post back if the user clicked OK
            $('#<%# btnSubmit.ClientID %>').click();
    }

代码背后:

protected void Page_Load(object sender, EventArgs e)
   {
      Page.Header.DataBind();    
   }
于 2013-05-30T10:49:45.613 回答