navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Free FrontPage Templates

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

**Solved** Custom error page

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> **Solved** Custom error page
Page: [1]
 
lovduv

 

Posts: 152
Joined: 8/30/2005
Status: offline

 
**Solved** Custom error page - 2/20/2007 18:30:24   
I used this code to throw an error for a duplicate record


fp_rs.Update
	If err.number <> 0 then
    response.write "<p>That Nick Name is already in use</p>"
    response.end
    Err.Clear
    End If



This works, but it writes back to my form page, how do I get it to write to another page that I design i.e
error.asp
That way I can redirect them back to try again.

< Message edited by lovduv -- 2/21/2007 13:25:59 >
lovduv

 

Posts: 152
Joined: 8/30/2005
Status: offline

 
RE: Almost solved - Custom error page? - 2/21/2007 12:36:57   
Ok now I added this:
fp_rs.Update
	If err.number <> 0 then
    Response.Redirect "error.asp?ID="& NewId
    response.end
    Err.Clear
    End If


This works to redirect when a "duplicate record" error is thrown, but obviously the code:
& NewId
won't work as there is no new record being inserted as it is a duplicate, so how do I show the duplicate entry on the error page?
Normally I would use <%=Request.Querystring("ID")%> but again ID is no good as it is not being inserted. The form field name is Nickname.

(in reply to lovduv)
lovduv

 

Posts: 152
Joined: 8/30/2005
Status: offline

 
RE: Almost solved - Custom error page? - 2/21/2007 13:16:55   
I have solved the above with this:

Response.Redirect "error.asp?nickname="& Request("nickname")

(in reply to lovduv)
lovduv

 

Posts: 152
Joined: 8/30/2005
Status: offline

 
RE: Almost solved - Custom error page? - 2/21/2007 13:19:19   
I would like to add this but it's not formating the URL correctly any ideas?

You can view <a href='"http://www.nicklistng.aspx?nickname=<%Request.Querystring("nickname")%>"'><%=Request.Querystring("nickname")%>'s Nickname here.</a>

(in reply to lovduv)
lovduv

 

Posts: 152
Joined: 8/30/2005
Status: offline

 
RE: Almost solved - Custom error page? - 2/21/2007 13:25:14   
Got it using this!

<a href="nicklisting.aspx?nickname=<%=Request.Querystring("nickname")%>">

(in reply to lovduv)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> **Solved** Custom error page
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts