PostBack "Please Wait..." Message.

G

Guest

Hi,
I have a datagrid with a radiobutton template column, with AutoPostBack set
to TRUE. When the user clicks on a radiobutton the application will
PostBack, and in the PostBack there will be certain logic performed, and the
dataview will be re-binded to the datagrid. There turns out to be about 2-5
seconds delay between the time the user clicks the radiobutton and when the
page is completely re-loaded. During this time the user may try clicking
into other controls unaware that the page is being refreshed, so what I'd
like to have happen is as soon as they click on the radiobutton I'll have a
popup window that states for them "to please wait..", and when the page is
finished re-loading have the popup window close. I tried doing this with
javascript and window.open and window.close but could not get it working.
Does anybody have a suggestion, or possibly sample code?

Thanks,
John
 
C

Curt_C [MVP]

John said:
Hi,
I have a datagrid with a radiobutton template column, with AutoPostBack set
to TRUE. When the user clicks on a radiobutton the application will
PostBack, and in the PostBack there will be certain logic performed, and the
dataview will be re-binded to the datagrid. There turns out to be about 2-5
seconds delay between the time the user clicks the radiobutton and when the
page is completely re-loaded. During this time the user may try clicking
into other controls unaware that the page is being refreshed, so what I'd
like to have happen is as soon as they click on the radiobutton I'll have a
popup window that states for them "to please wait..", and when the page is
finished re-loading have the popup window close. I tried doing this with
javascript and window.open and window.close but could not get it working.
Does anybody have a suggestion, or possibly sample code?

Thanks,
John
You'll have to stick with client side code, perhaps hit a javascript
group. The server side execution has no control.

You are on the right lines... you should be able to "window.open()" with
the client event and have the page send back a close call to the other
window
 
E

Eliyahu Goldin

John,

Entertain Users During Lengthy Operations may be interested for you.

Eliyahu
 
G

Guest

Eliyahu,
I found that article, but that solution was for "particularly time-consuming
operation over the Web. By 'time consuming operation' I mean all those
operations that, in a Windows Forms scenario, typically require a progress
bar."

My situation deals with only a couple to a few seconds that the user should
know not to try to make changes till the screen is refreshed. Is there a
simple way to indicate to the user that 'page is refreshing'?
 
E

Eliyahu Goldin

John,

Sorry for the missing link, it was supposed to be there.

Even if you tell the user that 'page is refreshing', you are more interested
in disabling input controls. What about handling client-side onclick events
to disable all html inputs and show a hidden text "The page is refreshing"?
It's a hassle, but if you really want it...

Eliyahu
 
D

Daniel Walzenbach

Here you go. I know this solution is not perfect but it's a start

..aspx
******************************************************************************************************

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb"
Inherits="ATV2004.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
<LINK href="/ATV2004/css/Styles.css" type="text/css" rel="stylesheet">

<script language="javascript">
<!--

var hMD;

function showMD()
{
hMD = window.showModelessDialog("SaveDialog.htm", "SaveDialog",
"dialogHeight:100px; dialogWidth:200px; scroll:no; status:no; help:no;");
}

function closeMD()
{
// debugger;
if(hMD != null)
{
hMD.close();
}
}

//-->
</script>
</HEAD>
<body MS_POSITIONING="FlowLayout" onload="closeMD();">
<form id="Form1" method="post" runat="server" onsubmit="showMD();">
<asp:Button id="Button3" runat="server" Text="Button"></asp:Button>
</form>
</body>
</HTML>


codebehind
******************************************************************************************************

Public Class WebForm1
Inherits System.Web.UI.Page

#Region " Vom Web Form Designer generierter Code "

'Dieser Aufruf ist für den Web Form-Designer erforderlich.

<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

End Sub

Protected WithEvents Button1 As System.Web.UI.WebControls.Button

Protected WithEvents Button2 As System.Web.UI.WebControls.Button

Protected WithEvents Button3 As System.Web.UI.WebControls.Button

'HINWEIS: Die folgende Platzhalterdeklaration ist für den Web Form-Designer
erforderlich.

'Nicht löschen oder verschieben.

Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init

'CODEGEN: Dieser Methodenaufruf ist für den Web Form-Designer erforderlich

'Verwenden Sie nicht den Code-Editor zur Bearbeitung.

InitializeComponent()

End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

' Hier Benutzercode zur Seiteninitialisierung einfügen

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click

System.Threading.Thread.Sleep(5000)

End Sub

End Class
 
G

Guest

Daniel,
I was not familiar with the "showModelessDialog" method. This will do
exactly what I need it to do!
Thanks again,
John
 
D

Daniel Walzenbach

great :)


John Walker said:
Daniel,
I was not familiar with the "showModelessDialog" method. This will do
exactly what I need it to do!
Thanks again,
John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top