ASPNET_MsgBox - help me understand
I am a little bit confused how it works. I have several subs that call the msgbox sub but it seems like messages are not displayed untill a new page_load takes place. Is this correct? Is there a script that could run at client and display message without having to go through page loads? Also when msgbox is being displayed it blanks the current page and does not overlay.
Code:
Private Sub CheckReportExists(ByVal DocumentName As String)
Dim myFSO
myFSO = Server.CreateObject("Scripting.FileSystemObject")
If (myFSO.FileExists(ViewState("FilePath") & "\" & DocumentName & ".pdf")) = True Then
Message = "Warning: Daily Sales Report already exists. If you want to overwrite then hit OK otherwise press Cancel"
ASPNET_MsgBox_Confirm(Message)
End If
myFSO = Nothing
Continueprocess = False
End Sub
Code:
Public Overloads Sub ASPNET_MsgBox_Confirm(ByVal Message As String) 'Confirm
hiddenMsgDiv.InnerHtml = "<script type=""text/javascript"">confirm('" & Message.Replace("\", "\\").Replace("'", "\'") & "');</script>"
End Sub
Code:
<div id="hiddenMsgDiv" runat="server" style="display: none">
</div>
</asp:Content>
Re: ASPNET_MsgBox - help me understand
When (at what event) do you want the message box to be displayed?