Click to See Complete Forum and Search --> : ASP Problem: Response.Redirect


blink
09-10-2003, 12:09 PM
Hey Guys,

Well..this is my first post here so hello all! I know it is kinda long, but I am a descriptive person. Thanks for bearing with me.

Ok, heres the problem. I have an asp page that is a form that updates a Microsoft Access table. I use Dreamweaver MX for all initial coding and just modfiy it's code as I need. The problem I am having is that after the udate code executes (i.e the record is updated) I put a response.redirect in their to send them back to where they started, which is another update page with more generalized fields. I need to pass a url parameter called autonumber to the next page. I have not had any problems with this in the past and in fact if I hard code an autonumber instead of calling it via Request.QueryString, it works fine (ie. www.pagenamehere.com?AutoNumber=5).

The problems occur when I try making the number dynamic.

If anyone thinks they can help out leave a reply, I'll then post the code in question.

THANKS

KBoek
09-11-2003, 03:06 AM
Have you tried this: Response.redirect("default.asp?id=5"). That should usually give you a 5 when you get the Request.Querystring("id") in the page that you are redirected to (default.asp in my example)

This code might be helpful, if not, just ignore it


(file 1, let's say form.asp)
<%
...
if AdditionalInfo = "Yes" then
response.redirect ("default.asp?id=5")
else
RedirectPage = "default.asp" & DBRecordSet("FieldValue")
response.redirect (RedirectPage)
end if
%>

(file 2, default.asp)
<%
Select Case Request.Querystring("id")
Case 5
Response.Write "The ID is 5"
Case 6
Insert some code here
Case else
If it's not any of the upper cases then
Do Some Code
End Select
%>