Changing a dynamic C# Code to database drven...

  • Thread starter Thread starter Sebastian Meier
  • Start date Start date
S

Sebastian Meier

Hi Everyone,

i have a "static" source code which works fine. my problem is now, that the
look of the internet page is only to be changed by editing the source code.
For better handling of the code i thought that i might generate the page
elements (textbox, label, dropdown aso) from a database.

is that possible and do you know any examples articles for drowpdowns,
textbox, labels from a database?


Thanks a lot!

Ciao
Seb.
 
Seb, there are many ways to do this. Lets say that I have a table with the
name of the control, the type and say it's position. you can walk through a
datareader or datatable and at each pass add the controls dynamically
setting there properties as you go. Is this essentially what you are
looking for?

--

W.G. Ryan, eMVP

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups
 
Hm,

not actually, cause the whole code of the page should be generate from a
database. That means eg. i have a Text (Label) then i have Dropdownlist or a
Textbox. Now i want to do the following (this not correct c# code ;-)

Page_Load
conn to database, read elements
1st Label and Value, 2nd Dropdown / Textbox

buttons aso. so all elements you have in an web page.


so that at the end i have a complete internet page generated from db.
currently i have a ascx controll in which the elemets are static and when i
add one i have to do that in the cs file to.

hope u get my problem?! so eventually the aspx/ascx page itself has no code.

sorry bad english today....

Cheers
Seb.
 
Back
Top