<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ASP.NET Dynamic Data</title><link>http://forums.asp.net/1145.aspx</link><description>Discussions regarding the new scaffolding framework in ASP.NET</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Validation shows me the errors in english and not in spanish</title><link>http://forums.asp.net/thread/2848245.aspx</link><pubDate>Mon, 05 Jan 2009 21:34:10 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2848245</guid><dc:creator>luisevalencia</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2848245.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2848245</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;What I did, was to create a new field template, and that&amp;#39;s it.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;However I like more your solutions, but&amp;nbsp; I needed it very urgently so thats why I did that! &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Validation shows me the errors in english and not in spanish</title><link>http://forums.asp.net/thread/2843733.aspx</link><pubDate>Fri, 02 Jan 2009 23:54:01 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2843733</guid><dc:creator>sjnaughton</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2843733.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2843733</wfw:commentRss><description>&lt;p&gt;Thanks Marcin &lt;img src="http://forums.asp.net/emoticons/emotion-2.gif" alt="Big Smile" /&gt;&lt;/p&gt;</description></item><item><title>Re: Validation shows me the errors in english and not in spanish</title><link>http://forums.asp.net/thread/2843695.aspx</link><pubDate>Fri, 02 Jan 2009 23:33:07 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2843695</guid><dc:creator>marcind</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2843695.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2843695</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;sjnaughton:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; 
&lt;p&gt;Hopefuly one of the team can confirm this or correct the place to place the error message to override the default message.&lt;/p&gt;
&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;Hi, just confirming that currently the set up method for CompareValidator does not take DataTypeAttribute into account when setting the error message. This will be fixed in future releases.&lt;/p&gt;</description></item><item><title>Re: Validation shows me the errors in english and not in spanish</title><link>http://forums.asp.net/thread/2840719.aspx</link><pubDate>Wed, 31 Dec 2008 22:49:40 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2840719</guid><dc:creator>ricka6</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2840719.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2840719</wfw:commentRss><description>&lt;p&gt;I blogged David&amp;#39;s approach &lt;a class="" href="http://blogs.msdn.com/rickandy/archive/2008/12/31/custom-validation-error-message-not-displayed.aspx"&gt;here&lt;/a&gt;.&amp;nbsp; Note a bug in the forum software hides some of David&amp;#39;s code. His code should display as&lt;/p&gt;
&lt;p&gt;var dataTypeAttribute = MetadataAttributes.OfType&amp;lt;&lt;strong&gt;DataTypeAttribute&lt;/strong&gt;&amp;gt;().SingleOrDefault();&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Validation shows me the errors in english and not in spanish</title><link>http://forums.asp.net/thread/2836712.aspx</link><pubDate>Tue, 30 Dec 2008 00:24:03 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2836712</guid><dc:creator>sjnaughton</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2836712.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2836712</wfw:commentRss><description>&lt;p&gt;I think the issue is, that if DataTypeAttribute is the correct place to set the error message for the data typp the it is not being picked up.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;luisevalencia:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; [DataType(&amp;quot;Int32&amp;quot;, ErrorMessage = &amp;quot;El campo debe ser un entero positivo&amp;quot;)]&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;Hopefuly one of the team can confirm this or correct the place to place the error message to override the default message.&lt;/p&gt;
&lt;p&gt;A work around could be to modify the appropriate field templates:&amp;nbsp;&lt;pre class="coloredcode"&gt;&lt;span class="kwd"&gt;protected void&lt;/span&gt; Page_Load(&lt;span class="kwd"&gt;object&lt;/span&gt; sender, EventArgs e)
{
    TextBox1.ToolTip = Column.Description;

    SetUpValidator(RequiredFieldValidator1);
    SetUpValidator(CompareValidator1);
    SetUpValidator(RegularExpressionValidator1);
    SetUpValidator(RangeValidator1);
    SetUpValidator(DynamicValidator1);

&lt;strong&gt;&lt;em&gt;    var dataType = Column.Attributes.OfType()&amp;lt;DataTypeAttribute&amp;gt;.FirstOrDefault();
    &lt;span class="kwd"&gt;if&lt;/span&gt; (dataType != &lt;span class="kwd"&gt;null&lt;/span&gt;)
        CompareValidator1.ErrorMessage = dataType.ErrorMessage;&lt;/em&gt;&lt;/strong&gt;
}
&lt;/pre&gt;
&lt;p&gt;Here you can see the addition in &lt;em&gt;&lt;strong&gt;BOLD ITALIC&lt;/strong&gt;&lt;/em&gt;&amp;nbsp;this will force the the CompareValidator to show thr correct error message, this will need to be done in all FieldTemplates that the message will be overridden for. The above is the &lt;strong&gt;Integer_Edit.ascx.cs&lt;/strong&gt; file.&lt;/p&gt;</description></item><item><title>Re: Validation shows me the errors in english and not in spanish</title><link>http://forums.asp.net/thread/2836706.aspx</link><pubDate>Tue, 30 Dec 2008 00:15:40 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2836706</guid><dc:creator>davidebb</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2836706.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2836706</wfw:commentRss><description>&lt;p&gt;Yes, I think there is a bug here.&amp;nbsp; Here are some workarounds:&lt;/p&gt;
&lt;p&gt;To change the default message for all fields, add the following line at the end of Page_Load in Integer_Edit.ascx.cs:&lt;/p&gt;&lt;pre class="coloredcode"&gt;    CompareValidator1.ErrorMessage = String.Format(&lt;span class="st"&gt;&amp;quot;El campo {0} debe ser un entero&amp;quot;&lt;/span&gt;, Column.Name);
&lt;/pre&gt;&amp;nbsp;&amp;nbsp; 
&lt;p&gt;To use a custom message from the model, try something like this (again at the end of Page_Load in Integer_Edit.ascx.cs):&lt;/p&gt;&lt;pre class="coloredcode"&gt;    var dataTypeAttribute = MetadataAttributes.OfType().SingleOrDefault();
    &lt;span class="kwd"&gt;if&lt;/span&gt; (dataTypeAttribute != &lt;span class="kwd"&gt;null&lt;/span&gt;) {
        CompareValidator1.ErrorMessage = dataTypeAttribute.FormatErrorMessage(Column.Name);
    }
