Solved

Firefox bug? Getting an Alert message to popup in an UpdatePanel

Posted on 2009-05-08
3
605 Views
Last Modified: 2012-05-06
I can use the following code to popup a MessageBox inside an Update Panel...

System.Web.UI.ScriptManager.RegisterClientScriptBlock(this.Page, typeof(Page), "myKey", "alert('ALERT MESSAGE!')", true);

The problem is that in Firefox none of my drop down boxes work after the message has gone. They appear but when I select an item it doesn't change. It seems to work fine in IE.

Any ideas how to fix this or perhaps another way of producing an alert in an UpdatePanel?
0
Comment
Question by:robaherne
  • 2
3 Comments
 
LVL 23

Expert Comment

by:adilkhan
ID: 24337886
Can you see when you do a VIEW SOURCE on the Page..

also maybe try...

Response.write("<Script>alert('Hello')</Script>")
0
 

Author Comment

by:robaherne
ID: 24353098
For some reason that doesn't work for buttons inside an UpdatePanel. I get...

Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.

Details: Error parsing near '<Script>alert('Hello'.
0
 

Accepted Solution

by:
robaherne earned 0 total points
ID: 24353228
FOUND THE SOLUTION!

http://forums.asp.net/t/1311393.aspx

ScriptManager.RegisterStartupScript(Button1, typeof(Button), "scriptkey","window.setTimeout(\"alert('test!')\",0);", true);

with window.setTimeout, the dropdowns will work properly after the alert.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now