Side effect of debugging ClientID in DataGrid ChildTable.

I am using Metabuilders ExpandingButtons  and started to get “Please check the page configuration“ error. Some investigation showed that my DataGrid control has two IDs, one as expected from ServerID and another with suffix “__Ctl0”.

<table id="dnn_ctr374_ResultsContainer_uscExternalSourceListMarden_grResultItems__ctl0" cellspacing="2" cellpadding="2" border="0" id="dnn_ctr374_ResultsContainer_uscExternalSourceListMarden_grResultItems">

JavaScript from  ExpandingButtons tries to use wrong ID(with suffix “__Ctl0”) and alerts the error.
After a lot of debugging I found that I've used RecursivelyFindControl function based on code from the thread, which navigated through child controls and Debug.Write ClientID . It seems that for internal ChildTable control of DataGrid it creates not null ClientID and on the Render step,both DataGrid.ClientId and  ChildTable.ClientID are generated.
I beleive that it is a bug in  System.Web.UI.WebControls.ChildTable.AddAttributesToRender code.
If both ChildTable.ClientID and parent DataGrid.ClientId are not empty,only ParentID should be rendered.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
posted @ Thursday, October 12, 2006 8:55 PM
Print

Comments on this entry:

No comments posted yet.

Your comment:



(not displayed)


 
 
 
 
 

Live Comment Preview:

 
«February»
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910