2015-12-30 56 views
0
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="3.aspx.cs" Inherits="KVTRANSAPORTS._3" MasterPageFile="~/Site1.Master" %> 

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> 
    <script src="Scripts/jquery-2.1.1.min.js"></script> 
    <script src="Scripts/bootstrap.min.js"></script> 
    <script type="text/javascript"> 
     function openModal() { 
      $('#myModal').modal('show'); 
     }; 
    </script> 
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> 
    <div class="container"> 
     <div class="btn-group"> 
      <asp:Button ID="btnSubmit" class="btn-info" runat="server" Text="Submit" 
       OnClick="btnSubmit_Click"></asp:Button> 
     </div> 
     <div class="modal fade" id="myModal" tabindex="-1" role="dialog" 
      aria-labelledby="myModalLabel" aria-hidden="true"> 
      <div class="modal-dialog"> 
       <div class="modal-content"> 
        <div class="modal-header"> 
         <button type="button" class="close" 
          data-dismiss="modal" aria-hidden="true"> 
          &times; 
         </button> 
         <h4 class="modal-title" id="myModalLabel">title 
         </h4> 
        </div> 
        <div class="modal-body"> 
         something 
        </div> 
        <div class="modal-footer"> 
         <button type="button" class="btn btn-default" 
          data-dismiss="modal"> 
          close 
         </button> 
         <button type="button" class="btn btn-primary"> 
          save 
         </button> 
        </div> 
       </div> 
      </div> 
     </div> 
    </div> 
</asp:Content> 

    protected void btnSubmit_Click(object sender, EventArgs e) 
    { 
     ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal();", true); 
    } 

it is giving error Uncaught TypeError: $(...).modal is not a function如何在按鈕點擊打開模式彈出從服務器端

回答

相關問題