Adding Ascx controls Dynamically using asp.net

Hi friends you can add User controls dynamically using the following code

if there exists a Student page and you need to add a user control into this page when button1 is clicked

so you should write code like this for button click

private void button1_click(sender object, Eventargs args)
{

Student setproject = (Student)LoadControl(“Include/Product.ascx”);

//or
this.Controls.Add(Controlid)
}

Advertisements

About kakani santosh kumar

Working as Software Engineer in Prithvi Information Solutions having 3 years of Experience in Dotnet Framework ranging from 1.1 to 3.5
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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