patrick
patrick

Reputation: 16959

How to access model data in MVC without Html helper?

This works

  @Html.EditorFor(model => model.Data, new { htmlAttributes = new { @class = "form-control" } })

This next line doesn't like "model=>model.Data"

  <img src="data:image;base64,@System.Convert.ToBase64String(model => model.Data)" height="80" />

Upvotes: 0

Views: 193

Answers (1)

patrick
patrick

Reputation: 16959

  @if (Model.Data != null)
  {
                    <img src="data:image;base64,@System.Convert.ToBase64String(Model.Data))" height="80" />
  }

Upvotes: 1

Related Questions