开发者

How do I refer to the ID of a control in a different Content Panel?

开发者 https://www.devze.com 2023-03-04 17:50 出处:网络
I have an ASPX page with multiple Content panels.In one panel is a RadioButtonList. In another panel is a data source that has a ControlParameter that references the RadioButtonList.This worked fine w

I have an ASPX page with multiple Content panels. In one panel is a RadioButtonList. In another panel is a data source that has a ControlParameter that references the RadioButtonList. This worked fine when the list and the data source were in the same pan开发者_StackOverflow中文版el, but when I moved them to separate panels the ControlParameter could no longer find the RadioButtonList.

How do I modify the ID the ControlParameter is looking for so it can find it in the other panel?


I found the answer elsewhere:

Use the ID of the content panel, a dollar sign, and the ID of the control.

For example if the ControlParmeter looked like this when they were in the same panel:

<asp:ControlParameter Name="tableName" Type="String"
     ControlID="rblCurrentEntityFriendlyName"
     PropertyName="SelectedValue"></asp:ControlParameter>

Then it would now look like this when the control was moved to a panel with ContentPlaceHolderID equal to CPHEntityPanel:

<asp:ControlParameter Name="tableName" Type="String"
         ControlID="CPHEntityPanel$rblCurrentEntityFriendlyName"
         PropertyName="SelectedValue"></asp:ControlParameter>

I got this answer from Adrian Johnson, who got it from "netneedsgiant, blog on May 5th 2006".

0

精彩评论

暂无评论...
验证码 换一张
取 消