Welcome Guest Search | Active Topics | Sign In | Register

JSPrompt(e) Options
mAgZz
Posted: Thursday, April 25, 2019 10:19:14 AM
Rank: Newbie
Groups: Member

Joined: 4/25/2019
Posts: 1
good day everyone, i would like to test the code below, but vs2015 gives me an error that "TYPE 'JSPrompt' is not defined". I hope someone can help me, thank you.

Code: Visual Basic.NET
Private Sub WebView_JSDialog(sender As Object, e As JSDialogEventArgs)
        Select Case e.DialogType
            Case JSDialogType.Prompt
                'Create a dialog
                Dim dlg As New JSPrompt(e)
                dlg.Owner = Me
                dlg.Message = e.MessageText
                dlg.Value = e.DefaultPromptText

                'Display the dialog for user input
                Dim result As Nullable(Of Boolean) = dlg.ShowDialog()

                'Call e.OK/e.Cancel based on whether user clicked "OK" in the dialog
                If result.HasValue AndAlso Not result.Value Then
                    e.OK(dlg.Value)
                Else
                    e.Cancel()
                End If
                Exit Select

            Case JSDialogType.Alert
                'Display a message box and then call e.OK to notify the browser
                'engine that user has confirmed the dialog. This is important
                'because either OK or Cancel must be called to prevent the default
                'dialog
                MessageBox.Show(e.MessageText, "JavaScript Message", MessageBoxButtons.OK)
                e.OK()
                Exit Select

            Case JSDialogType.BeforeUnload, JSDialogType.Confirm
                'Display a Yes/No message box and call e.OK/e.Cancel according
                'to user's selection
                If MessageBox.Show(e.MessageText, "JavaScript Message", MessageBoxButtons.YesNo) = MessageBoxButtons.OK Then
                    e.OK()
                Else
                    e.Cancel()
                End If
                Exit Select
        End Select
    End Sub
eo_support
Posted: Friday, April 26, 2019 9:29:05 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,218
Hi,

JSPrompt is a class in our TabbedBrowser sample application. You can't just copy the code from our sample application without understanding it. We won't support you on such basic general programming issue.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.