2-tier ASP application

This is a discussion on "2-tier ASP application" within the Classic ASP section. This forum, and the thread "2-tier ASP application are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jan 28th, 2004, 18:34
New Member
Join Date: Jan 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
2-tier ASP application

Hello everyone!

I'm working at a company that is creating a web module of its desktop application. Basically, the module will provide some basic reports and tasks of the application that the user can use over the Internet.

We are now wondering about the best approach to create a 2-tier ASP (not ASP.NET) application: 1 for the layout (visual elements, common to all pages) and 1 for the asp pages that deal with the interaction with the user (reports, forms, data selection and so on...). We have to use ASP because 30% of it is already done using ASP.

What we plan to do is to have only 1 ASP page with the layout and working as a task manager. Which means that this page will receive all the links from the application and will show the right content, using the right Server Side Include (SSI).

So, basically this one main asp file will have several SSI on it that will work based on the content of the variable of the asp file that I want to show. Something like this:
<html>
...
<body>
...
<% select case sPageToShow
Case "page1.asp"
%>

<% Case "page2.asp"
%>

... and so on
<% end select %>
</body></html>

Is that a good approach? I think this is good because I will have only one definition of the main layout of the application and the other files will only contain the code of what they are really supposed to do.

Are there better solutions? or a different approach that I could use and analyse here? As my application is only 30% done, should I consider migrate it to ASP.NET?

Thanks a lot in advance,
Ricardo

  #2 (permalink)  
Old Jan 28th, 2004, 19:19
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
I'm not sure I understand exactly, but conditional includes are *very* inefficient in ASP. I don't advise this method.
  #3 (permalink)  
Old Jan 28th, 2004, 19:31
New Member
Join Date: Jan 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Do u have any suggestions for that, then?
What exactly didn't u understand? I can explain more.

Thanks again
  #4 (permalink)  
Old Jan 28th, 2004, 19:42
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
The problem with the conditional SSI approach is that before the page is parsed by the ASP engine, all of the included scripts are built into the one page to be parsed - so you've got one BIG file being parsed just for some if then statements.

One other solution is to use the server.execute method. Which will include the results of just the file you need. Simple and better preformance. For example:
Code: Select all
<html>
...
<body>
...
<% server.execute("page" & n & ".asp") %>
</body></html>
Another option is to create a "template" with placeholders, which you then replace with the content code. For example:
Code: Select all
one file contains:

<html>
...
<body>
...
##Content##
</body></html>
Then your script reads in that file, and does a string replace of ##Content## with the contents of Page1.asp for example - and then it writes the results of the replacement out to the browser. This method allows you to build the template without having any ASP code in it, so it's easily manipulated by WYSIWYG editors and easy to preview what your end page will look like.
  #5 (permalink)  
Old Jan 28th, 2004, 19:52
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
I thought it was a more complex question than it actually was.
I'd go with the server.execute method suggested by Catalyst, (so long as your version of IIS supports it - I think its version 4 and above), as ASP is not particularly efficient working with strings and parsing text.
  #6 (permalink)  
Old Jan 29th, 2004, 08:59
Highly Reputable Member
Join Date: Jul 2003
Location: Ipswich, UK
Posts: 690
Thanks: 0
Thanked 0 Times in 0 Posts
if you have the option of migrating to .NET, then do it. If not, listen to catalyst
  #7 (permalink)  
Old Jan 29th, 2004, 09:43
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,951
Blog Entries: 7
Thanks: 7
Thanked 3 Times in 3 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Hi....

I have an extremely efficient way for you to be able to do this. What you are after is a way to skin a site
using a templating system which runs of a single file.... no problem.

I have a system that is skinnable, has the ability to plug-in ASP modules and will drive any website.

Please contact me via msn aspwiz@hotmail.com as it is not something I wish to divuldge to all and sundry.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
Closed Thread

Tags
2tier, asp, application

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Integrating Mpp with the .NET Application. akshitshah ASP.NET Forum 0 Sep 28th, 2007 05:23
3 tier navigation Struggling Web Page Design 1 Jan 4th, 2007 16:40
closing an application kal JavaScript Forum 4 Dec 13th, 2005 13:20


All times are GMT. The time now is 21:13.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43