Dynamic generation of controls
I have to generate a page with dynamic controls with data coming from database.Depending upon control type coming from database i have to create a control in the web page and assign value to it which comes from database. web control values also comes from database.Could any body can help me in this.
Mahesh JoshiPosted Nov 23, 2007, 12:30 AM
See the below code to create controls dynamically -
Suppose you need to create TextBox
TextBox t = new TextBox();
Get the value from the database and assign it
t.Text =
"abcd";some other examples -
DataGrid
dg = new DataGrid();DataGridView
dgv = new DataGridView();