diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2013-02-09 14:57:34 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2013-02-09 14:57:34 -0800 |
commit | 2e177b1c58ccd1c8edc2cc78e0c629784173a95c (patch) | |
tree | 0afbda6bc7b6a9ed799a21f275930bb0024f17bd /src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdAjaxTextBox.cs | |
parent | c822a97c464a31fac7eccfb1ca9fb4f5b70a53b8 (diff) | |
download | DotNetOpenAuth-2e177b1c58ccd1c8edc2cc78e0c629784173a95c.zip DotNetOpenAuth-2e177b1c58ccd1c8edc2cc78e0c629784173a95c.tar.gz DotNetOpenAuth-2e177b1c58ccd1c8edc2cc78e0c629784173a95c.tar.bz2 |
Fixes ASP.NET controls to be async.
Diffstat (limited to 'src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdAjaxTextBox.cs')
-rw-r--r-- | src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdAjaxTextBox.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdAjaxTextBox.cs b/src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdAjaxTextBox.cs index 5900e7b..4c988a8 100644 --- a/src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdAjaxTextBox.cs +++ b/src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdAjaxTextBox.cs @@ -740,10 +740,12 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { // If an Identifier is preset on this control, preload discovery on that identifier, // but only if we're not already persisting an authentication result since that would // be redundant. - var response = Task.Run(() => this.GetAuthenticationResponseAsync(CancellationToken.None)).GetAwaiter().GetResult(); - if (this.Identifier != null && response == null) { - this.PreloadDiscoveryAsync(this.Identifier, CancellationToken.None).Wait(); - } + this.Page.RegisterAsyncTask(new PageAsyncTask(async ct => { + var response = await this.GetAuthenticationResponseAsync(ct); + if (this.Identifier != null && response == null) { + await this.PreloadDiscoveryAsync(this.Identifier, ct); + } + })); } /// <summary> |