2013-07-31 179 views
0

這是我radTextBoxradDock,我把這個在我的ParentPage無法裏面radDock從孩子訪問radtextbox

<telerik:RadDockZone ID="ZoneDescription" runat="server" BorderStyle="None" Width="600px"> 
       <telerik:RadDock ID="DockDescription" runat="server" EnableDrag="false" EnableRoundedCorners="true" 
        Title="Itinerary Description" Width="600px" Skin="Vista" DefaultCommands="None"> 
        <ContentTemplate> 
         <div style="padding-top: 5px;"> 
          <telerik:RadTextBox ID="rtxtDescription" runat="server" Width="100%" TextMode="MultiLine"> 
          </telerik:RadTextBox> 
         </div> 
        </ContentTemplate> 
       </telerik:RadDock> 
      </telerik:RadDockZone> 

從我的子頁面,我得到rtxtDescription的文本值喜歡,

(((this.Parent.FindControl("ZoneDescription") as RadDockZone). 
FindControl("DockDescription") as RadDock). 
FindControl("rtxtDescription") as RadTextBox).Text; 

(this.Parent.FindControl("rtxtDescription") as RadTextBox).Text; 

但都沒有w ork,不能訪問rtxtDescription
我該如何解決?在此先感謝:)

回答

1

請嘗試使用下面的代碼片段。

((ZoneDescription.FindControl("DockDescription") as RadDock).ContentContainer.FindControl("rtxtDescription") as RadTextBox).Text = "Your text here";