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.
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.
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>