Welcome to Dream.In.Code
Getting Help is Easy!

Join 136,320 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,715 people online right now. Registration is fast and FREE... Join Now!




Not able to read the dynamic controls

 
Reply to this topicStart new topic

Not able to read the dynamic controls, Not able to read the dynamic controls

rajasreepradeep
26 Aug, 2008 - 11:47 PM
Post #1

New D.I.C Head
*

Joined: 23 Jun, 2008
Posts: 10

Hi,

I have created some dynamic controls in page load and added to an existing asp:Table

Its displaying in the page ( the page contains 3 tabs , this controls are added in one of the tab)

If I click on another tab , I am trying to save the data in this dynamic controls .

But not able to access it.

CODE


This panel is a part of one table.

<asp:Panel ID="pStudySpecific" runat="server" EnableViewState="true"  >  
            <%--<table width="100%" >   --%>    
            <tr>
                <td>                
                    <asp:Table width="100%" border="1" runat="server" id="tblTimeZone" enableviewstate="true" >                    
                        <asp:TableRow>
                            <asp:TableCell>
                                <asp:Table ID="tblTimeZones" runat="server" border="0" EnableViewState="true" >  
                                    <asp:TableHeaderRow HorizontalAlign="Left">
                                        <asp:TableHeaderCell HorizontalAlign="Left">
                                             <asp:Label runat="server" ID="lblTimeZoneDetails" Text="TimeZone" SkinID="GroupTitleSkin"></asp:Label>
                                        </asp:TableHeaderCell>
                                    </asp:TableHeaderRow>                                                                                                                                                        
                                </asp:Table>
                            </asp:TableCell>
                        </asp:TableRow>
                    </asp:Table>
                </td>
            </tr>
</panel>

1. page load create controls and added to tblTimeZones.


2.Tab( link button click event)

I tried to access control
ContentPlaceHolder cphDetails = (ContentPlaceHolder)this.Master.FindControl("cphDetails");
                            Table tblTimeZon = (Table)cphDetails.FindControl("tblTimeZones");
till here its fine ,I am getting the values.
DropDownList drpLstControl = (DropDownList)tblTimeZon.FindControl("drpLst" + objCustomField.DatabaseField);

In the above line its giving null value.




This all controls are in an update panel and content place holder.

Please help.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 07:21AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month