日期:2014-05-16  浏览次数:20646 次

为什么在ModalPopupExtender弹出的窗口中的Button click事件无法响应 - Web 开发 / Ajax
我的代码如下, 在点击 “保存”按钮时网页左下脚提示错误,数据库操作无法更新,请帮忙

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="qylx.aspx.cs" Inherits="qylx" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title></title>
  <style type ="text/css">
  .modalBackground { background-color:Gray; filter:alpha(opacity=70); opacity:0.7;}
  .modalPopup { background-color:#E3EAEB; border-width:3px; border-style:solid; border-color:Gray; padding:3px; width:250px;}
  .sampleStyleA { background-color:#FFF;}
  .sampleStyleB { background-color:#FFF; font-family:monospace; font-size:10pt; font-weight:bold;}
  </style>
</head>
<body>
  <form id="form1" runat="server">
  <div>

  <asp:ScriptManager ID="ScriptManager1" runat="server">
  </asp:ScriptManager>
  <asp:Button ID="Button1" runat="server" Text="增加企业类型" />
  <cc1:ModalPopupExtender ID="Button1_ModalPopupExtender" runat="server" BackgroundCssClass="modalBackground"
  TargetControlID="Button1" PopupControlID ="Panel1" DropShadow ="true" Drag ="true" PopupDragHandleControlID="Panel2" OkControlID="Button2" CancelControlID="Cancel">
  </cc1:ModalPopupExtender>
  <asp:Panel ID="Panel1" runat="server" Style="display: none" >
  <asp:Panel ID="Panel2" runat="server" CssClass="modalPopup" Width="355px" 
  Height="103px">
  <div style="text-align: center">
  <p style="font-size: 12pt"> 增加企业类型:</p>
  <asp:Label ID="Label1" runat="server" Text="企业类型:" Font-Size="10pt"></asp:Label>
  <asp:TextBox ID="TextBox1" runat="server" Height="18px" Width="256px" 
  CssClass="sampleStyleA"></asp:TextBox>
  &nbsp;&nbsp;<br />
  &nbsp;
<asp:UpdatePanel ID="UpdatePanel1" runat="server">

<Triggers>
<asp:AsyncPostBackTrigger ControlID="Save" EventName="Click" />

</Triggers>

</asp:UpdatePanel> 

<asp:Button ID="Save" runat="server" Text="保 存" onclick="Save_Click" />
  <asp:Button ID="Button2" runat="server" Text="Button" />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <asp:Button ID="Cancel" runat="server" Text="取 消" />
  &nbsp;</div>  
  </asp:Panel>
  </asp:Panel>