Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detect if Modal Popup is Active

Status
Not open for further replies.

mych

Programmer
May 20, 2004
248
GB
Hi

I'm struggling with detecting is a panel that has a ModalPopup Extender is active or not.

I have a page that is refreshed every 5 mins. On this page is a popup that allows a user to add a new diary entry. Unfortunately if the user is entering a new entry at the time the refresh happens they loose everything. I have removed the refresh (meta tag) and included an ASP:Timer with an OnTick event. The code for the OnTick is supposed to check if the modalpopup is active or not. If it is the time will just get reset for another 5 mins. If the popup is not active the page gets refreshed.

How do I detect if the popup is active or not?

Failing that I'll have to put an event on the button that opens the popup that will set a flag to on. And another event on the buttons that close the popup to cancel the flag. The OnTick even will then check the state of the flag to decide if the page is refreshed or not.

Suggestions please.

Mych

I've not failed! Just found 100 ways that don't work...yet!
 
an option:
Code:
			For x As Integer = 0 To (Application.OpenForms.Count - 1) Step 1
				If Application.OpenForms(x).Name = frmModalPopup.Name Then
					'do stuff.
				Else
					'do other stuff.
				End If
			Next x

--------------------------------------------------
Stubbornness is a virtue -- if you are right. --Chuck Noll
--------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top