Multiple actions in single view
Hi.I am new in MVC.
I have created 1 sample form with 2 textbox, 1 dropdownlist, 1 button to search data and grid view to bind data.
I have written 2 actions in controller "Employee".
1 action which is used for dropdown binding, which is called at the time of loading,
but at the same time, without calling method of grid view binding, html code is rendering, so that, it gives error like "You must bind datasource before doing this operation".
Later I added condition, "if (ViewBag.dt != null)", then only grid view binding related html render.
But now, whenever I click on submit, dropdown binding html is rendering without calling method of dropdown binding. Please give proper way of doing this kind of functionality.