473,388 Members | 1,326 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,388 software developers and data experts.

techniques needed --> moving from asp to asp.net

Hello all,

I've been developing web apps using Borland's websnap technology which is
built upon asp technology.
I'm tranisitioning to ASP.NET VS.NET and need some techniques/best practices
to assist in the transition.

I've created my apps/sites using a chunking method based on a template.
Chunks of HTML and JScript are stored together in separate files, and groups
of pages share a common template file. Most of the pages have their layout
based on HTML tables (its just easier).

I understand that the ASP.NET pages are based on a class (code behind), but
how does one achieve consistency across a group of pages with respect to
their HTML layout? Is a common template approach still a productive
technique or will it be more of a headache in the long run? Should I be
thinking in terms of generalizing groups of pages based on a base class, and
then create child classes to address per-page specific needs?

What are the criteria being used to separate what will go into a code behind
class and what will be controlled by CSS?

Last question (for now), Borland's tools allow one to quickly consume and
transform an XML document to HTML, based on XSLT (and optionally CSS,
JScript, Javascript). I'm curious to know if a lot of folks are using this
method in ASP.NET. If so, what is the performance like, and how many
hurdles does one have to jump through with this technique?

I've been doing some reading and experimenting in my head, but I'm quickly
compiling a large group of questions. Also, I'm writing my apps in C# with
..NET v1.1.
Nov 18 '05 #1
3 1399
Hello,

jqpdev wrote:
I've created my apps/sites using a chunking method based on a template.
Chunks of HTML and JScript are stored together in separate files
Those "chunks of ..." sound a lot like user controls. User controls are
you're friend for making user interface components. The ascx file contains
the html and webcontrols and the ascx.cs ( for C# ) or the ascx.vb ( for
VB.NET ) codebehind contains the event handlers. They define what happens
when the user control is initialized or when a user f.i. clicks a button.
I understand that the ASP.NET pages are based on a class (code behind)
The code behind contains server side event handlers. The layout is mostly in
the page main file ( .aspx ) or user control main file ( .ascx ). When
an .aspx or .ascx is requested, the ASP.NET framework will auto-generate a
class from the .aspx or .ascx file, which derives from the class in the
code behind. This auto-generated class contains the code that's necessary
to build the control tree according to the tags in the .aspx or .ascx.

Because the auto-generated class is not present when you compile your
project, you can not derive from it. As a result, derivation is not the way
to get consistency in layout across a group of pages.
but how does one achieve consistency across a group of pages with respect
to their HTML layout? Is a common template approach still a productive
technique or will it be more of a headache in the long run?
To get consistent look and feel, I used placeholders. In the main page I
define all common layout and a placeholder. In the placeholder I
dynamically load a user control, it depends on the query string which one I
will load. If you want a deeper hierarchy of pages that are alike in look
and feel, you can put everything that's common only for certain pages in a
user control and put a placeholder in that user control.
The URL may become something like :

http://somehost/index.aspx?module=ne...nis&article=28

- index.aspx would contain layout common to all pages
- news.ascx would be loaded into the placeholder in index.aspx
and would contain all layout common to news items
- sports.ascx would be loaded into the placeholder in news.ascx
and would contain all layout common to sports news items.
- tennis.ascx would be loaded into the placeholder in sports.ascx
and would contain all layout common to tennis news items.

Of course you have to write the code to dynamically load a control
based on the querystring yourself, but that's easy.
Look at LoadControl.
What are the criteria being used to separate what will go into a code
behind class and what will be controlled by CSS?
The main aspx or ascx file should contain the layout.
The code behind should contain as little layout and style as possible.
The CSS should contain the style, e.g. colors, fonts, etc.
Last question (for now), Borland's tools allow one to quickly consume and
transform an XML document to HTML, based on XSLT (and optionally CSS,
JScript, Javascript). I'm curious to know if a lot of folks are using


I'm not using XSL. I don't like it for this purpose. It's a transformation
language, not a template language. I doubt if you can wysiwyg edit them
very well.

Best regards,

Eric
Nov 18 '05 #2
Thanks Eric.

Do you have a URL to a good article or tutorial on this?

"Eric Veltman" <eric@[RemoveThis]veltman.nu> wrote in message
news:vt************@corp.supernews.com...
Hello,

jqpdev wrote:
I've created my apps/sites using a chunking method based on a template.
Chunks of HTML and JScript are stored together in separate files
Those "chunks of ..." sound a lot like user controls. User controls are
you're friend for making user interface components. The ascx file contains
the html and webcontrols and the ascx.cs ( for C# ) or the ascx.vb ( for
VB.NET ) codebehind contains the event handlers. They define what happens
when the user control is initialized or when a user f.i. clicks a button.
I understand that the ASP.NET pages are based on a class (code behind)


The code behind contains server side event handlers. The layout is mostly

