Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using the webbrowser control with a ASP.Net Page.
In this page there is an Update Panel and Details View control.
I want to read the content of the controls in the details view by using the method getElementByID but it is always returning null???
Posted

So you are doing this directly from a Windows Forms or WPF application? Okay, there are a couple of things you need to know.

The first thing to be aware of is the fact that ASP.NET mangles names so the control you are looking for will have a different name. It does this so that you can have the same client id in two controls, their ids won't clash in the rendered page.

The second thing is that you need to wait until the page has loaded before you try to read from the field. The web browser control does have events that you can hook into to get this.
 
Share this answer
 
Comments
Mohammad Al Hoss 1-Feb-14 8:38am    
the document-complete event is taking too much time to be triggered.
is there a workaround?
Pete O'Hanlon 3-Feb-14 6:24am    
No there isn't. This is entirely in the control of the page that's being rendered.
write following syntax to get value from TextBox within Detailview...Here I assume that Name of Detail View is MyDetailView & Name of Text Box is MyTextBox

var name=$get('<%= MyDetailsView.FindControl("MyTextBox").ClientID %>').value
 
Share this answer
 

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