0
I need to know how many lines(in view) I send from my controller in a type list<>
for a viewbag in the view.
With this enable or not the option to create new images.
Controller:
ViewBag.Imagens = _supplierAdvertImageRepository.GetSupplierAdvertImage(obj.SupplierAdvertID,
obj.SupplierID);
View
@{
if (ViewBag.Imagens > 5)
{
<div id="div_inseret">
@Html.ActionLink(
"Inserir Imagem ",
"CreateAdvertImage",
"SupplierAdvert",
new {
supplierId = Model.SupplierID,
SupplierAdvertID = Model.SupplierAdvertID},
new {
supplierId = Model.SupplierID,
SupplierAdvertID = Model.SupplierAdvertID,
@class = "btn btn-info"
}
)
</div>
}
else
{
<label for="Adress">Limite de Imagens Atingido
<span class="required">*</span>
</label>
}
but it is not correct, someone has a better idea?
Your question is illogical, could it reformulate?
– novic
See if there’s logic now?
– Moizés Cerqueira