Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 7th, 2008, 02:34 PM
Friend of Wrox
Join Date: Mar 2007
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
Default [Resolved] ASPNET_MsgBox hides grid view

I have an application that displays a header section and a grid view based upon selection in header. This work s fine. The user has a button where they can export the content of the grid view (using the data set) to a table. This works fine as well. When export is completed I need to show the user that the 'export function" has completed. I am using following code:

Public Overloads Sub ASPNET_MsgBox(ByVal Message As String)
hiddenMsgDiv.InnerHtml = "<script type=""text/javascript"">alert('" & Message.Replace("\", "\\").Replace("'", "\'") & "');</script>"
End Sub

<div id="hiddenMsgDiv" runat="server" style="display: none">
where I pass the message text. The message box is being displayed Ok but it hides the underlaying grid. When user clicks OK the grid appears again. Any ideas?
Old October 7th, 2008, 03:07 PM
Friend of Wrox
Join Date: Mar 2007
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts

Got it working using this:

Page.ClientScript.RegisterStartupScript(Page.GetType(), Guid.NewGuid().ToString(), "alert(""" & Message & """)", True)
Not sure if this is correct or good solution

Old October 9th, 2008, 01:01 PM
planoie's Avatar
Friend of Wrox
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

I suspect the problem is that you are doing a full repaint, and the javascript for the alert is inline with the processing of the HTML. When the browser is parsing it hits the javascript alert which is a blocking call stopping the rendering of the HTML.

Add this to your javascript tag:


This will cause the javascript to run after the page as finished loading.

The Following User Says Thank You to planoie For This Useful Post:
snufse (May 26th, 2009)

Similar Threads
Thread Thread Starter Forum Replies Last Post
Grid view roopeshmkatlive.in ASP.NET 1.0 and 1.1 Professional 1 August 1st, 2008 01:03 PM
Help Grid View Drop Down List, view all jskinner123 ASP.NET 2.0 Basics 0 November 25th, 2007 06:25 PM
grid view komalpriya .NET Framework 2.0 3 November 7th, 2007 10:34 AM
grid view MunishBhatia ASP.NET 2.0 Professional 2 June 5th, 2007 12:15 AM
grid view MunishBhatia ASP.NET 2.0 Professional 1 May 25th, 2007 07:26 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.