How can i dynamically load a Partial View?
I mean I have this view, lets say ListProducts, there I select some dropdownlists with products, etc, and wit
Use jQuery's $.load() with a controller action that returns a partial view.
For example:
public virtual ActionResult Index(string id)
{
var myModel = GetSomeData();
return Partial(myModel);
}
@model IEnumerable
@if (Model == null || Model.Count() == 0)
{
No results found
}
else
{
@foreach (YourObjects myobject in Model)
{
- @myObject.Name
}
}