2017-03-26 12 views
0

나는 그가 eany 데이터를 입력 할 때 Varified를 보여줄 코드를 작성했다. 그래서 나는 varify 다음 2 버튼을 닫습니다. 레이블로 자신의 이메일 ID가 varified 여부 표시 ... 코드는 ... 코드 뒤에버튼 모서리 닫기에서 asp 모달 팝업 대화 상자를 중지하려면 어떻게해야합니까?

<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" PopupControlID="Panel1" TargetControlID="btn" 
CancelControlID="btnClose" BackgroundCssClass="modalBackground" > 

<asp:Label ID="Label1" runat="server" Text="Enter Your Registered Email Id"></asp:Label> 
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> 
    <asp:Label ID="Label2" runat="server" Text="Label" ></asp:Label> 
    <asp:Button ID="Button2" runat="server" CssClass="btn btn-info" OnClick="Button2_Click" Text="Varify" /> 



<asp:Button ID="btnClose" runat="server" Text="Close" /> 

코드입니다

protected void Button2_Click(object sender, EventArgs e) 
    { 
     Label2.Visible = true; 
     Label2.Text = "Valid User"; 
     Label2.ForeColor= System.Drawing.Color.Green; 
     //ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "showModal()", true); 
     // ModalPopupExtender1.Show(); 
    } 

하지만 Button2를 클릭하면 모델이 닫힙니다. 출력을 볼 수있는 이득 ... 나는 ModalPopupExtender를 닫으면서 라벨 텍스트를 보여주고 싶다. 도와주세요

답변

0

나는 포스트 백의 원인으로 생각합니다. ModalPopupExtender에 대해 많이 알지는 못하지만 button2 클릭 및 click 이벤트에서 Jquery를 사용하여 Ajax 호출을 작성하고 이메일이 유효한지 여부를 확인하도록 권장 할 수 있습니다.