473,471 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

asp.net good practices?

Looking for a high level description of good practices.

I want to build a little admin tool for my site -- using asp.net, c#, and an
xml file as the database. Im kind of new to asp.net and im looking for a
suggestion on how to design it so that I can read and parse the xml within
my own objects and use the data to populate info in the html.

How should I use an external .cs file with an aspx page? Is there some kind
of special interface I have to implement in my cs file? Or can I design a
class (in the cs file) and instatiate it in the aspx and call methods on it?
Should I use databinding?

Basically looking for the most modular approach with least code in the
presentation layer.

Thanks in Advance,
Karl
Nov 18 '05 #1
2 1390
You want to create object(s) that handle the XML file right

Just add a class to your project, pretty much same like adding web forms... Anyway, you add a class and if the class is in the same namespace as the page(it will be by default if you add it in the same folder as the web form) or in its parent namespace you can use it normally... if the newly added class is in some other namespace or a child namespace you have to include the namespace with a using ... statemen

So just add a class, something like MyXMLObject into your project. Put all the code that reads/writes the XML file in its methods. You can then normally instantiate/use this class in your webpage class or in other words in your WebFrom1.aspx.cs or whatever...
Nov 18 '05 #2

Thanks.

One other question. Assuming I write my objects, should I be retrieving the
xml data with getters called from my aspx page? or is there a better way to
do that, like databinding?
"Adrijan Josic" <an*******@discussions.microsoft.com> wrote in message
news:1C**********************************@microsof t.com...
You want to create object(s) that handle the XML file right?

Just add a class to your project, pretty much same like adding web forms... Anyway, you add a class and if the class is in the same namespace
as the page(it will be by default if you add it in the same folder as the
web form) or in its parent namespace you can use it normally... if the newly
added class is in some other namespace or a child namespace you have to
include the namespace with a using ... statement
So just add a class, something like MyXMLObject into your project. Put all

the code that reads/writes the XML file in its methods. You can then
normally instantiate/use this class in your webpage class or in other words
in your WebFrom1.aspx.cs or whatever...
Nov 18 '05 #3

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

Similar topics

24
by: matty | last post by:
Go away for a few days and you miss it all... A few opinions... Programming is a craft more than an art (software engineering, not black magic) and as such, is about writing code that works,...
45
by: Brett | last post by:
If I do this without declaring a corresponding field, is it considered bad design? What are the advantages or disadvantages to either method? Notice there is not set. public string URL { get...
13
by: John Salerno | last post by:
Here are a few I'm considering: Design Patterns Explained : A New Perspective on Object-Oriented Design (2nd Edition) (Software Patterns Series) by Alan Shalloway Design Patterns C# by...
59
by: Alan Silver | last post by:
Hello, This is NOT a troll, it's a genuine question. Please read right through to see why. I have been using Vusual Basic and Classic ASP for some years, and have now started looking at...
2
by: engwar | last post by:
Which starter kit or open source project would you consider well-architected? Or more specifically which has good examples to showing a newbie how to separate presentation/business logic/data...
2
by: js | last post by:
I got this error when I moved my application to a new Windows 2003 server. I installed and recompiled the 'Microsoft.Practices.EnterpriseLibrary - June 2005" then added these assemblies to the...
1
by: John | last post by:
I took an hour or two to browse for articles, sites, and books that discuss practical patterns and best practices for XML Web Services in .NET. Essentially, I've gone through the Quick Starts <a...
0
by: job | last post by:
Mohamed Sharaf's has produced a Microsoft.Practices.EnterpriseLibrary production server installer: https://blogs.msdn.com/mohamed_sharafs_blog/archive/2005/09/18/470854.aspx Running the...
29
by: Nickolai Leschov | last post by:
Hello, I have done some programming, mostly on embedded systems but now I would feel like I have to learn good development practices (i.e programmer's good manners). Let's say I want to build an...
76
by: lorlarz | last post by:
Crockford's JavaScript, The Good Parts (a book review). This shall perhaps be the world's shortest book review (for one of the world's shortests books). I like Douglas Crockford (because I am a...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.