I have a TextBoxFor that lists the record of a table field. When displaying in the view, the textbox throws whitespace after displaying the contents of the record. I noticed that these spaces are to complete the StringLegth defined in the model for maximum size of characters allowed for the textBoxFor
[Required(ErrorMessage = "Campo obrigatório")]
[Display(Name = "Responsável")]
[StringLength(80, ErrorMessage = "Informe no máximo 80 caracteres")]
public string Responsavel { get; set; }
In View I put TextBoxFor
@f.FormGroup().TextBoxFor(p => p.Responsavel).WidthMd(6).Placeholder("Professor responsável pelo projeto.")
And the field is listed as follows:
"Joao da Silva 'several blank spaces'" (without the quotation marks, I put the quotation marks to show that a blank is being applied).
I have other forms that I did the same way and this does not happen, why the hell is this white space included? Before anyone asks, the record in the DB has no spaces.