I am developing run time message page creation. Here I'm creating run time div with check box for each messages. But I'm using this one to get runtime.
CheckBox cb = (CheckBox)this.FindControl(n) as CheckBox;
But i can't get it.
            Asked
            
        
        
            Active
            
        
            Viewed 563 times
        
    0
            
            
         
    
    
        Krishna Rpr
        
- 21
- 9
- 
                    Share the complete method code. To understand better. – Prasanth Nov 04 '14 at 10:27
- 
                    And the aspx code with your CheckBox plz, to well understand your environment. – dramixx Nov 04 '14 at 10:30
- 
                    CheckBox ck = new CheckBox(); ck.ID = getEmailWithout(dt.Rows[i].ItemArray[0].ToString()); child.Controls.Add(ck); ck.Attributes["class"] = "profilenameText"; – Krishna Rpr Nov 04 '14 at 10:44
- 
                    This is My dynamic create code, but i'm getting respective id from my Database. But i cant access t – Krishna Rpr Nov 04 '14 at 10:46
- 
                    You provided very inappropriate information. Your code uses user defined functions, which are not mentioned. Kindly edit your post and provide aspx and aspx code information of the web form. – Prasanth Nov 04 '14 at 10:49
- 
                    Sorry I cant upload that! Thats y am providing dis – Krishna Rpr Nov 04 '14 at 10:57
- 
                    can you please provide snippet of your code? – Gaurav Jain Nov 04 '14 at 10:58
- 
                    http://mockupr.com/mu/isii7273/page1 – Krishna Rpr Nov 04 '14 at 11:06
1 Answers
0
            You should create your dynamic control every time on Page_Init if you would like to access them after Postback.
See link below for details:
http://msdn.microsoft.com/en-us/library/hbdfdyh7%28v=vs.100%29.aspx
Here you can see the same problem.
 
    
    
        Community
        
- 1
- 1
 
    
    
        Pavel Timoshenko
        
- 721
- 6
- 13