فهرست منبع

Bugfix for #81089

svn path=/trunk/mcs/; revision=74002
Marek Habersack 19 سال پیش
والد
کامیت
08c48a36e2

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

@@ -1,3 +1,8 @@
+2007-03-09  Marek Habersack  <[email protected]>
+
+	* Login.cs: Make command name comparison case-insensitive in
+	OnBubbleEvent. Patch from Mike Morano <[email protected]>
+
 2007-03-06 Igor Zelmanovich <[email protected]>
 
 	* DataGrid.cs: fixed: 

+ 2 - 1
mcs/class/System.Web/System.Web.UI.WebControls/Login.cs

@@ -1095,7 +1095,8 @@ namespace System.Web.UI.WebControls {
 		{
 			// check for submit button
 			CommandEventArgs cea = (e as CommandEventArgs);
-			if ((cea != null) && (cea.CommandName == LoginButtonCommandName)) {
+			if ((cea != null) &&
+			    String.Equals (cea.CommandName, LoginButtonCommandName, StringComparison.InvariantCultureIgnoreCase)) {
 				if (!AuthenticateUser ()) {
 					ITextControl failureText = LoginTemplateContainer.FailureTextLiteral;
 					if (failureText != null)

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

@@ -1,3 +1,8 @@
+2007-03-09  Marek Habersack  <[email protected]>
+
+	* LoginTest.cs: Added a test for case-insensitive command name in
+	OnBubbleEvent.
+
 2007-02-28 Igor Zelmanovich <[email protected]>
 
 	* TreeNodeColectionTest.cs: new tests

+ 20 - 2
mcs/class/System.Web/Test/System.Web.UI.WebControls/LoginTest.cs

@@ -800,7 +800,7 @@ namespace MonoTests.System.Web.UI.WebControls {
 			string html = t.Run ();
 		}
 
-		public static void _OnBubbleEvent(Page p)
+		public static void DoOnBubbleEvent(Page p, string cmdname)
 		{
 			TestLogin l = new TestLogin ();
 			l.Page = p;
@@ -808,7 +808,7 @@ namespace MonoTests.System.Web.UI.WebControls {
 			l.MembershipProvider = "FakeProvider";
 			Button b = (Button)l.FindControl ("LoginButton");
 			Assert.IsNotNull (b, "LoginButton");
-			CommandEventArgs cea = new CommandEventArgs ("Login", null);
+			CommandEventArgs cea = new CommandEventArgs (cmdname, null);
 			l.DoBubbleEvent (b, cea);
 			Assert.IsTrue (l.OnLoggingInCalled, "OnLoggingIn");
 			Assert.IsFalse (l.Cancel, "Cancel");
@@ -817,7 +817,25 @@ namespace MonoTests.System.Web.UI.WebControls {
 			Assert.IsTrue (l.OnLoginErrorCalled, "OnLoginError");
 			Assert.IsFalse (l.OnLoggedInCalled, "OnLoggedIn");
 		}
+		
+		public static void _OnBubbleEvent(Page p)
+		{
+			DoOnBubbleEvent(p, "Login");
+		}
 
+		[Test]
+		[Category ("NunitWeb")]
+		public void OnBubbleEventCaseSensitivity ()
+		{
+			WebTest t = new WebTest (PageInvoker.CreateOnPreInit (_OnBubbleEventCaseSensitivity));
+			string html = t.Run ();
+		}
+		
+		public static void _OnBubbleEventCaseSensitivity(Page p)
+		{
+			DoOnBubbleEvent(p, "login");
+		}
+		
 		[Test]
 		public void OnBubbleEvent_Cancel_OnLoggingIn ()
 		{