I’d move the disable to before the ajax call, and change the selected item text to loading.... you don’t identify which css framework you are using, so don’t know which pop up to suggest. Just call it before the ajax call, and dismiss on success or failure.
public class SpinnersTestController : Controller
{
// GET: SpinnersTest
public ActionResult Index()
{
List<SelectListItem> itemlist = new List<SelectListItem>();
for(int i = 0; i < 3; i++)
{
itemlist.Add(new SelectListItem {Text="Text"+i.ToString(),Value=i.ToString() });
}
ViewBag.Parent = new SelectList(itemlist, "Value","Text");
return View();
}
public ActionResult getchildren(int value=1)
{
List<SelectListItem> itemlistchildren = new List<SelectListItem>();
//You can fill itemlistchildren based on query data from the database
for (int i = value; i < value+3;i++)
{
itemlistchildren.Add(new SelectListItem { Text = "Textchild" + i.ToString(), Value =i.ToString() });
}
return Json(itemlistchildren,JsonRequestBehavior.AllowGet);
}
}
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
57 Points
116 Posts
Loading progress or Please Wait Pop-Up in MVC View DropDown List
Dec 28, 2020 03:37 PM|Golia|LINK
Hello all,
I have developed a web application using MVC architecture.
I populate a child dropdown list depending on each new value as values are selected in the parent's DropDown List.
I want a Loading/Please-wait kind of pop-up to be shown and exited automatically when the ActionResult returns the view.
Please can you help me?
My code follow
All-Star
57874 Points
15507 Posts
Re: Loading progress or Please Wait Pop-Up in MVC View DropDown List
Dec 28, 2020 09:20 PM|bruce (sqlwork.com)|LINK
I’d move the disable to before the ajax call, and change the selected item text to loading.... you don’t identify which css framework you are using, so don’t know which pop up to suggest. Just call it before the ajax call, and dismiss on success or failure.
Contributor
2400 Points
690 Posts
Re: Loading progress or Please Wait Pop-Up in MVC View DropDown List
Dec 29, 2020 09:30 AM|YihuiSun|LINK
Hi Golia,
According to your needs, I wrote an example, you can refer to it.
Controller
View
CustomLoader.css
Here is the result.
Best Regards,
YihuiSun