E_DEFAULT_LOCALE_NOT_DEFINED: Default locale has not been defined. - Globalize

Asked

Viewed 403 times

0

When I type 1 number in input this error appears:

E_DEFAULT_LOCALE_NOT_DEFINED: Default locale has not been defined.

Imagery:

inserir a descrição da imagem aqui

I’ve tried several shapes and nothing. Follow code:

Model:

public class Teste
{
    [DataType(DataType.Date)]
    [Display(Name = "Data:")]
    [AssertThat("DeadLine >= Today()", ErrorMessage = "* Data deverá ser superior a data de hoje")]
    [Required(ErrorMessage = "* Campo Data é obrigatório")]
    [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
    public DateTime DeadLine { get; set; }
}

View:

@Html.TextBoxFor(model => model.DeadLine, "{0:dd/MM/yyyy}", new { @class = "form-control" })
@Html.ValidationMessageFor(model => model.DeadLine, "", new { @class = "text-danger" })

<script src="~/Scripts/jquery-3.1.1.js"></script>


<script src="~/Scripts/jquery.validate.js"></script>
<script src="~/Scripts/jquery.validate-vsdoc.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.js"></script>


<script src="~/Scripts/globalize.js"></script>
<script src="~/Scripts/globalize/message.js"></script>
<script src="~/Scripts/globalize/number.js"></script>
<script src="~/Scripts/globalize/plural.js"></script>
<script src="~/Scripts/globalize/date.js"></script>
<script src="~/Scripts/globalize/currency.js"></script>
<script src="~/Scripts/globalize/relative-time.js"></script>
<script src="~/Scripts/jquery.validate.globalize.js"></script>

Web.config:

<system.web>
  <globalization uiCulture="pt-BR" culture="pt-BR" enableClientBasedCulture="true" requestEncoding="UTF-8" responseEncoding="UTF-8" fileEncoding="UTF-8" />
</system.web>

Some solution ?

  • That’s a Javascript exception, right?

  • @LINQ that’s right

  • Just out of curiosity View that you added to the question is a page Mestre?

  • @Marconi she is not.

  • It seems to me that I have to use some kind of "cldr"

1 answer

-2

I Solved my problem when I see that the port used in my application is Different from IIS.

My application used port default (80), but I need used port :81.

I changed the Mine type in my IIS.

  • Translate your answer to English.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.