changeset 208:607384590bf8

Mejorando el mensaje de error que se muestra cuando hay un error de validaciĆ³n del lado del servidor
author nelopauselli
date Wed, 24 Aug 2011 11:30:06 -0300
parents beeb7fd09ae7
children a36a76bd6ec3
files Agendas/trunk/src/Agendas.Web/Content/Site.css Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs Agendas/trunk/src/Agendas.Web/Views/Shared/DefaultEditor.cshtml
diffstat 3 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Web/Content/Site.css	Wed Aug 24 10:52:44 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Web/Content/Site.css	Wed Aug 24 11:30:06 2011 -0300
@@ -278,6 +278,16 @@
     color: #ff0000;
 }
 
+.validation-summary-errors ul
+{
+	list-style-type:none;
+}
+
+.validation-summary-errors li
+{
+    font-weight: normal;
+}
+
 .validation-summary-valid
 {
     display: none;
--- a/Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs	Wed Aug 24 10:52:44 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs	Wed Aug 24 11:30:06 2011 -0300
@@ -239,7 +239,7 @@
 						this.AddWarning(log.WarningMessage);
 					return RedirectToAction("Index");
 				}
-				ModelState.AddModelError("error", r.ToString());
+				ModelState.AddModelError(string.Empty, r.Message);
 			}
 			return actionresultOnFail.Invoke(model);
 		}
--- a/Agendas/trunk/src/Agendas.Web/Views/Shared/DefaultEditor.cshtml	Wed Aug 24 10:52:44 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Web/Views/Shared/DefaultEditor.cshtml	Wed Aug 24 11:30:06 2011 -0300
@@ -8,7 +8,7 @@
 
 @using (Html.BeginForm())
 {
-    @Html.ValidationSummary(true, @LayoutResources.ValidationSummaryDefault)
+    @Html.ValidationSummary(true)
     <div>
         <fieldset>
             <legend>@Html.GetLegendForModel()</legend>