Bläddra i källkod

2007-05-07 Marek Habersack <[email protected]>

	* Wizard.cs: additional checks to see whether the wizard needs to
	move to a next step or not. Fixes bug #81532. Patch sent by Mike
	Morano <[email protected]>, thanks!

svn path=/trunk/mcs/; revision=76819
Marek Habersack 18 år sedan
förälder
incheckning
c02e33ec1f

+ 6 - 0
mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog

@@ -1,3 +1,9 @@
+2007-05-07  Marek Habersack  <[email protected]>
+
+	* Wizard.cs: additional checks to see whether the wizard needs to
+	move to a next step or not. Fixes bug #81532. Patch sent by Mike
+	Morano <[email protected]>, thanks!
+
 2007-05-07 Igor Zelmanovich <[email protected]>
 
 	* FormView.cs: fixed:

+ 25 - 23
mcs/class/System.Web/System.Web.UI.WebControls/Wizard.cs

@@ -199,29 +199,31 @@ namespace System.Web.UI.WebControls
 		
 	    [DefaultValueAttribute (-1)]
 	    [ThemeableAttribute (false)]
-		public virtual int ActiveStepIndex {
-			get {
-				return activeStepIndex;
-			}
-			set {
-				if (value < -1 || (value > WizardSteps.Count && (inited || WizardSteps.Count > 0)))
-					throw new ArgumentOutOfRangeException ("The ActiveStepIndex must be less than WizardSteps.Count and at least -1");
-
-				if (inited && !AllowNavigationToStep (value))
-					return;
-
-				activeStepIndex = value;
-
-				if (inited) {
-					multiView.ActiveViewIndex = value;
-					if (stepDatalist != null) {
-						stepDatalist.SelectedIndex = value;
-						stepDatalist.DataBind ();
-					}
-					OnActiveStepChanged (this, EventArgs.Empty);
-				}
-			}
-		}
+	    public virtual int ActiveStepIndex {
+		    get {
+			    return activeStepIndex;
+		    }
+		    set {
+			    if (value < -1 || (value > WizardSteps.Count && (inited || WizardSteps.Count > 0)))
+				    throw new ArgumentOutOfRangeException ("The ActiveStepIndex must be less than WizardSteps.Count and at least -1");
+			    
+			    if (inited && !AllowNavigationToStep (value))
+				    return;
+			    
+			    if(activeStepIndex != value) {
+				    activeStepIndex = value;
+				    
+				    if (inited) {
+					    multiView.ActiveViewIndex = value;
+					    if (stepDatalist != null) {
+						    stepDatalist.SelectedIndex = value;
+						    stepDatalist.DataBind ();
+					    }
+					    OnActiveStepChanged (this, EventArgs.Empty);
+				    }
+			    }
+		    }
+	    }
 		
 	    [UrlPropertyAttribute]
 	    [DefaultValueAttribute ("")]