Click here to Skip to main content
15,891,688 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys, I am wondering how would one achieve the following: I tried to show the modal when user clicks button and then to hide it when code finnishes. But it doesn't show it, I think it's because the stqatenment has to finnish.

Does anyone know how to do this?
C#
protected void btnImport_Click(object sender, EventArgs e)
{
    madalpopup.show();
    //do some importing 
    modalpopup.hide()
}

All my code works. I just want to know how to achieve this. That is why I dont submit my code.
Posted
Updated 20-Dec-12 22:04pm
v2

No, it won't work.
Why not? Because the box is Modal - and a modal popup has to be closed before control returns to the statement that displayed it.
If you want to show a box while a process is going on, use a BackgroundWorker thread instead.
 
Share this answer
 
Comments
mrDivan 21-Dec-12 3:36am    
Hi thanks for your answer I really appreciate your time can you maybe tell me how to use the background worker to do this I have no experience in using a background worker
OriginalGriff 21-Dec-12 3:47am    
Exactlky what are you trying to do? I assume you are showing a "wait...I'm busy" box or similar while you do a long task?
mrDivan 21-Dec-12 3:49am    
yes that is correct
OriginalGriff 21-Dec-12 3:57am    
And your environment? Winforms?
mrDivan 21-Dec-12 3:58am    
Hi no its an asp.net application
A good start would be fixing your keyboard. Its shift key doesn't work. I fixed the effects on your text, but realized the pointlessness of my doing since your code most likely looks the same. And the Show[^] and Hide[^] methods require to start with a capital letter, just as many other .NET methods do.

With Christmas forthcoming, that could be your aunt Martha's long awaited chance for a last-minute present to you that you really appreciate.

Or you could use the Windows on-screen keyboard, but that's only feasable as an intermediate solution.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900