Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2009-05-08
3
608 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:Saqib Khan
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

837 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