in the page main file ( .aspx ) or user control main file ( .ascx ). When
an .aspx or .ascx is requested, the ASP.NET framework will auto-generate a
class from the .aspx or .ascx file, which derives from the class in the
code behind. This auto-generated class contains the code that's necessary
to build the control tree according to the tags in the .aspx or .ascx.

Because the auto-generated class is not present when you compile your
project, you can not derive from it. As a result, derivation is not the way to get consistency in layout across a group of pages.
but how does one achieve consistency across a group of pages with respect to their HTML layout? Is a common template approach still a productive
technique or will it be more of a headache in the long run?
To get consistent look and feel, I used placeholders. In the main page I
define all common layout and a placeholder. In the placeholder I
dynamically load a user control, it depends on the query string which one

I will load. If you want a deeper hierarchy of pages that are alike in look
and feel, you can put everything that's common only for certain pages in a
user control and put a placeholder in that user control.
The URL may become something like :

http://somehost/index.aspx?module=ne...nis&article=28

- index.aspx would contain layout common to all pages
- news.ascx would be loaded into the placeholder in index.aspx
and would contain all layout common to news items
- sports.ascx would be loaded into the placeholder in news.ascx
and would contain all layout common to sports news items.
- tennis.ascx would be loaded into the placeholder in sports.ascx
and would contain all layout common to tennis news items.

Of course you have to write the code to dynamically load a control
based on the querystring yourself, but that's easy.
Look at LoadControl.
What are the criteria being used to separate what will go into a code
behind class and what will be controlled by CSS?


The main aspx or ascx file should contain the layout.
The code behind should contain as little layout and style as possible.
The CSS should contain the style, e.g. colors, fonts, etc.
Last question (for now), Borland's tools allow one to quickly consume and transform an XML document to HTML, based on XSLT (and optionally CSS,
JScript, Javascript). I'm curious to know if a lot of folks are using


I'm not using XSL. I don't like it for this purpose. It's a transformation
language, not a template language. I doubt if you can wysiwyg edit them
very well.

Best regards,

Eric

Nov 18 '05 #3
Hello,

jqpdev wrote:
Do you have a URL to a good article or tutorial on this?


I just read some stuff about a new feature in the next
ASP.NET release, codenamed "Whidbey". The feature is
called "Master Pages" and is another solution to achieve
consistency in the UI. The next URL talks about it :

http://www.asp.net/whidbey

Funny enough, when searching for information about it
on google, I came across articles that were talking
about using "Master Pages" with the released versions
of ASP.NET. Seems like Microsoft ASP.NET team developed
a solution for these versions, that works much like
what will be available in Whidbey. Therefore, perhaps
master pages are a better choice than what I first recommended.

http://authors.aspalliance.com/PaulW...rticles/?id=13

If you do want to use the same techniques I used,
I have some links that may help.

User controls :
Tutorials on www.asp.net

Dynamically loading user controls :
http://tinyurl.com/wrco

Page templates :
http://www.smartisans.com/articles/vb_templates.aspx

Best regards,

Eric
Nov 18 '05 #4

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

Similar topics

61
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will...
15
by: christopher diggins | last post by:
I have written an article on how to do Aspect Oriented Programming in vanilla C++ (i.e. without language extensions or other tools such as AspectC++). The article is available at...
822
by: Turamnvia Suouriviaskimatta | last post by:
I 'm following various posting in "comp.lang.ada, comp.lang.c++ , comp.realtime, comp.software-eng" groups regarding selection of a programming language of C, C++ or Ada for safety critical...
0
by: Frustrated LDAP administrator | last post by:
I am trying this lesson involving DBs. "ms-help://MS.VSExpressCC.v80/MS.NETFramework.v20.en/dv_vbcnexpress/html/caf3ecbd-87f5-4748-b990-7395409a19c7.htm" I can successfully create the DB,...
17
by: roN | last post by:
Hi, I'm creating a Website with divs and i do have some troubles, to make it looking the same way in Firefox and IE (tested with IE7). I checked it with the e3c validator and it says: " This...
0
by: linkswanted | last post by:
We are your trusted source. World Moving & Storage is bonded and licensed by the U.S. Department of Transportation and is one of the largest residential moving and corporate relocation company in...
0
by: linkswanted | last post by:
We are your trusted source. World Moving & Storage is bonded and licensed by the U.S. Department of Transportation and is one of the largest residential moving and corporate relocation company in...
23
by: Stanimir Stamenkov | last post by:
I want to find out whether the following usage of the "Bookmark" link type is o.k. An example could be seen at <http://www.geocities.com/stanio/more/horoskop.html>. The text is in Bulgarian and...
3
JodiPhillips
by: JodiPhillips | last post by:
Hello everyone, there are many questions and answers relating to moving items between two listboxes here and on the net in general, however, none answer my specific problem. I have two listboxes...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.