Home | Advertising Info19 USERS CURRENTLY ONLINE   
PowerASP
   Site Search Contact Us Wednesday, May 01, 2024  

  Active InfoActive Info  Display List of Info MembersMemberlist  Search The InfoSearch  HelpHelp
  RegisterRegister  LoginLogin
Classic ASP - General
 PowerASP Code Help Area : Classic ASP - General
Subject Info: Using Common Sense With ASP A d d  -  P o s tAdd P o s t
Author
Message << Prev Info | Next Info >>
cwilliams
Admin Group
Admin Group
Avatar

Joined: April/26/2004
Location: United States
Online Status: Offline
Info: 137
Added: April/27/2004 at 8:06pm | IP Logged Quote cwilliams

Using Common Sense With ASP

This article contains some hints & tips as well as some things the average ASP user just doesn't do when using Active Server Pages.

Turn off "Show Friendly HTTP error messages"
If you are getting errors with your ASP application go to Internet Explorer and make sure this setting is unchecked. Having this checked can cause a generic error to be displayed in you web browser when ASP code encounters an error. This generic error message doesn't really help you fix the problem. Having this setting unchecked will usually result in a more detailed error message and the line number the error is occurring at, thus giving you a good clue as to where the problem is within the ASP code. If detailed ASP error messages have been disabled at the server level this setting will make no difference.

Editing ASP code with various editors.
Besides simple text editors most editors create and manage ASP code differently. Usually code written with one editor may not be  friendly in another. For example sometimes editors like Ultradev, FrontPage, Dreamweaver, etc mess up existing code or display errors when there are really no errors. They just don't understand the code and think it is bad. You need to understand this and if you are editing code that was not created with your editor of choice you should always back up the code before making changes. Then if you break the ASP when you save it with your editor you can revert back to a working copy. This sounds like common sense, but trust me some people just don't use their head. Additionally some editors allow you to edit code in text mode as well as a WYSWYG Interface and sometimes you may have to edit some code in text mode or with a colored coded text editor. A good example of this is if you buy a pre-built ASP application. There is no guarantee it will be friendly to your editor as the creator of this code may have used a different editor to create the application or even hand coded it. For the most part it will always be safe to open and save ASP code with a text editor. I recommend that whatever editor you use that you also have a good colored coded text editor as well. I also recommend when using Microsoft FrontPage that you enable the "Show All" button. It looks like a PIE symbol and will make all line breaks visible and also show areas of ASP code as little yellow icons. This way you don't delete areas of code you can't see. Be aware unless carefully designed to be FrontPage compatible FrontPage will usually mess up ASP code not written in FrontPage.


Knowing what pages to edit.
Ok .. this one really gets me. Here is an example. People will say I want to edit your
ASPProtect application so that some form fields don't show on the registration screen. Then they ask what page do I edit. Well again, simply use common sense. Browse until you get to the page you want to change in your web browser. When you get to that page simply look at the URL address window in the browser. If it says something like "http://www.mysite.com/aspprotect/users/register.asp" then the page you want to edit is most likely "register.asp" in the "aspprotect/users" folder. Also because we are dealing with a form it may post to another page. To see what page it posts to simple look at the action of the form as you may have to edit that page as well. A page may also have a server side include to another page where code may need to be edited as well. When you edit something always back it up before you start. This way if you mess it up you can revert back to the original code. BTW.. holding your mouse over a button or hyperlink and looking in the bottom left corner of your browser in the Status Bar is also a good way to tell what pages are doing what.


Connections And Server Database Permissions
Your ASP/Database code isn't going to run if everything isn't perfect.
I have already written an article on this and I suggest you read it if you have problems with setting up data connections.
Click here for that article.


Netscape and ASP Browsing Problems
This is not related to common sense but it is a helpful thing to be aware of.
I am not sure why though it may have to do with buffering and Netscape's rather slow rendering engine when it comes to complex tables and CSS, but sometimes when using Netscape to browse ASP code from the same computer that is serving the ASP pages it runs extremely slow. It sometimes even acts like it is going to time out. Once the code is browsed by Netscape from a remote computer it runs fine. This doesn't happen all the time but it has been known to happen so be aware of it.


Move along one step at a time.
So many people when coding ASP just don't understand this very simple concept. When building an ASP application add bits of code and test them before adding more code. It makes no sense to throw a ton of code functions into a page and then later on try to troubleshoot why it doesn't run. If you test each part as you go you will be a lot better off in the long run.


ASP Applications just stop working.
Well, if your ASP Application was working and suddenly stopped working then most likely something on the web server changed. Sometimes especially on hosted servers permissions on directories change and need to be set again. Sometimes they move your site to a new directory or server and things change. Sometimes components need to be re-installed. Sometimes the server needs some tender love & care and sometimes even a simple reboot can cure your problems. There are a lot of reasons things could stop working and it usually not the code unless some files have become corrupted.


For the most part do not design new code on a live server.
Unless you have no choice or you are very experienced you really shouldn't design new asp code on a live server. Invalid SQL statements and bad data loops can cause major strain on the web server and even cause memory leaks or make the server crash. You should always run and install ASP code locally on a development server and then upload it to the live server when it seems to be running correctly. Be aware some settings may be different on the local server and the live server so you may have to change some things when uploading to the live server.

Personal Web Server is a good ASP testing environment and runs on Win95/98. If running windows NT or 2000 you can install IIS and run ASP using that.


The web is one of your best sources when it comes to learning classic ASP.
This is my last tip and probably the most important. Unlike when I started using ASP many years ago the web is now full of great articles and examples. Though there are some good books available now just about anything you need to know is available on the web and is free. Downloading free applications is also a great way to learn how things work. Below are some of the best places to look.

www.aspin.com Great resource site full of article and applications.
www.4guysfromrolla.com Always a great source of new articles.
www.aspwire.com An ASP news site.



__________________


Chris Williams
http://www.PowerASP.com
Back to Top View cwilliams's Profile Search for other info by cwilliams
 
Bullschmidt
Newbie
Newbie
Avatar

Joined: July/06/2004
Location: United States
Online Status: Offline
Info: 12
Added: July/06/2004 at 12:47am | IP Logged Quote Bullschmidt

And here are a few more good ASP sites:
o ASP101 Samples - http://www.asp101.com/samples
o W3Schools ASP Tutorial - http://www.w3schools.com/asp
o Microsoft VBScript Language Reference - http://msdn.microsoft.com/scripting/default.htm?/scripting/V BScript/doc/vbscripttoc.htm

And the following newsgroup is good:
microsoft.public.inetserver.asp.general

Or for a "quick and dirty" generic ASP open source solution to putting databases on the Web that just requires setting up a configuration page for each table or query and uploading the database to the Web as long as there is an autonumber field in each table (and you'll probably also separately want to create login capabilities), perhaps try something like this:
GenericDB by Eli Robillard
http://www.genericdb.com and then click on the Tips link to see an example



__________________
J. Paul Schmidt, Freelance ASP Web Developer
www.Bullschmidt.com
Classic ASP Design Tips, ASP Web Database Sample (Freely Downloadable)
Back to Top View Bullschmidt's Profile Search for other info by Bullschmidt Visit Bullschmidt's Homepage
 
elija
Newbie
Newbie
Avatar

Joined: September/04/2004
Location: United Kingdom
Online Status: Offline
Info: 8
Added: September/04/2004 at 5:05am | IP Logged Quote elija

One of the best bits of common sense advice I have been given, relates to any programming project, not just ASP.

You'd (maybe) be suprised by just how many people ignore it...

"Always plan what you are going to do on paper before you even touch a keyboard - it can save headaches later on"




__________________
Programmer - a device for turning coffee into algorithms
Back to Top View elija's Profile Search for other info by elija Visit elija's Homepage
 
damo
Newbie
Newbie
Avatar

Joined: September/20/2004
Location: Australia
Online Status: Offline
Info: 1
Added: September/20/2004 at 3:33am | IP Logged Quote damo

http://www.devguru.com/Technologies/vbscript/quickref/functi ons.html
http://www.devguru.com/Technologies/ecmascript/quickref/java script_intro.html
http://www.devguru.com/Technologies/asp/quickref/asp_intro.h tml

i found this very usefull in the past as begginer as well as good quick referance

Just search the site. its good.

as well as:

http://www.tutorialized.com/tutorials/ASP/Cookies-and-Sessio ns/1

hope it of help. Lots of info.



Edited by damo on September/20/2004 at 3:37am
Back to Top View damo's Profile Search for other info by damo
 

If you wish to make a comment to this info you must first login
If you are not already registered you must first register

  A d d  -  P o s tAdd P o s t
Printable version Printable version

Info Jump
You cannot add new info in this area
You cannot add to info in this area
You cannot delete your info in this area
You cannot edit your info in this area
You cannot create polls in this area
You cannot vote in polls in this area

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2024 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

vbscript active server pages ASP vbscript SQL database informix oracle SQL Server Perl CGI Delphi PHP source code code sample samples program CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspprotect.com, www.cjwsoft.com,www.aspclassifieds.com,www.aspphotogallery.com