An investment in knowledge
pays the best interest.
-Benjamin Franklin
 
Home   News   Tips   Glossary   Templates   Forums   Help   Logon   Order   Contact Us  
 

Forums     

Active Server Pages Forum
By Richard Rost   Richard Rost on Facebook Richard Rost on Twitter Richard Rost on Google Plus Richard Rost on LinkedIn Email Richard Rost

 
This forum is for the discussion of developing dynamic web sites in ASP (Active Server Pages).

Click Here To Subscribe to this forum and receive an email update whenever new posts are added, just scroll down to the bottom of this page and enter your email address in the comment form.

Permanent Link
Keywords: asp forum active server pages
Post New Topic

Read Active Server Pages Forum by KELVIN W @ 6/18/2019
I wrote my first ASP page in NOTEPAD and saved it as Default.asp but it would not open in Internet Explorer. It did open with Firefox but it didn't show the current time. I guess Firefox doesn't support ASP. Any suggestions?
Show Just This Thread        Post Reply
Read Frontpage by William B @ 7/5/2014
I was looking for FrontPage or a replacement. It looks like MS no longer offers it. What is a good, inexpensive alternative? I don't use it that much.


Reply from Richard Rost:

Microsoft changed FrontPage to Expression Web. Best of all, it's now FREE.
Show Just This Thread        Post Reply
Read No errors shown web config by MUBEEZI M @ 12/26/2013
Dear Richard,

Ever since i upgraded from Access to SQL server as the web db, i do not see errors any more. When i used Access, an error would always pop up if my ASP code had problems. How can i see these errors once again? Is there another setting that i may need to turn on?
Thank you
MICAH


Reply from Richard Rost:

You're not seeing the detailed ASP error messages, just a friendly "we've encountered a problem" email? You need to create a web.config file in the root of your web and set the httpErrors errorMode setting to "Detailed." Like this:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

<system.webServer>
<httpErrors errorMode="Detailed" />
<asp
scriptErrorSentToBrowser="true"/>
</system.webServer>
<system.web>

<customErrors mode="Off"/>
<compilation debug="true"/>
</system.web>

</configuration>



Don't leave that file in the root of your web when your site goes public, however. Seeing error messages that may pop up and fragments of your code may give hackers and opportunity to exploit your site. Just put it in place when you need it, and then delete (or rename) it when you're done.
Show Just This Thread        Post Reply
Read convert website into application by MUBEEZI M @ 11/16/2013
Dear Richard,
I have built my database driven website and it is running OK.
However, one my customers has requested it to converted into an app that can be installed on the phone.
Can you please point me to the right direction please?
Thank you!
MICAH


Reply from Richard Rost:

That is not an easy task. I generally recommend a lightweight ASP page that they can browse with their phones. Constructing an actual "app" is a lot of work. I'll be making some tutorials on how to do this, but probably not until well into next year.
Show Just This Thread        Post Reply
Read convert long integer to a date in ASP by MUBEEZI M @ 9/27/2013
strange. i just tried now and it works! i wonder where i went wrong. in the end i used a long method (the DateAdd function)
otherwise, thank you!
MICAH


Reply from Richard Rost:

No problem.
Show Just This Thread        Post Reply
Read Response Redirect New Window by MUBEEZI M @ 9/25/2013
Dear Richard,
Once certain verification criteria are met, i redirect a user to another page to download a file. it possible to use response.redirect to open this page in a new window?
Once a user is downloading a file, I want them to be free to navigate to another page.
Best regards,
MICAH


Reply from Richard Rost:

No. ASP is a server-side language. It has no control over the browser window. For that, you'd need to use Javascript or VB Script. You COULD just give them a link with a TARGET="_BLANK" parameter in the A tag that when they click on it gives them a popup (or at least a new tab).
Show Just This Thread        Post Reply
Read convert long integer to a date in ASP by MUBEEZI M @ 9/23/2013
Dear Richard,

I will need your guidance again. In Access, i can convert a long integer into a date. For instance;
MyDate = CDATE(41540) would give 22/09/2013
When i used a similar approach in ASP, it generated an error. How can i convert a long integer to a date using ASP?
Thank you!

MICAH




Reply from Richard Rost:

It worked fine for me.

response.write CDATE(41540)

gave me: 9/23/2013


