.NET site - Need help getting started!!!

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

This si a repost, I apologize but perhaps my original inquiry got
buried under all the usenet spam...

I need some help getting started with a .NET web project for a
commercial site. I am new to .NET and my understanding of some (but
not all) of its concepts is a little sparse. I apologize for the
length of this message, but hopefully it will help someone here give
me the most concise and useful information, and perhaps help others
out as well. :)

It's been a while since I've had to design anything "real" for the
web. I think the last time was just before the HTML 4.0 standard came
out. I am a professional C++ developer, and I am now taking on some
web work, and kind of need to hit the ground running with .NET. I
have some general site / application design questions that I'm hoping
someone might be able to answer to help me to that end. :)

I want to emphasize that this is a "real world" application I'm
developing, and as such sometimes some of the more academic constructs
used in the text books give way to better and cleaner-looking
solutions (for example, nobody "really" uses the familiar MS
access-style data grids in their commercial productions.) Overall,
the site I am working on is pretty straightforward, and my only real
motivation for using .NET here is that I want to become more
proficient with it, and migrate to it as a means of development... all
of that said...

My website will provide information and interat with the user in the
mortgage business. So, it wil do things like quote current interest
rates, as well as calculate payments and employ a few other business
rules objects that I feel .NET will be well suited for. What I am
having trouble learning is where the "marriage" comes in between the
server-side stuff that .NET does, particularly with web forms, and the
HTML structure and formatting stuff that makes the page look nice. As
much as I detested the design-time controls in VS6, they, and the site
templates at least took care of some of this for you, even if the
designs did look kind of chesey right out of the box, and a pain in
the butt to modify or author your own.

Consider this: Physically, all (or at least most) of the pages on my
site will be laid out with a coloured bar down the left side of the
page, which contains button images I've done up in PhotoShop. The
remainder of the page is the "body" area, where my non-scrolling
background will go, over which I will place the content for the page.
As the user navigates the site, the buttons on the left will change to
reflect the options available at that point on the web, and of course
the content in the main page area will change as they navigate as
well. When users first enter the site, they will be asked to provide
logon information that will be used throughout the sesion to provide
customized content (ie information relavent to their customer profile,
pending loan application, etc.)

In the good ol' days of HTML, we'd accomplish this most likely with
frames, and using an HTML FORM to post the logon data back to some
script on the server (ewe... CGI... Yuck).

With .NET, we seem to have these things called webforms (aspx files),
and it seems pretty straightforward to design one. I had no trouble
making a nice cheesy login screen and pulling up the info out of the
database for the customer... the concepts of the data connections,
datasets (I think we used to call them "recordsets")... all that is
pretty simple.

But what about the visual aspect of this? Should I use a FRAMESET on
my site, putting the .aspx pages in the appropriate frames at the
appropriate time? Or, Should I visually build the TABLE structure on
the default.aspx page and then write code behind it to put the right
things in the right parts of the table at the right times? (ie the
proper buttons in the left table section, and the proper content /
form controls in the right-hand section) - This concept is employing a
full-screen table to break up the browser window into the logical
components I want. I don't know if this methodology is outdated,
which is why I'm asking all of this. ("once HTML, always HTML" LOL)

On one hand, the latter seems to be in the spirit of .NET - One page,
from the user's perspective, that dynamically serves up all the
content for the entire session... Or should I be attacking this in a
different way? How, for example would I include a web form inside of
a static HTML element, like the TABLE, to yield the nicely formatted
results I'm looking for, or what .NET approach should I be using
instead?

I know that the old .asp approach to things was to have the global.asa
file contain the data objects (like the session information) for the
site, and then .asp files within the site could refer to that global
information to pass data such as your logon / account information from
one page to another as you traverse the site. I don't really know
what mechanisms should be used for doing this in .NET and, what makes
it worse is that I'm under a real time crunch on this particular
project. Thank God I'm a quick study. :) .NET does not seem to
employ traditional .asp pages. I mean, while it seems to parse them
fine, there is no template for creating a new .asp page, only a
webform (aspx), unless that is the approach to be used for presenting
all content? Hmm... These are the things I really need answered. :)
I could probably get myself through this, hard and hand coding around
the files to force it to do what I want, but I'd rather do this the
"right" way from the get-go, so that growing and maintaining the site
will not be come and ever-increasing chore.

I want to thank anyone who's had the patience to read through all of
this for your time. An example of a project would be a GREAT
resource, but if you can at least give me concise enough information
to get me pointed in the right direction, I can figure out the rest I
am sure. Thank you VERY much! :)

JIM
 
You ask some good questions there.

My website uses over 20 databases (.mdb) to display info on the site
(www.arlingtonsoccer.org) Every 3 months there is a new season with over
2200 games, all needing to get scores recorded, standings calculated, etc.

My Practice (been using .NET for 2 years now) has finally got to the point
where I can, at any time, replace everything between the <body></body> tags
and never once touch my Database code! This took a goodly while for me to
figure out how to do so. The MS 'Best Practices' do not allow this.

