2012-09-14 2 views
0

사용자가 자신의 계정을 삭제하려고 할 때 비밀번호 상자 (텍스트 상자)를 삽입해야하는 경우 확인 상자를 만들고 싶습니다.텍스트 상자를 사용하여 대화 상자 포스트 백 확인

내 대화 상자 :

<div id="dialog" title="Confirmation Required"> 
    Are you sure about this? 
    Password:<asp:TextBox id="remove_password" TextMode="Password" runat="server"></asp:TextBox> 
</div> 

내 버튼을 눌러 대화 상자를 호출하지만
이 내 코드는 ... 다시 게시 이벤트를 캐치하는 방법을 알고 뒤에 코드에서 메소드를 실행하지 않습니다 :

<asp:LinkButton ID="lb_remove" Text="Delete Account" runat="server" OnClientClick="javascript: $('#dialog').dialog('open'); return false;" ClientIDMode="Static" /> 

내 스크립트를

$().ready(function() { 
     $("#dialog").dialog({ 
      autoOpen: false, 
      modal: true, 
      bgiframe: true, 
      width: 400, 
      height: 300, 
      buttons: { 
       'Delete': function() { 
        //do something 

        //what to put here??? 
        //i need to pass my textbox value or in 
        //codebehind i do findcontrol and will work? 
        // 
       }, 
       'Cancel': function() { 
        $(this).dialog('close'); 
       } 
      } 
     }) 
    }); 

수있는 사람 도와주세요? 감사.

답변

0

당신은 당신의 코드에서 가장 그냥 사용할 수 있습니다 behind.At 그렇게하려는 경우 그 사이에 포스트 백은 executed.You이 직접이 문제를 통제 할 수있을 것입니다 귀하의 대화 상자가 팝업 것이라고 할 수 없다

return confirm('Are you sure you want to Delete?'); 

다른 해결 방법은 Javascript/Ajax에 의존하는 것입니다.

편집 :

는이

<asp:LinkButton ID="lb_remove" Text="Delete Account" runat="server" OnClientClick="return confirm('Are you sure you want to delete?');" ClientIDMode="Static" /> 
+0

난 못해 시도? 만약 내가이 <% = this.Page.ClientScript.GetPostBackEventReference (새 PostBackOptions (this.lb_remove)) %>; 다시 게시 할 예정이지만이 이벤트를받는 방법을 모르겠습니다. S – oteal

+0

@ user1546424 문제가있는 위치를 표시 하시겠습니까? – freebird

+0

사용자가 삭제를 클릭하면 무엇을해야합니까? – oteal

관련 문제