Click here to Skip to main content
15,899,475 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I created a web user control which represents a widget. The user control consists of some HTML for header and footer, the actual content of the widget is displayed with the help of an AJAX Gridview which is also placed inside the control. I bind the gridview with Javascript. Everything seems to work proper if i use the control just once on the webform but if used more than once the page only displays the HTML from the user control and does not show any grid content for the others except the very first place where i have placed the control on the webform. If i had to view the page source it shows the gridview id and generated HTML body just shows and empty table with a body tag. Is this an ambiguity issue or anything else i should be looking for while the control is being rendered?
Posted

1 solution

Hello!

I once had a problem with a user control I added twice in the same page. In my case, the javascript functions didn't know which control to refer, due to the fact that I had the same ids in the user controls and the javascript only wokred for the first control.
I solved the problem by changing the controls' ids and by changing the javascript function to look for the client id of the control, e.g.:

<br />
document.getElementById("<%=ControlName.ClientID%>")<br />


Hope this helps a bit!
 
Share this answer
 
v2
Comments
adnan_1985 20-Jun-11 2:27am    
@tech spec - the first thing i did it was this. it does not help. Thanks

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