Welcome Guest Search | Active Topics | Sign In | Register

webview1_click Options
basim_din
Posted: Thursday, December 30, 2021 6:10:11 AM
Rank: Newbie
Groups: Member

Joined: 12/26/2021
Posts: 6
when I used webview1.evalscript inside webview1_click the project stop working
can any one help me plz
basim_din
Posted: Thursday, December 30, 2021 7:22:52 AM
Rank: Newbie
Groups: Member

Joined: 12/26/2021
Posts: 6
i used vb.net winform visual basic
eo_support
Posted: Thursday, December 30, 2021 1:39:21 PM
Rank: Administration
Groups: Administration

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

This is to prevent JavaScript engine from being re-entered. Please use WebView.QueueScriptCall instead.

Thanks!
basim_din
Posted: Friday, December 31, 2021 2:19:43 PM
Rank: Newbie
Groups: Member

Joined: 12/26/2021
Posts: 6
so how to return value from input in webpage using WebView.QueueScriptCall
example:TxtFirtName.Text = WebView1.EvalScript("document.getElementById('pt1:r1:0:it2::content').innerText ;")

thanks alot
eo_support
Posted: Monday, January 3, 2022 9:36:50 AM
Rank: Administration
Groups: Administration

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

You would do it like this:

Code: Visual Basic.NET
Dim scriptCall = webView.QueueScriptCall("document.getElementById('pt1:r1:0:it2::content').innerText")
scriptCall.OnDone(Function()
    MessageBox.Show(scriptCall.Result.ToString())
End Function)

Note that inside the OnDone callback you use scriptCall.Result to access the result.

Thanks!
basim_din
Posted: Tuesday, January 4, 2022 6:09:59 AM
Rank: Newbie
Groups: Member

Joined: 12/26/2021
Posts: 6
hi
it is not working
there is error in the code

if you can help me please

thanks alot
eo_support
Posted: Tuesday, January 4, 2022 9:20:00 AM
Rank: Administration
Groups: Administration

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

The sample code is only to show you the idea. You will have to understand the code, adapt it to fit your need, and debug it if you run into any problem. You can't just say "it's not working" and expecting us to fix it for you. If you wish us to look into an error for you, you will need to at least explain what error you are running into and why you believe this error needs to be resolved on our end. For simple compiler errors or logical code errors, you will need to resolve those yourself.

Thanks!
basim_din
Posted: Wednesday, January 5, 2022 3:48:18 AM
Rank: Newbie
Groups: Member

Joined: 12/26/2021
Posts: 6
hi
i try c# code like this
var scriptcall = webView1.QueueScriptCall("document.getElementById('email').value");
scriptcall.OnDone(() =>
{
MessageBox.Show(scriptcall.Result.ToString());
//code to be called when done
});
and it is working
but i need it in vb so inside ondone(this syntax not working)
i try to write code inside ondone() in defferent ways but it not working alwayes error
error msg
Severity Code Description Project File Line Suppression State
Error BC30521 Overload resolution failed because no accessible 'OnDone' is most specific for these arguments:
'Public Overloads Sub OnDone(action As Action)': Not most specific.
'Public Overloads Sub OnDone(action As Action(Of WaitableTask))': Not most specific. WindowsApp1 C:\Users\basim\source\repos\WindowsApp1\WindowsApp1\Form1.vb 45 Active


thans alot
eo_support
Posted: Wednesday, January 5, 2022 7:28:39 AM
Rank: Administration
Groups: Administration

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

Please change Function to Sub:

Code: Visual Basic.NET
Dim scriptCall = webView.QueueScriptCall("document.getElementById('pt1:r1:0:it2::content').innerText")
scriptCall.OnDone(Sub()
    MessageBox.Show(scriptCall.Result.ToString())
End Sub)


Thanks!
basim_din
Posted: Thursday, January 6, 2022 12:55:32 AM
Rank: Newbie
Groups: Member

Joined: 12/26/2021
Posts: 6
hi
its working well
thanks alot alot alot


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.