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!

Question about labels

Status
Not open for further replies.

Naoise

Programmer
Dec 23, 2004
318
IE
What is the most flexible way to produce a table of results without using a datagrid or a dataset?

Methods considered so far

1)If I use the code behind model would it be best to have a function that simply binds to an asp label? This means of course that all my tables will be wrapped in span tags.

2)I have seen code that says you can place something along the lines of <%# DisplayTable() %> in your aspx page where the code behind page contains a function whose return value can be converted to string. I have tried the above with a
test like this

Function DisplayTable() as String
DisplayTable = "<table><tr><td>Test</td></tr></table>"
End Function

but it did not display. Any thoughts?
 
Firstly, why do you want to avoid those controls and objects?

Secondly, there is an ASP.NET Table control.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
I don't like the dataset because of the problems that arise from disconnected data and concurrent activity on a particular site. Datagrids while functionality rich take time to complete even a simple task to a beginner like place a one pixel graphic border around a datagrid (do I have to wrap it in my own table), have a blank row ahead of the <Columns></Columns>. I understand the idea of trying to separate the business logic from the presentation layer on a page by page basis but I would feel increased flexibility if I could hand code some of my html controls and simply interpret them in the aspx page. I have not looked into the asp.net table control, hopefully it has a manageable amount of attributes to get something off the ground quickly. Do most people just bite the bullet and go with datagrids, or a mix of an asp-esque type solution?
 
If you don't like DataSet's, consider using a DataTable (a DataSet is just a collection of DataTables) or a DataReader.

As for styles, you can use CSS to style any .NET control, so you can simply applythe relevant class to whichever control needs it (you can specify different classes for different rows etc).


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top