如何在BackgroundWorker之后显示模态?

时间:2019-08-29 14:22:53

标签: c# html asp.net bootstrap-modal

我试图显示一个模态,然后通过BackgroundWorker调用一个方法,但这不是

我做到了

BackgroundWorker2 enviarSegundoPlano = new BackgroundWorker2();
enviarSegundoPlano.DoWork += 
    new BackgroundWorker2.DoWorkEventHandler(EnviarSegundoPlano_DoWork); //do the method

enviarSegundoPlano.ScriptManager.RegisterStartupScript(this, this.GetType(), "Modal", "fondoModal();", true);
ScriptManager.RegisterStartupScript(this, this.GetType(), "Modal2", "openModalListaCirculares();", true); //this is the modal that I want to show

1 个答案:

答案 0 :(得分:0)

在将事件处理程序添加到BackgroundWorker.DoWork事件之后,需要调用

"for cycle in range(10)" . . . 方法。

https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.backgroundworker?view=netcore-2.2中的第二个示例代码可能会对您有所帮助。