diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-10-19 17:56:10 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-10-19 17:56:10 -0700 |
commit | 7a4826cccda612d84e9ad643a14236b3c60949be (patch) | |
tree | e489f869da18df6ea326da689cea2c42110e5f1d /src | |
parent | 504c82a2c31e580ea5f1d5c44641a15a62faafc2 (diff) | |
download | DotNetOpenAuth-7a4826cccda612d84e9ad643a14236b3c60949be.zip DotNetOpenAuth-7a4826cccda612d84e9ad643a14236b3c60949be.tar.gz DotNetOpenAuth-7a4826cccda612d84e9ad643a14236b3c60949be.tar.bz2 |
Moved OpenIdAjaxTextBox from aspx page into the OpenIdButtonPanel control.
Diffstat (limited to 'src')
-rw-r--r-- | src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdButtonPanel.cs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdButtonPanel.cs b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdButtonPanel.cs index 235d6f3..e71847c 100644 --- a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdButtonPanel.cs +++ b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdButtonPanel.cs @@ -50,6 +50,17 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { private const string AuthenticatedAsToolTipDefault = "We recognize you!"; /// <summary> + /// The OpenIdAjaxTextBox that remains hidden until the user clicks the OpenID button. + /// </summary> + private OpenIdAjaxTextBox textBox; + + /// <summary> + /// Initializes a new instance of the <see cref="OpenIdButtonPanel"/> class. + /// </summary> + public OpenIdButtonPanel() { + } + + /// <summary> /// Gets or sets the tool tip text that appears on the green checkmark when authentication succeeds. /// </summary> [Bindable(true), DefaultValue(AuthenticatedAsToolTipDefault), Localizable(true), Category(AppearanceCategory)] @@ -83,6 +94,17 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { } /// <summary> + /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering. + /// </summary> + protected override void CreateChildControls() { + base.CreateChildControls(); + + this.textBox = new OpenIdAjaxTextBox(); + this.textBox.ID = "openid_identifier"; + this.Controls.Add(this.textBox); + } + + /// <summary> /// Raises the <see cref="E:System.Web.UI.Control.PreRender"/> event. /// </summary> /// <param name="e">An <see cref="T:System.EventArgs"/> object that contains the event data.</param> @@ -142,6 +164,14 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { } writer.RenderEndTag(); // </ul> + + writer.AddStyleAttribute(HtmlTextWriterStyle.Display, "none"); + writer.AddAttribute(HtmlTextWriterAttribute.Id, "OpenIDForm"); + writer.RenderBeginTag(HtmlTextWriterTag.Div); + + this.RenderChildren(writer); + + writer.RenderEndTag(); // </div> } } |