473,320 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

datagrid/list vs. roll-your-own ASP templates?

I'm new to ASP in general. Have been doing a bunch of stuff using classic
ASP and a bit of stuff with ASP.NET (all with VBscript).

The .NET stuff i've been doing has been fairly simple...generating a report
from an Access table. The Datagrid along with some TemplateColumns seemed to
work well for that.

I'm not needing to now pull data from our Homemade CMS database to present
on our public site.

Datagrids and lists don't seem appropriate for this. They seem great for
whipping out quick data views, but seem really limited when it comes to
tweaking the display to include CSS, accessibility tags and attributes, and
formatting.

I need to spit out some content in this format:

[get the last 4 items from the newsitem table and use the template below]

<div class="newsitem">
<span class="date">[get the date and put it here]</span>
<h3>[get the date]</h3>
<p>[get the first 40 words]</p>
<p class="moreLink"><a>View More</a></p>
</div>

When I need something like this, are there any server controls I should look
at, or should I forget that and just go back to using inline ASP if/then
loops with a lot of response.write's to generate the wrapping HTML?

Actually, to simplify the question:

When should I use server controls vs. hand-rolled ASP templates?

-Darrel
Nov 18 '05 #1
5 1330
Try Repeater Web server control.
The Repeater Web server control is a data-bound container
control that produces a list of individual items. You
define the layout of individual items on a Web page using
templates.
http://msdn.microsoft.com/library/default.asp?
url=/library/en-
us/cpgenref/html/cpconrepeaterwebservercontrol.asp

Bin Song, MCP
-----Original Message-----
I'm new to ASP in general. Have been doing a bunch of stuff using classicASP and a bit of stuff with ASP.NET (all with VBscript).

The .NET stuff i've been doing has been fairly simple...generating a reportfrom an Access table. The Datagrid along with some TemplateColumns seemed towork well for that.

I'm not needing to now pull data from our Homemade CMS database to presenton our public site.

Datagrids and lists don't seem appropriate for this. They seem great forwhipping out quick data views, but seem really limited when it comes totweaking the display to include CSS, accessibility tags and attributes, andformatting.

I need to spit out some content in this format:

[get the last 4 items from the newsitem table and use the template below]
<div class="newsitem">
<span class="date">[get the date and put it here]</span>
<h3>[get the date]</h3>
<p>[get the first 40 words]</p>
<p class="moreLink"><a>View More</a></p>
</div>

When I need something like this, are there any server controls I should lookat, or should I forget that and just go back to using inline ASP if/thenloops with a lot of response.write's to generate the wrapping HTML?
Actually, to simplify the question:

When should I use server controls vs. hand-rolled ASP templates?
-Darrel
.

Nov 18 '05 #2
I battle with this alot myself and am by no means a master of this, but I
can tell you some things that I know (also being an old ASP/VB programer
since 4.0 :) )

For attaching style sheets to a grid control, look around for the cssclass
command of the control (<asp:datagrid cssclass=<name>>). This will allow
you to get the look that you want by attaching CSS files to your grids.

If you really want to 'take it up a notch', think about using XML/XSL and
other related technologies to do your pages. If you get the huge MS-Press
book on XML they go through everything you need to know in there. But be
warned: it is not for the newbies and took me months to figure out how to
put it all together to build an app. Also, I am still having problems with
the XML techniques when it comes to the display of certain data in the grids
(ie. appostrofies in names and other special characters). Also, I found an
XML solution to be harder to support because of the extra levels that need
to be worked out, which adds complication to the app. The programmers that
I work with are less experienced than I am and they can never troublshoot
the XML stuff because it is too complex for them to follow. This creates
great job security, but also alot of headaches because I am the only one
that can work on certain apps.

I hope this helps. Maybe others have ideas too. All the best to you!

Scott

"darrel" <no*****@hotmail.com> wrote in message
news:Ok**************@TK2MSFTNGP12.phx.gbl...
I'm new to ASP in general. Have been doing a bunch of stuff using classic
ASP and a bit of stuff with ASP.NET (all with VBscript).

The .NET stuff i've been doing has been fairly simple...generating a report from an Access table. The Datagrid along with some TemplateColumns seemed to work well for that.

I'm not needing to now pull data from our Homemade CMS database to present
on our public site.

Datagrids and lists don't seem appropriate for this. They seem great for
whipping out quick data views, but seem really limited when it comes to
tweaking the display to include CSS, accessibility tags and attributes, and formatting.

I need to spit out some content in this format:

[get the last 4 items from the newsitem table and use the template below]

<div class="newsitem">
<span class="date">[get the date and put it here]</span>
<h3>[get the date]</h3>
<p>[get the first 40 words]</p>
<p class="moreLink"><a>View More</a></p>
</div>

When I need something like this, are there any server controls I should look at, or should I forget that and just go back to using inline ASP if/then
loops with a lot of response.write's to generate the wrapping HTML?

