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!

C# .NET A Call for Best Practices.

Status
Not open for further replies.

wbochar

IS-IT--Management
Mar 14, 2003
72
US
I've been wrestling with C#/.net web content for the last while, bought crateloads of books and read gig's of websites... So many ways of dealing with page navigation to DB connections to CSS to everything else. So I thought about starting a Best Practices thread -- what people believe are the standard ways to setup common page designs/templates (that are not the built in ones that ship with 2003).

Methods/Functions/Script Blocks etc

- I've seen one large Pageload hold a whole site and its navigation/DB calls. This makes sense for smaller sites but as the size of a site and complexity grows creating namespaces seems more appropriate.. or is it really?

- Refraining from creating HTML content inside your C# code (IE HTMLstring += "<TABLE><TR><TD>Hello</TD></TR></TABLE>"; ). If this is bad form how do you handle dynamic controls or CSS formatted items like Lists (<UL><LI>). There is no <:ASP code that mimics html lists and so many CSS sites make use of HTML lists for interface components. So if you want to have a List with a bunch of Href's how do you handle that in C#/.net and retain the benefits of serverside code?

- When or When Not to use a dataset? Just for interface components (like drop downs etc)

- Passing values between the same page? URL variables are frowned upon and creating parameters and server transfers ( Server.Transfer("Webform2.aspx")) etc..

I find myself sliding into the abyss of.. I can generate code faster if I just dump out a string to a <:ASP label to create dynamic content. I know this poor form -- but its getting tough to see what good form is.

Any thoughts?

Wolfgang
 
Maybe an example page might help out in this discussion.

Document Viewer with folders.

You have a left handside navigation (folders that gets generated by a DB table that has the navigation items id/name/viewable etc..

Lefthand side navaigation:

Reviews for
-----------
Books:
CD:
Movies:
Games:

In the main content pane you would have the list of documents/reviews. When you click on one it would open a detailed view of the article.

- How would you implement this in C# psuedo code? What kind of structure and setup would you use? Why?
 
Have you looked at the Duwamish 7.0 example that ships with the Enterprise edition of VS.NET?

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top