2017-03-12 5 views
-2

아래 코드는 Asp.Net에서 Javascript로 확인 상자를 실행합니다.
버튼 텍스트를 변경해야합니다. 이 메시지 상자에 예 또는 아니오 버튼을 사용하려면 어떻게합니까?
감사합니다.확인 상자에 예 또는 아니요 버튼이 표시됩니다.

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server"> 
    <title>Confirmation</title> 
    <script type="text/javascript">  
    function ConfirmOnDelete() { 
    if (confirm("Some question") == true) 
     return true; 
    else 
     return false; 
    } 
</script> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <div> 
     <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="return ConfirmOnDelete();" OnClick="Button1_Click"/> 
    </div> 
    </form> 
</body> 
</html> 

답변

1

confirm으로는이 작업을 수행 할 수 없습니다. 기본 alert/confirm/etc 대화 상자의 단추를 사용자 정의 할 수있는 방법은 없습니다.

대신 DOM 기반 대화 상자를 만들고 원하는대로 요소를 사용자 지정할 수 있습니다.