diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-07-20 21:07:19 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-07-20 21:07:19 -0700 |
commit | 1cfce45206b9ca0a5f62ba870eea687481e509d6 (patch) | |
tree | dd19bc9a4a505f9676d0c2e5800787c857bb25c6 | |
parent | 979ee12aac05b225fe47c24778607bf8f4f62822 (diff) | |
download | DotNetOpenAuth-1cfce45206b9ca0a5f62ba870eea687481e509d6.zip DotNetOpenAuth-1cfce45206b9ca0a5f62ba870eea687481e509d6.tar.gz DotNetOpenAuth-1cfce45206b9ca0a5f62ba870eea687481e509d6.tar.bz2 |
Fixed bug where the OpenIdTextBox would lose its Identifier value if it was made invisible.
-rw-r--r-- | src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdTextBox.cs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdTextBox.cs b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdTextBox.cs index 1b51859..48e51dd 100644 --- a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdTextBox.cs +++ b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdTextBox.cs @@ -576,10 +576,14 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { /// true if the server control's state changes as a result of the postback; otherwise, false. /// </returns> protected virtual bool LoadPostData(string postDataKey, NameValueCollection postCollection) { - Identifier identifier = string.IsNullOrEmpty(postCollection[this.Name]) ? null : postCollection[this.Name]; - if (identifier != this.Identifier) { - this.Identifier = identifier; - return true; + // If the control was temporarily hidden, it won't be in the Form data, + // and we'll just implicitly keep the last Text setting. + if (postCollection[this.Name] != null) { + Identifier identifier = postCollection[this.Name].Length == 0 ? null : postCollection[this.Name]; + if (identifier != this.Identifier) { + this.Identifier = identifier; + return true; + } } return false; |