&lt;/pre&gt;&amp;nbsp;&lt;pre class="coloredcode"&gt;I will open a bug to get this fixed in the next release.&lt;/pre&gt;
&lt;p&gt;thanks,&lt;br /&gt;David&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Validation shows me the errors in english and not in spanish</title><link>http://forums.asp.net/thread/2836693.aspx</link><pubDate>Tue, 30 Dec 2008 00:06:15 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2836693</guid><dc:creator>ricka6</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2836693.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2836693</wfw:commentRss><description>&lt;p&gt;The images are too small to read. Can you re-post the images or reproduce the problem with NorthWind or AdventureWorksLT?&amp;nbsp; People usually have this problem when a validation error occurs from the data model that they have not over-ridden in the partial class.&lt;/p&gt;</description></item><item><title>Validation shows me the errors in english and not in spanish</title><link>http://forums.asp.net/thread/2836606.aspx</link><pubDate>Mon, 29 Dec 2008 22:32:50 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2836606</guid><dc:creator>luisevalencia</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2836606.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2836606</wfw:commentRss><description>&lt;p&gt;Hello, I want to validate some fields that are decimal and integer&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I wrote this class.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DisplayName(&amp;quot;Areas de Evaluación&amp;quot;)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class EvaluationAreaMetaData&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ScaffoldColumn(false)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public object Id { get; set; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Required(ErrorMessage = &amp;quot;Este campo es Requerido&amp;quot;)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DisplayName(&amp;quot;Nombre&amp;quot;)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [StringLength(50)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public object Name { get; set; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Required(ErrorMessage = &amp;quot;Este campo es Requerido&amp;quot;)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DisplayName(&amp;quot;Porcentaje&amp;quot;)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DataType(&amp;quot;Int32&amp;quot;, ErrorMessage = &amp;quot;El campo debe ser un entero positivo&amp;quot;)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Range(1, 100, ErrorMessage = &amp;quot;El valor debe ser un entero positivo, menor que 100&amp;quot;)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DisplayFormat(DataFormatString=&amp;quot;{0:f}%&amp;quot;, ApplyFormatInEditMode=false)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public object Percentaje { get; set; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Required(ErrorMessage = &amp;quot;Este campo es Requerido&amp;quot;)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DisplayName(&amp;quot;Tipo de Servicio&amp;quot;)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public object ServiceType { get; set; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DisplayName(&amp;quot;Grupos&amp;quot;)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [HideColumnIn(PageTemplate.Edit, PageTemplate.Insert)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public object AreaGroups { get; set; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;BUt the behavior of the generated page is very strange, sometimes it shows me the error in spanish as I wrote it&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;but some times it shows me the validation error in english&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="http://img156.imageshack.us/my.php?image=80220227ul9.jpg" target="_blank" title="http://img156.imageshack.us/my.php?image=80220227ul9.jpg"&gt;&lt;img src="http://img156.imageshack.us/img156/9631/80220227ul9.th.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="http://img167.imageshack.us/my.php?image=92124628ca1.jpg" target="_blank" title="http://img167.imageshack.us/my.php?image=92124628ca1.jpg"&gt;&lt;img src="http://img167.imageshack.us/img167/2348/92124628ca1.th.jpg" border="0" alt="" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>