Back to Devexpress

AccountManager.ResolveAccount Event

aspnet-devexpress-dot-web-dot-accountmanager.md

latest3.5 KB
Original Source

AccountManager.ResolveAccount Event

Occurs on the server side if there is no registered account for the account name specified in the control’s AccountName property.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public static event ResolveAccountEventHandler ResolveAccount
vb
Public Shared Event ResolveAccount As ResolveAccountEventHandler

Event Data

The ResolveAccount event's data class is ResolveAccountEventArgs. The following properties provide information specific to this event:

PropertyDescription
AccountGets or sets an account for the account name specified by the ResolveAccountEventArgs.AccountName property.
AccountNameGets the name of the account for which the account should be dynamically created.

Remarks

The ResolveAccount event is used to dynamically create and use an account when the application is run.

Use the AccountName property to get an account name for which the account should be dynamically created. The Account property specifies an account for the account name specified by the AccountName property.

Example

The following example illustrates how to use the AccountManager.ResolveAccount event.

aspx
<dx:ASPxFileManager ID="FileManager" runat="server" ProviderType="Dropbox">
    <Settings RootFolder="~" ThumbnailFolder="~/Thumb" />
    <SettingsDropbox AccountName="DropboxAccount#1" />
</dx:ASPxFileManager>
csharp
void Application_Start(object sender, EventArgs e) {
    AccountManager.ResolveAccount += AccountManager_ResolveAccount;
}
void AccountManager_ResolveAccount(object sender, ResolveAccountEventArgs e) {
    if(e.AccountName == "DropboxAccount#1")
        e.Account = new DropboxAccount(e.AccountName, "SecretAccessTokenValue#1");
}
vb
Private Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
    AccountManager.ResolveAccount += AddressOf AccountManager_ResolveAccount
End Sub
Private Sub AccountManager_ResolveAccount(ByVal sender As Object, ByVal e As ResolveAccountEventArgs)
    If e.AccountName = "DropboxAccount#1" Then e.Account = New DropboxAccount(e.AccountName, "SecretAccessTokenValue#1")
End Sub

See Also

FileManagerAmazonProviderSettings.AccountName

FileManagerAzureProviderSettings.AccountName

FileManagerDropBoxProviderSettings.AccountName

AccountManager Class

AccountManager Members

DevExpress.Web Namespace