databind the combo box controls
This commit is contained in:
parent
8d8d86b53c
commit
f8264f6dea
@ -36,13 +36,22 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 form-group">
|
||||
<label class="control-label form-label" for="ItemBrand">Brand</label>
|
||||
<asp:DropDownList ID="ItemBrand" runat="server" DataTextField="Brand" />
|
||||
<asp:DropDownList ID="ItemBrand" runat="server"
|
||||
ItemType="eShopOnContainers.Core.Models.Catalog.CatalogBrand"
|
||||
SelectMethod="GetBrandsAsync"
|
||||
DataTextField="Brand"
|
||||
DataValueField="Id"
|
||||
SelectedValue="<%# BindItem.CatalogBrandId %>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 form-group">
|
||||
<label class="control-label form-label" for="ItemType">Type</label>
|
||||
<asp:DropDownList ID="ItemType" runat="server" DataTextField="Type" />
|
||||
<asp:DropDownList ID="ItemType" runat="server"
|
||||
SelectMethod="GetTypesAsync"
|
||||
DataTextField="Type"
|
||||
DataValueField="Id"
|
||||
SelectedValue="<%# BindItem.CatalogTypeId %>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@ -86,13 +95,22 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 form-group">
|
||||
<label class="control-label form-label" for="ItemBrand">Brand</label>
|
||||
<asp:DropDownList ID="ItemBrand" runat="server" DataTextField="Brand" />
|
||||
<asp:DropDownList ID="ItemBrand" runat="server"
|
||||
ItemType="eShopOnContainers.Core.Models.Catalog.CatalogBrand"
|
||||
SelectMethod="GetBrandsAsync"
|
||||
DataTextField="Brand"
|
||||
DataValueField="Id"
|
||||
SelectedValue="<%# BindItem.CatalogBrandId %>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 form-group">
|
||||
<label class="control-label form-label" for="ItemType">Type</label>
|
||||
<asp:DropDownList ID="ItemType" runat="server" DataTextField="Type" />
|
||||
<asp:DropDownList ID="ItemType" runat="server"
|
||||
SelectMethod="GetTypesAsync"
|
||||
DataTextField="Type"
|
||||
DataValueField="Id"
|
||||
SelectedValue="<%# BindItem.CatalogTypeId %>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
@ -74,5 +74,17 @@ namespace eShopOnContainers.Catalog.WebForms
|
||||
Response.Redirect("~");
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<CatalogBrand>> GetBrandsAsync()
|
||||
{
|
||||
var brands = await catalog?.GetCatalogBrandAsync();
|
||||
return brands.AsEnumerable();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<CatalogType>> GetTypesAsync()
|
||||
{
|
||||
var types = await catalog?.GetCatalogTypeAsync();
|
||||
return types.AsEnumerable();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user