Mar 11, 2012, 8:14 PM
how to load combo box in asp.net MVC3??
hi ,
i want to load combox box with data whenever view is loaded is there any way to preloaded combobox when view is loaded i am using this code but its not working not loading any data . i am using asp.net MVC 3 aspx view engine.
view code
/Data/getAll
i want to load combox box with data whenever view is loaded is there any way to preloaded combobox when view is loaded i am using this code but its not working not loading any data . i am using asp.net MVC 3 aspx view engine.
view code
<ext:Store id="ClassStore" runat="server" AutoLoad="false" >
<Model>
<ext:Model ID="Model2" runat="server" IDProperty="id">
<Fields>
<ext:ModelField Name="id" />
<ext:ModelField Name="title" />
</Fields>
</ext:Model>
</Model>
<Proxy >
<ext:AjaxProxy Url="/Data/getAll/" >
<Reader>
<ext:JsonReader Root="Data" TotalProperty="TotalRecords" />
</Reader>
</ext:AjaxProxy>
</Proxy>
</ext:Store>
combo box code<ext:ComboBox ID="cmb" runat="server" Editable="false" TypeAhead="true" QueryMode="Local"
ColumnWidth="0.3" StoreID="ClassStore" DisplayField="title"
ValueField="id" ForceSelection="true" Margin="2" TriggerAction="All" SelectOnFocus="true" EmptyText="Select a Class">
</ext:ComboBox>
in my controller i have written this function /Data/getAll
public StoreResult getAll()
{
List<ClassBL> list;
list = DB.GetAll();
return new StoreResult(list , list .Count );
}
anybody guides me what is the right and best way to load combo box in asp.net MVC3?
Last edited by Daniil; Mar 12, 2012 at 12:08 PM.
Reason: Please use [CODE] tags