Show Just This Thread        Post Reply
Read two or more databases on a website by MUBEEZI M @ 9/14/2013
Wow! Thank you Richard.
some how, my instinct showed me it would be possible.
But then, (i guess i should try this myself), would the session variables remain the same? For example, since the website is a constant, would a set variable like Session("UserName") work across all the different dbs connected to the website while the user is navigating around the site?
Please let me know
MICAH


Reply from Richard Rost:

Yep. Session variables are per web site application.
Show Just This Thread        Post Reply
Read two or more databases on a website by MUBEEZI M @ 9/9/2013
Dear Richard,

from what i have learnt in ASP, its possible to connect (read/write) to different databases using the same website. For instance, i can have passwords in a text file, the data in say an access database and other info in another database.
Is there any known reasons why i cant design my site in such a way?

MICAH


Reply from Richard Rost:

You can have as many databases as you want for your web site. 599cd.com uses at least 4 different ones (one for the search index, another for the user logon cache, another for the product list, etc.)

Show Just This Thread        Post Reply
Read current page previous page by MUBEEZI M @ 9/1/2013
Thank you Richard!
Show Just This Thread        Post Reply
Read current page previous page by MUBEEZI M @ 8/31/2013
Dear Richard,

Please dont get tired of me.
I would like to utilise two server variables but i dont seem to figure out how to get them. I used the requestservervariables("all-http") but still i cant find these two variables.
1. The current page the user is on including the query string
2. The page that the user visited before  the current page.
I will appreciate your guidance

MICAH


Reply from Richard Rost:

If memory serves:

1. URL and/or SCRIPT_NAME
2. HTTP_REFERER
Show Just This Thread        Post Reply
Read Session Variable Timeout by MUBEEZI M @ 8/29/2013
Dear Richard,

Web browsers seem to have a reliable inbuilt mechanism such that after 20min of browser inactivity, the session variable becomes blank. How can i catch that moment before the user's session variable becomes blank? I would like to trigger an event to fire either becomes blank or just after its blank.
Thank you!
MICAH


Reply from Richard Rost:

