Created
January 21, 2013 22:13
-
-
Save jmprado/4589992 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@model DateTime? | |
@{ | |
//Salva o valor como uma string validando a nulidade do objeto passado | |
string dateValue = Model.HasValue ? Model.Value.ToString("dd/MM/yyyy") : string.Empty; | |
} | |
@Html.TextBox("", dateValue, new { @class = "datepicker", maxlength = 10, @readonly = true }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@model Decimal? | |
@{ | |
//Formata o decimal para pt-BR substituindo o ponto pela vírgula | |
var decimalValue = Model.HasValue ? Model.Value.ToString("C").Replace(".", "").Replace(",", "") : string.Empty; | |
} | |
@Html.TextBox("", decimalValue, new { maxlength = "12", @class = "number" }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment