| | |
web browser's Browser_DocumentCompleted event is firing only first time,plz help
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2008
Posts: 12
Reputation:
Solved Threads: 0
Hi all,
I have a window service from which i am calling a windows application in c#.
and i am using web browser in window application to get html from a link,
but problem is that web browser's Browser_DocumentCompleted event is firing only first time when service calls application,only for the first page, it is not going on second page,not firing again,
but if we run the application alone it fires till the end of paging....working fine....
but i have to call it from service.
this is the code ---------
Please help me....
I have a window service from which i am calling a windows application in c#.
and i am using web browser in window application to get html from a link,
but problem is that web browser's Browser_DocumentCompleted event is firing only first time when service calls application,only for the first page, it is not going on second page,not firing again,
but if we run the application alone it fires till the end of paging....working fine....
but i have to call it from service.
this is the code ---------
ASP.NET Syntax (Toggle Plain Text)
public void myFunction() { System.Windows.Forms.WebBrowser Browser = new WebBrowser(); clsErrorLog.WriteLog("goes for browser"); Uri url = new Uri("my_url"); Browser.Url = url; Browser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(Browser_DocumentCompleted); Browser.Visible = true; Browser.Size = new System.Drawing.Size(758, 539); } --this is event private void Browser_DocumentCompleted(object sender, System.Windows.Forms.WebBrowserDocumentCompletedEventArgs e) { System.Windows.Forms.WebBrowser Browser = (System.Windows.Forms.WebBrowser)sender; this.Controls.Add(Browser); HtmlDocument Doc; Doc = Browser.Document; int LastPagerIndex = 0; Boolean ChkAltBtn = true; string AltPagerText = ""; string ctlType = ""; ctlType = "a"; Boolean IsAnchor = true; if (IsAnchor) { if (ctlType.Trim().Length > 0) { HtmlElementCollection ctl = Doc.GetElementsByTagName(ctlType); if (ctl != null) { for (int i = 0; i < ctl.Count; i++) { if (ctl[i].InnerText != null) { if (ctl[i].InnerText.Trim() == (PagerBtnText - 2).ToString()) { LastPagerIndex = i; } if (ctl[i].InnerText.Trim() == PagerBtnText.ToString()) { ctl[i].InvokeMember("Click"); ChkAltBtn = false; Browser.Show(); } } } } } PagerBtnText++; }
Please help me....
![]() |
Similar Threads
- does C# Window Service supports Browser_DocumentCompleted event of Web browser? (ASP.NET)
- How to close web browser (Python)
- Web Browser(C# + other .NET technologies) (C#)
- WEB BROWSER in java help (Java)
- newbie...applet db doesn't work at web browser... (Java)
- C++ interaction with a web browser? (C++)
- Computer shutting down with web browser? (Troubleshooting Dead Machines)
- web browser/HTML project w/ C++ attempt2 (C++)
- Web Browser consume little resources (IT Professionals' Lounge)
- Automate Web Browser (VB.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: onmouseover / onmouseout advice
- Next Thread: Retrieve EditItemTemplate controls of GridView at code-behind file
| Thread Tools | Search this Thread |
access adult advertising ajax analytics apple apps beta blog botnet browser browsers business censorship cheap code combo community company cpanel crime css data design developer development digg directory domain domains dropdownlist email encryption eu europe firefox forms fraud free google government hosting html ie8 india intel internet internetexplorer java legal legislation linux malware maps marketing microsoft mobile module monetization mozilla msn net news opera patch porn privacy registration report reseller reuse rss safari safety search security seo service sex shared site socialnetworking software survey teenagers uk vb6 video w3c web webmail website wiki wikipedia windows windows7 wolframalpha xml yahoo youtube






