Click here to Skip to main content
15,891,621 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi There,
I am using webBrowser control in my Windows vb.net application ,but I am stuck at one situation that, on webpage one button when i click on that button it opens new Modal poup but I have not Idea how to handle that modal popup in web browser, please help out...
Posted
Updated 14-May-14 3:16am
v4
Comments
OriginalGriff 4-Apr-14 4:48am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
nira.parmar 23-May-14 5:19am    
Hi ,

I show you my code
Private Sub WBrowser_DocumentCompleted(sender As System.Object, e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WBrowser.DocumentCompleted
WBrowser.ScriptErrorsSuppressed = True
If dtgrd.Rows.Count > 1 Then

WBrowser.Document.Window.Frames(1).Document.GetElementById("lbNavigation$ctl00$QuickSearch1$txtBillNumber").InnerText = dtgrd.Rows(rowid).Cells(0).Value
WBrowser.Document.Window.Frames(1).Document.GetElementById("lbNavigation$ctl00$QuickSearch1$drsQSDates$txtDateRangeStart").InnerText = "02/10/2013"
billcode = WBrowser.Document.Window.Frames(2).Document.Window.Frames(3).Document.GetElementById("ctl00_ContentPlaceHolder1_pnlHeaderDetail_txtHBKey").DomElement.value.ToString
' UserName = WBrowser.Document.Window.Frames(2).Document.Window.Frames(3).Document.GetElementById("LblUserName").DomElement.value.ToString
WBrowser.Document.Window.Frames(2).Document.Window.Frames(3).Document.GetElementById("ctl00_ContentPlaceHolder1_pnlStatus_btnAddStatus").DomElement.Click()
'WaitForPageLoad()
'WebBrowser1.Navigate("http://navigator.cevalogistics.com/ModalDialogs/AddStatuses.aspx?BillType=1&BillKeys=" & billcode)
' WebBrowser1.Navigate("http://navigator.uat.logistics.corp/ModalDialogs/AddStatuses.aspx?BillType=1&BillKeys=" & billcode)
WaitForPageLoad2()
Else
If UserName = Nothing Then
UserName = WBrowser.Document.Window.Frames(2).Document.GetElementById("DivHome").Document.Window.Frames("IfrHome").Document.GetElementById("LblUserName").InnerHtml
End If

End If


End Sub

But Problem is that when WBrowser.Document.Window.Frames(2).Document.Window.Frames(3).Document.GetElementById("ctl00_ContentPlaceHolder1_pnlStatus_btnAddStatus").DomElement.Click() this button click event fired it opens New window and I want to access control of these new window but not able to access control.Help me how to acces these new window .

1 solution

This CodeProject article may help - it's in C# but there are sites that will translate the code to VB if you can't.
Extended .NET 2.0 WebBrowser Control[^]

And there are a bunch of links on this msdn post[^]
 
Share this answer
 
Comments
nira.parmar 21-May-14 3:46am    
not getting solution.....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900