내 modalpopup에 대해 여러 취소 컨트롤이 있지만 btnCancel 만 작동하고 $ find(). click이 작동하지 않고 "오류 : Unable to get 속성 'click'의 값 : 객체가 null이거나 정의되지 않음 " 도움이 될 수 있으면 크게 감사하겠습니다.
:<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
CodeBehind="WebForm1.aspx.cs" Inherits="web.WebForm1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:ScriptManager runat="server" ID="scriptManager" EnablePageMethods="true">
</asp:ScriptManager>
<asp:Button ID="btnShowPopupAmend" runat="server" />
<asp:ModalPopupExtender ID="mpeAmend" runat="server" TargetControlID="btnShowPopupAmend"
PopupControlID="pnlpopupAmend" CancelControlID="btnCancel" BackgroundCssClass="modalBackground" />
<asp:Panel ID="pnlpopupAmend" runat="server" Width="700px" Style="display: none;"
class="ModalPanel">
<img src="images/close.png" style="cursor: hand" onclick="$find('btnCancel').click()"
width="15" height="15" />
<asp:Button ID="btnCancel" Text="Cancel" runat="server" OnClick="btnCancel_Click" />
</asp:Panel>
</asp:Content>
내가 요소에서 논리를 취할 것
안녕 나는 지금 얻을 "오류 : 재산 '$'의 값이 null 또는 정의되어 있지 Function 객체"나는 onclick을 = 때 ". $ ('# btnCancel을')) (클릭;" img – user1801525
$ (document) .ready() 함수의 일부로 클릭 핸들러를 설정합니다. 이렇게하면 모든 객체가 초기화됩니다. –
죄송하지만이 문제가 발생하지 않는다면 .... btnCancel의 onclick은 서버 측입니까? btnCancel을 클릭하면 다음과 같은 구문을 사용하여 modalpopup을 닫습니다. $ (document) .ready (function() # btnCancel). (function() { $ get ('# mpeAmend'). hide(); });}); – user1801525