|
| |
|
|
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.
|
|
|
|
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")
|
|
|
|
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>
|
|
|
|
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")%>">
|
|
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
|
|
|