I need byte[]Descricao
, when sent to my view
, to display the text as string
for the user to manipulate within TextArea
, when I click
in save I need to be converted back to byte[]
to
that Controller
finds the submitted template.
Class:
public class Carta {
public virtual int Id {get; set;}
public virtual byte[] Descricao {get; set;}
}
Controller:
public ActionResult MinhaCarta(int? Id){
var carta = Id != 0 ? sessao.GetCarta(Id) : new Carta();
View(carta);
}
public ActionResult SalvarCarta(Carta model){
...
}
View:
@model Carta
@{
ViewBag.Title = "Minha Carta";
}
@using ((Ajax.BeginForm("SalvarCarta", "Mensagem", new AjaxOptions { HttpMethod = "POST" })))
{
@Html.Hidden(m => m.Id)
@Html.TextAreaFor(m => m.Descricao)
[SALVAR]
}
Would it be possible to validate via JavaScript perhaps within onClick
of Save?