Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Design Help

Status
Not open for further replies.

stevensteven

Programmer
Jan 5, 2004
108
CA
Hello,

I have a page that is going to dynamically display information from a database. What I am looking to do is to somehow add formatted text onto the page, but within the formatted text, I wanted to have controls in there as well, where they can handle events.

What is the best way to do this?

Thanks for your help.

Steven
 
Probably add text to a Label control, manipulate it's style properties, and have whatever buttons and stuff you want around the Label.
 
It kind of depends, though. Can you give any more detail about the requirements?
 
I want to have a label, which will generate tables etc. Within these tables, I wanted to have a a button that responds to an event in the .aspx.cs code. How can I have a button in a label in a table??

Steve
 
I suspected such might be the case with the tables.

peekay is right, in ASP.NET there's no need for looping in table creation because of the server control architecture, and convenience of ADO.NET data binding.

You simply create the DataGrid and its column structure in the designer, fiddle with ButtonColumn stuff a little, and DataBind() the data source to the grid and everything is generated for you. You even have robust control over formatting!

If, however, you have special needs where a DataGrid isn't adequate, it's still best to use the HtmlTable control for programmatic creation of tables and child Controls.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top