diff options
author | Marek Habersack <grendel@twistedcode.net> | 2010-04-03 04:40:48 +0400 |
---|---|---|
committer | Marek Habersack <grendel@twistedcode.net> | 2010-04-03 04:40:48 +0400 |
commit | fc6da81e12d9642b224cf8410b79ffa47436443c (patch) | |
tree | ddb7a1dc65f984597b395eb0237e4f0219c9283d /mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs | |
parent | c812577c349b2efa9eed76956de1cd597d369bd4 (diff) |
More cosmetics
svn path=/trunk/mcs/; revision=154749
Diffstat (limited to 'mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs')
-rw-r--r-- | mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs index 534e2af36ef..c674ec19225 100644 --- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs +++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs @@ -225,9 +225,11 @@ namespace System.Web.UI.HtmlControls { onclick = ClientScriptManager.EnsureEndsWithSemicolon (Attributes ["onclick"] + onclick); Attributes.Remove ("onclick"); } - if (Page != null) { + + Page page = Page; + if (page != null) { PostBackOptions options = GetPostBackOptions (); - onclick += Page.ClientScript.GetPostBackEventReference (options, true); + onclick += page.ClientScript.GetPostBackEventReference (options, true); } if (onclick.Length > 0) { @@ -247,13 +249,14 @@ namespace System.Web.UI.HtmlControls { PostBackOptions GetPostBackOptions () { + Page page = Page; PostBackOptions options = new PostBackOptions (this); options.ValidationGroup = null; options.ActionUrl = null; options.Argument = String.Empty; options.RequiresJavaScriptProtocol = false; options.ClientSubmit = (0 != String.Compare (Type, "submit", true, Helpers.InvariantCulture)); - options.PerformValidation = CausesValidation && Page != null && Page.Validators.Count > 0; + options.PerformValidation = CausesValidation && page != null && page.Validators.Count > 0; if (options.PerformValidation) options.ValidationGroup = ValidationGroup; |