Session variables are actually stored on the SERVER, not in the browser. If the server doesn't see activity from you in 20 minutes it clears your variables to save memory. If this is YOUR site, you can prevent that from happening with an inline frame that automatically refreshes every 5, 10, or 15 minutes to keep the user's session alive on the server. I do this on my site. If you look closely at the bottom of my site, there's an inline frame where the copyright notice is. That keeps people from getting logged out of the Online Theater when they're watching classes (watch a 15 minute lesson, go get coffee, and you get logged out because the server hasn't seen you in over 20 minutes - the video itself is playing from your browser cache after it downloads). Note that you can increase this timeout in your ASP code with the Session.Timeout property, but if you have a lot of concurrent users, this can cause your server to run out of memory.
Show Just This Thread        Post Reply
Read Strange date returned by MUBEEZI M @ 7/29/2013
Thank you Richard for your guidance.
MICAH
Show Just This Thread        Post Reply
Read Strange date returned by MUBEEZI M @ 7/28/2013
Dear Richard,

i have formular in my ASP code as follows
TimeNow = DateAdd("h", 10, Time)

Most of the time, it gives me correct results. But sometimes, it gives me 31/12/1899 07:37:33
How do i make sure, i get only 07:37:33 and not the portion of the date?
Thank you!

MICAH



Reply from Richard Rost:

That's interesting. I've never run into that before. Looks like you're ending up with a NEGATIVE date value somehow - because date values are actually the number of seconds since Jan 1st, 1900. NORMALLY, with a valid date, you could strip off the date portion by saying:

CurrentTimeOnly = Now()-Date()

That would give you just the hours, minutes, and seconds. However, since you're getting dates before 1/1/1900, you'll have to get creative and break it up into HOUR(), MINUTE(), SECOND() and then use the TIMESERIAL() function to put them back together into a valid TIME datatype.

Strange indeed.

Show Just This Thread        Post Reply
Read Result from table is case sensitive by Mubeezi Micah @ 7/13/2013
Dear Richard,

I just went through a situation which i thought might be worthwhile to share. i have a list of censored words in a table which a user must never include in an SMS message to a customer. So when an SMS is written in a textbox [actually a text area] on a web page, i loop through all the words in the table and check if any of them is part of the SMS using a recordset and the Instr function.
What i realised is that the result returned is case sensitive. For instance a censored word of Party in the table is not equal to PARTY. it took me hours to figure out why my code was not working as expected.
in Access VBA, we get away without being bothered by case sensitive characters. With ASP, NOPE.

MICAH


Reply from Richard Rost:

That is correct. ASP is very highly case sensitive. Thanks for sharing.
Show Just This Thread        Post Reply
Read response redirect vs Back Button by MUBEEZI M @ 7/9/2013
Thank you Richard. You have saved me hours of thinking.
MICAH


Reply from Richard Rost:

Sometimes those hours of thinking build your brain up... like hours in the gym build your muscles up!
Show Just This Thread        Post Reply
Read response redirect vs Back Button by MUBEEZI M @ 7/9/2013
Dear Richard,

I am doing server side validation of the data entered by the user. My intention is that if a field X is blank, they are redirected to the previous page. However, when i do so, any data entered by the user in other form controls is lost.
Is there a way i can send the user back to the previous page without losing data?
Yes i can do this with Javascript. But i have to do the same stuff on the server side too.

thank you for your continued guidance.

MICAH


Reply from Richard Rost:

This is a tough one. What I do is read all of their responses into session variables, and then use those session variables as the default values for the fields on the previous form. So when they submit first name, it goes into Session("FirstName") then use that as the default value for the first name field on the previous form. If you redirect them back there, the data will show up.
Show Just This Thread        Post Reply
Read Automatic Refresh of a Page by MUBEEZI M @ 4/30/2013
Thank you Richard.
Show Just This Thread        Post Reply
Read Automatic Refresh of a Page by Mubeezi Micah @ 4/30/2013
Dear Richard,

I noticed that when i am on your site, it refreshes itself automatically after every couple of minutes. my impression is that you are trying to make a session variable last longer. Or i am i wrong?
my question is: how do i refresh a page without interrupting the user? I need to keep the user's session active as long as the browser is open but i would not wish to set a constant value like 20min

best!
MICAH



Reply from Richard Rost:

Yes, you are correct. There is a very small inline frame at the bottom of my site that refreshes once a minute. I do this so people don't get timed out. That was the number one complaint I used to get: people would log on, watch lesson 1, 2, 3, and then go get coffee or lunch and come back 30 minutes later only to be logged out. So the refresh frame reloading every minute will keep you logged on as long as your browser window is open.

It's literally just an HTML IFRAME with a little bit of Javascript to reload the frame. If you right-click on my copyright notice at the bottom and select VIEW FRAME SOURCE you should see the HTML for it. It's not hard.
Show Just This Thread        Post Reply

Show Older Posts         Collapse All Topics

 

Post Your Comments or Subscribe
    If you would like to be notified of new posts on this forum,
    just enter your email address below. It will be kept private.
 
If you just want to subscribe to get email updates when this forum is updated, then enter your name and email address and check the Notify Me box below. If you would optionally like to add your comments below to be posted, they are welcome.
 
  Your Name:  Required
  Your Email:  NOT Public
  Subject:
  Comments:

 

Sorry about this step. It's just to keep the spam bots away:
  Verify: What is 5+6:
  
  Notify me when the this forum is updated
  Remember Me for my next comments
  
 
 
Please do not use this form for Customer Service inquiries! If you have questions about your account, shipping info, courses you've ordered, need passwords, etc. please use the Customer Service Center instead.

I value your comments. They will be displayed on this page (above). Your name will be displayed, but your email address will not be.
As always, I promise to never give away your personal information to anyone else, ever.

NOTE: If you don't leave your name and email address, DON'T expect a reply. I can't promise a personal reply to everyone who posts here. I TRY my best, but I cannot guarantee it. If you don't leave your real name and email address, I won't even bother. I usually just hit DELETE. -Richard

 

 
 

Learn
 
Accessindex
Excelindex
Wordindex
Windowsindex
PowerPointindex
Photoshopindex
Visual Basicindex
ASPindex
Seminars
More...
Customers
 
Account Login
Online Theater
Downloads
Lost Password
Free Upgrades
Insider Circle
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Articles
Search Our Site
Waiting List
Production Schedule
Collapse Menus
Help
 
Live Chat
Customer Support
WalkThru Tutorials
Troubleshooting
FAQs
TechHelp
Consulting Services
About Us
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Order
 
Video Tutorials
Handbooks
MYOLP Memberships
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Gift CDs
Contact
 
Live Chat
General Info
Support Policy
Contact Form
Email Us
Mailing Address
Phone Number
Fax Number
Course Survey
Facebook    Twitter

Google Plus    LinkedIn

Blog RSS Feed    YouTube Channel
Richard Rost Microsoft MVP