I have a functioning CDD that I add dynamically to the page during ON_LOAD. I also have a new Accordion that I declare in the ASCX file. Both of these work fine until I try to put the CDD inside the Accordion. I get the following error:
Couldn't get extender properties on extender . Make sure the ID is spelled correctly and the control is on the page.
With the CDD inside the Accordion, I find the dropdown id using:
tempControl = MyAccordion.FindControl("ddlClientCompany")
item1.TargetControlID = tempControl.UniqueID
When I step thru the code with VS I can see that the control is found and an ID is passed in. But an error is thrown:o my question is: 1) is this a bug? 2) What is the correct procedure to include a CDD within the Accordion?
Here is my full code for when I add the CDD (this works fine outside of the Accordion)...
Dim tempExtenderAs AtlasControlToolkit.CascadingDropDown =New AtlasControlToolkit.CascadingDropDown()
Dim item1As AtlasControlToolkit.CascadingDropDownProperties =New AtlasControlToolkit.CascadingDropDownProperties()
item1.Category ="clientCompanyID"
If item1.Category =""Then item1.Category ="none"
item1.DefaultCompany = bu.default_company_id
item1.PromptText ="-- Select Company --"
item1.ServiceMethod ="GetClientCompanies"
item1.ServicePath ="~/buService.asmx"
Dim tempControlAs DropDownList
tempControl = MyAccordion.FindControl("ddlClientCompany")
item1.TargetControlID = tempControl.UniqueID
tempExtender.TargetProperties.Add(item1)
I'll defer to Ted as Accordion expert, but I'm thinking you don't want UniqueID in "item1.TargetControlID = tempControl.UniqueID". I'd try just ID instead.
Thanks for your reply David,
First let me say that I think Atlas rocks and and glad to be part of the CTP, pain and all. Secondly, I am very excited about how Atlas has effect my application interface design- cool ideas with low overhead to implement...nice job!
I did try some combinations that included the ID instead of the UniqueID...but they didnt work.
Although I never got it to work by adding the Extender dynamically, I was able to get it to work when I fully declared the CDD within the ASCX page. This is a work around in my mind and would be very interested in finding out how to do this properly dynamically.
I am also unable to get the SELECTED_VALUE of the CDD from within the Accordion. I am forced to just parse the query object like so.
' lets try to checkout the form values manually
Dim tempDDLClientCompanyAs DropDownList = MyAccordion.FindControl("ddlClientCompany")
Dim tempDDLClientNameAs DropDownList = MyAccordion.FindControl("ddlClientName")
' This is still not returning a value
'client_name = sec.ScrubData(tempDDLClientCompany.SelectedValue)
'manager_name = sec.ScrubData(tempDDLClientName.SelectedValue)
Dim tempClientCompanyID = tempDDLClientCompany.UniqueID
Dim tempClientNameID = tempDDLClientName.UniqueID
Try
Dim formsCountAsInteger = (Request.Form.Count) - 1
If formsCount <= 0ThenExitTry
Dim countAsInteger = 0
' 1) Grab the values from the request for company and client name
Dim tempField, tempValueAsString
' This is not zero based because the forms collection is not zero based.
For count = 1To formsCount
tempValue =CType(Request.Form.Item(count),String)
tempField =CType(Request.Form.GetKey(count),String)
If tempField = tempClientCompanyIDThen
client_name = tempValue
EndIf
If tempField = tempClientNameIDThen
manager_name = tempValue
EndIf
Next
Catch exAs Exception
EndTry
Hi Matthew,
Are you adding the extender right next to the drop down? If they're in different naming containers than that might explain why it can't find it (i.e. even though you pass in UniqueID, it still wouldn't be able to find a match if it was only looking in its own naming container).
Thanks,
Ted
Thanks for the reply Ted,
Let me try to recall that issue...it was a day or so ago and I have since gotten my head around other items, but I believe I tried several places for the extender. 1) Outside the Accordion, and 2) inside the Accordion within the same pane as the CDD if that is what you mean. I'll pull the code tomorrow and see where I left off. cheers,
No comments:
Post a Comment