Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 18th, 2003, 10:59 PM
Authorized User
 
Join Date: Jun 2003
Location: St. Louis, Mo., USA.
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default Redirect page

I am building a redirect page, the lead page give the user a list box of page topics once the user selects the page (which are coming from a database) the redirect should load the page and display it. How ever it is not working. Here is the script I am using, any help would be nice. Request.Form("Stats") will be an int of the HTML page

<%
    Dim intPageForm, FormPage
    intPageForm = Int(Request.Form("Stats"))
    IF intPageForm > 1 then 'Form page selected
        FormPage = "Stats.asp?Form="
        Response.Redirect FormPage + intPageForm Else 'Html page selected
        Response.Redirect Request.Form("Stats")
    End If
%>
Reply With Quote
  #2 (permalink)  
Old June 19th, 2003, 05:20 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Wien, Wien, Austria.
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

Quote:
quote:Response.Redirect FormPage + intPageForm Else 'Html page selected
In ASP for string concatenation use "&" instead of "+". So,
Response.Redirect FormPage & intPageForm,
and you don't need Else part of If statement - if user hasn't choosen any page you can't redirect him to some page, so nothing's should happen.

...but the Soon is eclipsed by the Moon
Reply With Quote
  #3 (permalink)  
Old June 19th, 2003, 09:29 AM
Authorized User
 
Join Date: Jun 2003
Location: St. Louis, Mo., USA.
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the reminder on the concation, however I am getting the following errors. This happens when I select a static page option:

Microsoft VBScript runtime error '800a000d'

Type mismatch: '[string: "History.htm"]'

/Spartains/Npage.asp, line 5
Reply With Quote
  #4 (permalink)  
Old June 19th, 2003, 09:54 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Wien, Wien, Austria.
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

Request.Form("Stats") is the string (one of your option is History.htm as we can see), and you cannot cast it into Int type.
You have to modified your <select> form field in the following manner:
Code:
<select name="Stats">
    <option value=2>History.htm</option>
    <option value=3>SecondPageName.htm</option>
    ...
</select>
...but the Soon is eclipsed by the Moon
Reply With Quote
  #5 (permalink)  
Old June 20th, 2003, 07:51 PM
Authorized User
 
Join Date: Jun 2003
Location: St. Louis, Mo., USA.
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks I changed to the isnumberic function as a switch (I did not know ASP supported this until I looked up the function in the book)
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Page redirect help jroxit Classic ASP Basics 7 August 11th, 2008 11:01 AM
redirect to page other than default page sarah lee ASP.NET 1.0 and 1.1 Basics 3 December 15th, 2006 05:45 PM
Redirect to new page without closing current page peter2004 ASP.NET 2.0 Basics 5 June 5th, 2006 08:49 PM
Redirect to next page qazi_nomi Javascript How-To 1 September 1st, 2004 02:07 AM



All times are GMT -4. The time now is 12:26 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.