What I have done is place all of my DataBase objects (connections, commands,
adapters, datasets) in the Global.asax file.

Then on any page I need database access I create a nested class called
'Worker' that INHERITS Global.

Then by instancing a variable of that Worker Class I have access to all the
database objects.

Therefore my Object Browser will report like so:

Public Class Global
Public Class Main
Public Class Main.Worker
Public Class Login
Public Class Login.Worker
Public Class Scores
Public Class Scores.Worker

This is accomplished like so:

Public Class Main
Inherits Web.Forms

Public Class Worker
Inherits Global
End Class

End Class

So the Class Main.Worker will hold most of my Main functions (Doh) like

Public ReadOnly Property IsRegistered(ByVal username as String) as Boolean
End Property

Public ReadOnly Property IsAdmin(byVal username as String) as Boolean
End Property

Any page that I may need these functions I just declare a variable

Dim wrMain as New Main.Worker

----------------------------------------

Also you want to USE PANELS, lots of panels.
You can build an entire website with one page having as many panels as you
need.

Always, the first thing I do upon design is to place as many panels on the
page I may need, then write my first Sub:

Private Sub ShowPanel(ByVal panel as String)
Me.pnlOne.Visible = False
Me.pnlTwo.Visible = False
Select Case panel
Case "One"
Me.pnlOne.Visible = True
Case "Two"
Me.pnlTwo.Visible = True
End Select
End Sub

If you followed the link I placed above, you will see my default page, this
page has 14 panels on it that correspond to the 'Sections' on the Left of
the page, whichever Section you clik on, determines which panel you view.
Most panels either grab data from a database, or a static XML file.

If you are on a different page, and clik on the left navigation, you return
to default.aspx with a section= querystring that determines which panel you
are shown.

------------------------------------------

This allows me to completely rebuild any page at any time --- sigh it seems
once every two years the Board of Directors decides to change our color
scheme - what a pain that used to be! but no longer!

Now, of course when I replace all items between the body tags, I have to
delete all the events that were associated with the controls that are no
longer there, and re-code for the events of the new controls added, but that
is just responding to events, and the code to respond is in the worker
class, I just have to call upon the event firing.

Hope this is clearer than mud.

Severin
 
Hi, Jim,

Boy, I know that feeling. I have little ASP.NET experience myself, and I
also have a site (demo - thank goodness) to finish quickly.

I'm going to break this down into chunks, to make it easier to respond and
for others to follow along. Just realize that any advice I have is strictly
my own way of doing things and may not be "best practice." =)
My website will provide information and interat with the user in the
mortgage business. So, it wil do things like quote current interest
rates, as well as calculate payments and employ a few other business
rules objects that I feel .NET will be well suited for. What I am
having trouble learning is where the "marriage" comes in between the
server-side stuff that .NET does, particularly with web forms, and the
HTML structure and formatting stuff that makes the page look nice. As
much as I detested the design-time controls in VS6, they, and the site
templates at least took care of some of this for you, even if the
designs did look kind of chesey right out of the box, and a pain in
the butt to modify or author your own.

I don't think VS.NET supports themes the way that Visual Interdev did. I
certainly didn't find any when I looked, but then again, I wasn't fond of
the themes. I usually built a template design in FrontPage and copied the
HTML over.
Consider this: Physically, all (or at least most) of the pages on my
site will be laid out with a coloured bar down the left side of the
page, which contains button images I've done up in PhotoShop. The
remainder of the page is the "body" area, where my non-scrolling
background will go, over which I will place the content for the page.
As the user navigates the site, the buttons on the left will change to
reflect the options available at that point on the web, and of course
the content in the main page area will change as they navigate as
well. When users first enter the site, they will be asked to provide
logon information that will be used throughout the sesion to provide
customized content (ie information relavent to their customer profile,
pending loan application, etc.)

I generally use CSS Positioning to control the layout, and asp:Table
controls to control active content. If the menu is static and you want it on
every page, try putting the code for the menu in a Web Control (.ascx file).

But what about the visual aspect of this? Should I use a FRAMESET on
my site, putting the .aspx pages in the appropriate frames at the
appropriate time? Or, Should I visually build the TABLE structure on
the default.aspx page and then write code behind it to put the right
things in the right parts of the table at the right times? (ie the
proper buttons in the left table section, and the proper content /
form controls in the right-hand section) - This concept is employing a
full-screen table to break up the browser window into the logical
components I want. I don't know if this methodology is outdated,
which is why I'm asking all of this. ("once HTML, always HTML" LOL)

On one hand, the latter seems to be in the spirit of .NET - One page,
from the user's perspective, that dynamically serves up all the
content for the entire session... Or should I be attacking this in a
different way? How, for example would I include a web form inside of
a static HTML element, like the TABLE, to yield the nicely formatted
results I'm looking for, or what .NET approach should I be using
instead?

