accessing dynamically generated webuser controls in code behind

G

gh0st54

Hi

i'm trying to access my dynamically generated web user controls from
code behind but always get the error :

System.NullReferenceException: Object reference not set to an instance
of an object.

i'm trying this to get the item

Page.FindControl("Form1").FindControl(this.pnlImageInfo.ID).FindControl("ImageInfo"+i+"_imgPic").ID.ToString();

if i add a textbox and try

Page.FindControl("Form1").FindControl(this.pnlImageInfo.ID).FindControl("TestId_"+i.ToString()).ID.ToString();

it works how come ?
how can i access my webuser control values ? yet it has getter and
setters

thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top