Results 1 to 2 of 2

Thread: ASPNET_MsgBox - help me understand

  1. #1

    Thread Starter
    Fanatic Member snufse's Avatar
    Join Date
    Jul 2004
    Location
    Jupiter, FL
    Posts
    912

    Question 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>

  2. #2
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: ASPNET_MsgBox - help me understand

    When (at what event) do you want the message box to be displayed?
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width