A matter of preference on most of this stuff. Depends on how you want things
to work. I generally group Web Forms by function. For example, displaying
data from the database goes on Data.aspx; editing information on Edit.aspx,
and so forth. I use a Web Control to display the page's header and
navigation structure, and handle all navigation code in the Web Control's
code-behind page.
I know that the old .asp approach to things was to have the global.asa
file contain the data objects (like the session information) for the
site, and then .asp files within the site could refer to that global
information to pass data such as your logon / account information from
one page to another as you traverse the site. I don't really know
what mechanisms should be used for doing this in .NET and, what makes
it worse is that I'm under a real time crunch on this particular
project. Thank God I'm a quick study. :) .NET does not seem to
employ traditional .asp pages. I mean, while it seems to parse them
fine, there is no template for creating a new .asp page, only a
webform (aspx), unless that is the approach to be used for presenting
all content? Hmm... These are the things I really need answered. :)
I could probably get myself through this, hard and hand coding around
the files to force it to do what I want, but I'd rather do this the
"right" way from the get-go, so that growing and maintaining the site
will not be come and ever-increasing chore.

The global file is still there (called Global.asax), and you can put several
methods in there that are available to all pages and classes in the project
web. There is also a Web.config file that handles basic configuration for
the application. It's an XML file that you can add several things to,
including database connection strings. You can also create stand-alone
classes that your pages can inheirit from.

..NET doesn't employ traditional .asp pages. You can include your code in the
same file as the page, but the preferred method is to use code-behind files
to separate the code from the presentation. If you're doing all this from
the command line, however, you can't use code-behind files. They're only
available in Visual Studio.NET.

Personally, I don't like the Web Form designer in Visual Studio.NET 2003. I
much prefer coding it by hand. However, references to any Web Controls have
to be added to the code-behind page manually. It is still the easiest way
I've found to work with the pages though. I still make the page template in
FrontPage and copy the HTML over. It's easier for me to lay out the page
visually and add the active content later than it is to code the entire
thing by hand. =)
I want to thank anyone who's had the patience to read through all of
this for your time. An example of a project would be a GREAT
resource, but if you can at least give me concise enough information
to get me pointed in the right direction, I can figure out the rest I
am sure. Thank you VERY much! :)

You're welcome. Hope this helps you get started. =)

Flynn
 
I recommend you to study dotnetnuke on www.dotnetnuke.com

download and study it. it has got working full fledge portal with admin
systems...

u can make few of yours from it..
 
Thanks... Actually, I did do as you suggested, but the example I
downloaded wouldnt' install. It kept telling me that I need .NET
framework, IIS, and SQL Server installed, and I have all three. Since
it wouldn't be more specific about what it's problem was, I was just
dead in the water.
 
THIS IS WHAT YOU CAN EXPECT IF YOU IMPLEMENT a n-TIER OOP architecture

-------------------------------


DOTNET JUNKIES REDESIGN....

What happened to the OOP n-Tier stuff? Huhhhhhh??????

Where is that 2-SECOND CHANGE?

WOW...TOTAL REBUILD OF THE ENTIRE ENGINE!!!!

HOW COME THEY COULDN'T GET IT RIGHT IN THE FIRST PLACE?

WHAT HAPPENED TO THE DESIGN PHASE??????

BUT OOP and n-TIER IS SUPPOSED TO FLEXIBLE AND EXTENSIBLE TO ALL VAST DESIGN
CHANGES ISN'T IT?
BUT GUESS WHAT? IT DIDN"T HAPPEN.

I WONDER what it really is like in the CORPORATE WORLD


You OOP n-TIER fanactics have to face up to the fact the the OOP model can't
work in the business world? Where are all those design patterns?

If these guys can't do it, why should you MVP's who don't even have a web
site be able to do it?

BUILDING A PRODUCTION WEB SITE IS A LOT HARDER THEN JUST ANSWERING QUESTIONS
ON THE NEWSGROUPS or TEACHING A .NET CLASS OR EVEN GIVING OUT A PDC SEMINAR



EVEN THE .NET PORTAL and DOTNETNUKE have LOTS AND LOTS of trouble
implementing changes...


THIS IS THEIR MESSAGE...
------------------------------------------------
We're Sorry
As many of you know we have recently launched SqlJunkies.com. We have
overhauled our runtime and will be using it on DotNetJunkies.com also. With
the new runtime and build we implemented a central users database so you
don't have to sign up on multiple sites. The downfall is that we had to put
a hold on the database currently running DotNetJunkies. What that means to
you is that we can't add new articles, news, events, or even members.
Although, new members can sign up on SqlJunkies Here and when we launch the
new build of DotNetJunkies you will automatically be a member.
Rest assured we have a ton of articles and how to's on hold so when we
launch you'll see a ton of new stuff.

Again we're sorry for any hassle we may be causing and the new build will be
up shortly.
 
Back
Top