CreateUserErrorEventArgs 클래스

정의

CreateUserError 이벤트에 대한 데이터를 제공합니다.

public ref class CreateUserErrorEventArgs : EventArgs
public class CreateUserErrorEventArgs : EventArgs
type CreateUserErrorEventArgs = class
    inherit EventArgs
Public Class CreateUserErrorEventArgs
Inherits EventArgs
상속
CreateUserErrorEventArgs

예제

다음 예에서 때를 CreateUserError 이벤트가 발생를 CreateUserError 의 속성을 CreateUserErrorEventArgs 개체에 표시 됩니다는 Label 컨트롤 Label1이유에 대 한 정보를 제공 하는 CreateUserError 이벤트가 발생 한.

public partial class CreateUserWizardErrorcs_aspx : System.Web.UI.Page
{
    protected void OnCreateUserError(object sender, System.Web.UI.WebControls.CreateUserErrorEventArgs e)
    {
        
        switch (e.CreateUserError)
        {
            case MembershipCreateStatus.DuplicateUserName:
                Label1.Text = "Username already exists. Please enter a different user name.";
                break;

            case MembershipCreateStatus.DuplicateEmail:
                Label1.Text = "A username for that email address already exists. Please enter a different email address.";
                break;

            case MembershipCreateStatus.InvalidPassword:
                Label1.Text = "The password provided is invalid. Please enter a valid password value.";
                break;

            case MembershipCreateStatus.InvalidEmail:
                Label1.Text = "The email address provided is invalid. Please check the value and try again.";
                break;

            case MembershipCreateStatus.InvalidAnswer:
                Label1.Text = "The password retrieval answer provided is invalid. Please check the value and try again.";
                break;

            case MembershipCreateStatus.InvalidQuestion:
                Label1.Text = "The password retrieval question provided is invalid. Please check the value and try again.";
                break;

            case MembershipCreateStatus.InvalidUserName:
                Label1.Text = "The user name provided is invalid. Please check the value and try again.";
                break;

            case MembershipCreateStatus.ProviderError:
                Label1.Text = "The authentication provider returned an error. Please verify your entry and try again. If the problem persists, please contact your system administrator.";
                break;

            case MembershipCreateStatus.UserRejected:
                Label1.Text = "The user creation request has been canceled. Please verify your entry and try again. If the problem persists, please contact your system administrator.";
                break;

            default:
                Label1.Text = "An unknown error occurred. Please verify your entry and try again. If the problem persists, please contact your system administrator.";
                break;
        }
    }
}
Partial Class CreateUserWizardErrorvb_aspx
    Inherits System.Web.UI.Page

    Protected Sub OnCreateUserError(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CreateUserErrorEventArgs)

        Select Case (e.CreateUserError)

            Case MembershipCreateStatus.DuplicateUserName
                Label1.Text = "Username already exists. Please enter a different user name."


            Case MembershipCreateStatus.DuplicateEmail
                Label1.Text = "A username for that email address already exists. Please enter a different email address."


            Case MembershipCreateStatus.InvalidPassword
                Label1.Text = "The password provided is invalid. Please enter a valid password value."


            Case MembershipCreateStatus.InvalidEmail
                Label1.Text = "The email address provided is invalid. Please check the value and try again."


            Case MembershipCreateStatus.InvalidAnswer
                Label1.Text = "The password retrieval answer provided is invalid. Please check the value and try again."


            Case MembershipCreateStatus.InvalidQuestion
                Label1.Text = "The password retrieval question provided is invalid. Please check the value and try again."


            Case MembershipCreateStatus.InvalidUserName
                Label1.Text = "The user name provided is invalid. Please check the value and try again."


            Case MembershipCreateStatus.ProviderError
                Label1.Text = "The authentication provider returned an error. Please verify your entry and try again. If the problem persists, please contact your system administrator."


            Case MembershipCreateStatus.UserRejected
                Label1.Text = "The user creation request has been canceled. Please verify your entry and try again. If the problem persists, please contact your system administrator."

            Case Else
                Label1.Text = "An unknown error occurred. Please verify your entry and try again. If the problem persists, please contact your system administrator."

        End Select

    End Sub

End Class

다음은 앞의 예제를 실행 하는.aspx 파일입니다.

<%@ Page Language="C#" CodeFile="CreateUserWizardError.cs" Inherits="CreateUserWizardErrorcs_aspx" %>

<!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>CreateUserWizardError Example</title>
</head>
<body>
    <form id="form1" runat="server">
      <h3>CreateUserWizardError Example</h3>
      <asp:CreateUserWizard id="CreateUserWizard1" 
        runat="server" 
        oncreateusererror="OnCreateUserError">
        <WizardSteps>
                <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
                </asp:CreateUserWizardStep>
                <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
                </asp:CompleteWizardStep>
            </WizardSteps>
      </asp:CreateUserWizard>
      <asp:Label id="Label1" 
        runat="server">
      </asp:Label>
    </form>
  </body>
</html>
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="CreateUserWizardError.vb" Inherits="CreateUserWizardErrorvb_aspx" %>

<!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>CreateUserWizardError Example</title>
</head>
<body>
    <form id="form1" runat="server">
      <h3>CreateUserWizardError Example</h3>
      <asp:CreateUserWizard id="CreateUserWizard1" 
        runat="server" 
        oncreateusererror="OnCreateUserError">
        <WizardSteps>
                <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
                </asp:CreateUserWizardStep>
                <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
                </asp:CompleteWizardStep>
            </WizardSteps>
      </asp:CreateUserWizard>
      <asp:Label id="Label1" 
        runat="server">
      </asp:Label>
    </form>
  </body>
</html>

설명

A CreateUserError 사용 하 여 새 사용자를 만들 하려고 할 때 이벤트가 발생 합니다 CreateUserWizard 컨트롤입니다. CreateUserErrorEventArgs 클래스를 제공 합니다 CreateUserError 나타내는 속성을는 MembershipCreateStatus 발생 한 오류에 해당 하는 열거형 값입니다.

생성자

CreateUserErrorEventArgs(MembershipCreateStatus)

CreateUserErrorEventArgs 클래스의 새 인스턴스를 초기화합니다.

속성

CreateUserError

CreatingUser 이벤트의 결과를 나타내는 값을 가져오거나 설정합니다.

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상

추가 정보