Actually, to simplify the question:

When should I use server controls vs. hand-rolled ASP templates?

-Darrel

Nov 18 '05 #3
> For attaching style sheets to a grid control, look around for the cssclass
command of the control (<asp:datagrid cssclass=<name>>). This will allow
you to get the look that you want by attaching CSS files to your grids.
But isn't a grid inherently a table? That's one of the problems I'm finding.
I'm really trying to move our site towards less tables and more CSS for a
variety of reasons. ASP.NET seems to be a bit of a hindrance in that regard.
If you really want to 'take it up a notch', think about using XML/XSL and
other related technologies to do your pages.
Yea, that's probably taking it up too many notches for now ;o)
This creates
great job security, but also alot of headaches because I am the only one
that can work on certain apps.
Ha! Yea, that's a tough one ;o)
I hope this helps. Maybe others have ideas too. All the best to you!


And thanks for the info!

-Darrel
Nov 18 '05 #4
> Try Repeater Web server control.

Hmm...that looks promising. Thanks for the info on that...off to read for a
bit!...

-Darrel
Nov 18 '05 #5
The other guys' reponses are good ones ... here is yet another option to
consider. I use the classes below instead of Response.Write("my html goes
here"); .... works pretty well. I don't use css much but I imagine it can
be incorporated as you might hope it does.

HtmlTable class
HtmlTableRowCollection
HtmlTableRow
HtmlTableCell

Then add these to a PlaceHolder control or similar on your page.

HTH,
mark
www.dovetaildatabases.com

"darrel" <no*****@hotmail.com> wrote in message
news:Ok**************@TK2MSFTNGP12.phx.gbl...
I'm new to ASP in general. Have been doing a bunch of stuff using classic
ASP and a bit of stuff with ASP.NET (all with VBscript).

The .NET stuff i've been doing has been fairly simple...generating a report from an Access table. The Datagrid along with some TemplateColumns seemed to work well for that.

I'm not needing to now pull data from our Homemade CMS database to present
on our public site.

Datagrids and lists don't seem appropriate for this. They seem great for
whipping out quick data views, but seem really limited when it comes to
tweaking the display to include CSS, accessibility tags and attributes, and formatting.

I need to spit out some content in this format:

[get the last 4 items from the newsitem table and use the template below]

<div class="newsitem">
<span class="date">[get the date and put it here]</span>
<h3>[get the date]</h3>
<p>[get the first 40 words]</p>
<p class="moreLink"><a>View More</a></p>
</div>

When I need something like this, are there any server controls I should look at, or should I forget that and just go back to using inline ASP if/then
loops with a lot of response.write's to generate the wrapping HTML?

Actually, to simplify the question:

When should I use server controls vs. hand-rolled ASP templates?

-Darrel

Nov 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: SammyBar | last post by:
Hi, I'm trying to bind a custom collection class to a data grid, following the guidelines from the article http://msdn.microsoft.com/msdnmag/issues/05/08/CollectionsandDataBinding/default.aspx....
1
by: xrow | last post by:
Hello I have a simple webservice / c# application that receives data from server and prints the data in the asp:datagrid control I have problem when sorting data in datagrid I have created...
5
by: BBFrost | last post by:
Win2000 ..Net 1.1 SP1 c# using Visual Studio Ok, I'm currently in a "knock down - drag out" tussle with the .Net 1.1 datagrid. I've come to realize that a 'block' of rows highlighted within...
1
by: Muhammad Usman | last post by:
Respected Assistant I have table in a database named "student" having fields like name of student,Roll No and Status.The status is one of them absent,present or leave.The name and rollno field...
2
by: Steve Chatham | last post by:
I have a datagrid that I want to put sku information into. I can load the select info there, such as: Item# Description Weight etc. However, in the right hand column, or maybe to the right...
1
by: Henk | last post by:
How can I put a certain value of my datagrid into a variable? For example if I have a datagrid with numbers, and I want to put the first value of the first column into an integer :roll: :roll: ...
15
by: glenn | last post by:
Hi folks, I have a DropDownList in a DataGrid that is populated from records in a database. I want to add a value that might be a string such as "Select a Company" for the first item since an...
2
by: Alex Maghen | last post by:
I'd like to set up the DataGrid so that as users rollover a row, that row is highlighted a different color and then goes back on roll-out. Any samples for how to set that up?
0
by: cindy | last post by:
I have a dynamic datagrid. I have custom classes for the controls public class CreateEditItemTemplateDDL : ITemplate { DataTable dtBind; string strddlName; string strSelectedID; string...
2
by: NHEXTECH | last post by:
HI I am using asp.net 1.1. My requirement is if i click the data grid cell (like roll no) i want to show the corresponding details about that roll number(like mark ,name)in text box.In data grid...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.