asp.net - How to get updated page information through C# WebBrowser when updatePanel AJAX event happens? -


i automating scenario in wpf using webbrowser. code snippet follows

string id = paginationcontrolprocessing[1].pagectrl.id; webdoc.getelementbyid(id).gotfocus += new htmlelementeventhandler(wb_ongotfocus_paginationcontrols); webdoc.getelementbyid(id).focus();  webdoc.getelementbyid(id).raiseevent("onchange"); webdoc.invokescript("__dopostback", new object[] { "ctl00$contentplaceholder1$pgcontrol$nextpagelink", "" }); 

when page changes through pagination control, able hit event handler focus change. problem happening when pagination controls hit not able retrieve data 2nd , 3rd page.

i can page navigation , works in webbrowser control. data updated in table these asp.net ajax controls attached. in event handler, when content of object webbrowser1, not contain content of new data appears in updatepanel control. data control when 2 , 3 clicked comes through updatepanel asp.net control.

what event can used capture data coming updatepanel control server?

one way achieve task specified above use fiddlercore 1 has aware of gotchas related certificate generation in fiddlercore since asp panel controls use https mostly. interactions on panel control of asp generates partial post requests result in partial responses updatepanel contents. not update page source nor there automatic redirection happening. once page loaded, interactions happening in panel controls must handled application driving automation , cannot done through webbrowser unaware of update in page. aware updatepanel responses can update __viewstate , other hidden values. use fiddler capture responses , re create them using custom processing through httpwebrequest. httpclient not suitable cases since needs separate thread handle async task , can become messy handle events passing between ui, webbrowser, fiddler thread , httpclient tread.

a place on usage of fiddlercore @ google group fiddler.


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -