Getting Values of Dynamically Created Controls.

When you want to get a value of a dynamically created control, you need to create the control again while postback.

for example:

protected void Page_Load(object sender, EventArgs e)

private void createDynamicDDL()
DropDownList ddl_1 = new DropDownList();
tc.add(ddl_1);  // TableCell(Let’s say tc already exist.)


Unless you don’t do this, NullReferenceException will be occurred.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: