asp tutorials, asp.net tutorials, sample code, and Microsoft news from 15Seconds
Data Access  |   Troubleshooting  |   Security  |   Performance  |   ADSI  |   Upload  |   Email  |   Control Building  |   Component Building  |   Forms  |   XML  |   Web Services  |   ASP.NET  |   .NET Features  |   .NET 2.0  |   App Development  |   App Architecture  |   IIS  |   Wireless
 
Pioneering Active Server
 Power Search








Active News
15 Seconds Weekly Newsletter
• Complete Coverage
• Site Updates
• Upcoming Features

More Free Newsletters
Reference
News
Articles
Archive
Writers
Code Samples
Components
Tools
FAQ
Feedback
Books
Links
DL Archives
Community
Messageboard
List Servers
Mailing List
WebHosts
Consultants
Tech Jobs
15 Seconds
Home
Site Map
Press
Legal
Privacy Policy
internet.commerce














internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

HardwareCentral
Compare products, prices, and stores at Hardware Central!

Possible Ways to Write Error Messages
By 15 Seconds Discussion List
Rating: 1.8 out of 5
Rate this article


  • email this article to a colleague
  • suggest an article

    Jamal Aljahmi Asks a Seemingly Simple Question:

    I'm doing some error handling to check for ado sql error. Once the error is found I would like to redirect to the calling form but write a message at the top or bottom of the calling form. Any suggestions on how to do that.

    Chaz Punches Out This Code:

    Well, take this psuedo code for example:

    
    TestScript.asp
    
    Dim variables
    
    set variables = to form input
    
    if there are form input errors then
    errFlag = true
    errMsg = "there were form input errors"
    
    if this is a form submission then (ie: if request("btnSubmit") <>
    "" then)
    update the database
    
    if there were datbase update errors then
    errFlag = true
    errMsg = "there were database errors"
    
    query the database to get the latest data
    
    if errFlag then
    display errMsg
    
    display queried data
    
    

    The Plot Thickens. Says Jamal:

    Oh, your doing the error message on the same page. I wanted to write the error message back to the redirected page.

    Puzzled, Chaz Adds:

    Well, if you must have it on the redirected page then you can pass the message in the URL. Or you could come up with a complicated scheme where you have standard error messages in a database and then all you have to pass on the URL are ID numbers for the appropriate message. Seems pretty complicated when you can just put all the processing on one page with everything you need.

    Rob Chartier Then Posits:

    You could have a table, with custom error messages and IDs (hard-coded errors) and when you redirect back and need to show the errors, you only need to pass the custom message id, query the DB to get the error message, and then show it.

    You could even go so far as having a table with just ids and error message (dynamic errors).

    Your error handler will log to that error table, and when it redirects back, it passes those NEW ids over, pick them up and show them. This would be kinda recommended because then you will have a good log ofall of the errors. You can analyse and check to see what are common errors and re-evaluate your usability for the site like say, the "signup.asp" page has a ton of problems with the "first name" field never being filled in. When upon discovery you can reformat the signup.asp page to show the first name field more prominently etc..

    This conversation string was taken from the 15Seconds ASP Listserv on 1/24/01. If you have an ASP-related question or would like to share some of your knowledge with others, you may join the list by clicking here.

  • Rate This Article
    Not HelpfulMost Helpful
    1 2 3 4 5
    Mailing List
    Want to receive email when the next article is published? Just Click Here to sign up.

    Support the Active Server Industry



    JupiterOnlineMedia

    internet.comearthweb.comDevx.commediabistro.comGraphics.com

    Search:

    Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

    Jupitermedia Corporate Info


    Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

    Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

    Solutions
    Whitepapers and eBooks
    Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
    Avaya Article: How to Feed Data into the Avaya Event Processor
    Microsoft Article: Install What You Need with Win Server ‘08
    HP eBook: Putting the Green into IT
    Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
    Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
    Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
    Avaya Article: Setting Up a SIP A/S Development Environment
    IBM Article: How Cool Is Your Data Center?
    Microsoft Article: Managing Virtual Machines with Microsoft System Center
    HP eBook: Storage Networking , Part 1
    Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
    MORE WHITEPAPERS, EBOOKS, AND ARTICLES
    Webcasts
    Intel Video: Are Multi-core Processors Here to Stay?
    On-Demand Webcast: Five Virtualization Trends to Watch
    HP Video: Page Cost Calculator
    Intel Video: APIs for Parallel Programming
    HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
    Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
    MORE WEBCASTS, PODCASTS, AND VIDEOS
    Downloads and eKits
    Sun Download: Solaris 8 Migration Assistant
    Sybase Download: SQL Anywhere Developer Edition
    Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
    Red Gate Download: SQL Compare Pro 6
    Iron Speed Designer Application Generator
    MORE DOWNLOADS, EKITS, AND FREE TRIALS
    Tutorials and Demos
    How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
    eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
    IBM Article: Collaborating in the High-Performance Workplace
    HP Demo: StorageWorks EVA4400
    Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
    Microsoft How-to Article: Get Going with Silverlight and Windows Live
    MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES