summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenId/RelyingParty/OpenIdTextBox.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenId/RelyingParty/OpenIdTextBox.cs')
-rw-r--r--src/DotNetOpenId/RelyingParty/OpenIdTextBox.cs25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/DotNetOpenId/RelyingParty/OpenIdTextBox.cs b/src/DotNetOpenId/RelyingParty/OpenIdTextBox.cs
index 55861d4..de45a30 100644
--- a/src/DotNetOpenId/RelyingParty/OpenIdTextBox.cs
+++ b/src/DotNetOpenId/RelyingParty/OpenIdTextBox.cs
@@ -251,6 +251,20 @@ namespace DotNetOpenId.RelyingParty
set { ViewState[showLogoViewStateKey] = value; }
}
+ const string presetBorderViewStateKey = "PresetBorder";
+ const bool presetBorderDefault = true;
+ /// <summary>
+ /// Gets/sets whether to use inline styling to force a solid gray border.
+ /// </summary>
+ [Bindable(true)]
+ [Category(appearanceCategory)]
+ [DefaultValue(presetBorderDefault)]
+ [Description("Whether to use inline styling to force a solid gray border.")]
+ public bool PresetBorder {
+ get { return (bool)(ViewState[presetBorderViewStateKey] ?? presetBorderDefault); }
+ set { ViewState[presetBorderViewStateKey] = value; }
+ }
+
const string usePersistentCookieCallbackKey = "OpenIdTextBox_UsePersistentCookie";
const string usePersistentCookieViewStateKey = "UsePersistentCookie";
/// <summary>
@@ -685,14 +699,17 @@ namespace DotNetOpenId.RelyingParty
protected override void OnPreRender(EventArgs e) {
base.OnPreRender(e);
- if (ShowLogo)
- {
+ if (ShowLogo) {
string logoUrl = Page.ClientScript.GetWebResourceUrl(
typeof(OpenIdTextBox), EmbeddedLogoResourceName);
- WrappedTextBox.Style["background"] = string.Format(CultureInfo.InvariantCulture,
- "#fff url({0}) no-repeat", HttpUtility.HtmlEncode(logoUrl));
+ WrappedTextBox.Style[HtmlTextWriterStyle.BackgroundImage] = string.Format(
+ CultureInfo.InvariantCulture, "url({0})", HttpUtility.HtmlEncode(logoUrl));
+ WrappedTextBox.Style["background-repeat"] = "no-repeat";
WrappedTextBox.Style["background-position"] = "0 50%";
WrappedTextBox.Style[HtmlTextWriterStyle.PaddingLeft] = "18px";
+ }
+
+ if (PresetBorder) {
WrappedTextBox.Style[HtmlTextWriterStyle.BorderStyle] = "solid";
WrappedTextBox.Style[HtmlTextWriterStyle.BorderWidth] = "1px";
WrappedTextBox.Style[HtmlTextWriterStyle.BorderColor] = "lightgray";