Solved

ASP syntax

Posted on 2014-01-18
9
417 Views
Last Modified: 2014-01-18
I have a redirect in my page with passes parameters:

Response.Redirect "EmailQuestionnairexisting.asp?process=" & Request.Form("process") & "&draft=" & Request.Form("draft")  

Works fine, I need to add one more parameter but I can't seem to get the syntax right.

The parameter name is:  NewUserid
and it comes from Request.Querystring("NewUserId")

I tried:

Response.Redirect "EmailQuestionnairexisting.asp?process=" & Request.Form("process") & "&draft=" & Request.Form("draft")  & NewUserid=" & Request.Querystring("NewUserId")

But it gives me the following URL instead of the actual value:

http://localhost/bluedot/Intranet/Qnr/Qnrredirect.asp?NewUserId=Request.Querystring(
0
Comment
Question by:amucinobluedot
  • 4
  • 3
  • 2
9 Comments
 
LVL 58

Assisted Solution

by:Gary
Gary earned 300 total points
ID: 39791370
Response.Redirect "EmailQuestionnairexisting.asp?process=" & Request.Form("process") & "&draft=" & Request.Form("draft")  & "&NewUserid=" & Request.Querystring("NewUserId")
0
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 200 total points
ID: 39791388
Like that ^^^
0
 

Author Comment

by:amucinobluedot
ID: 39791397
0
 
LVL 58

Assisted Solution

by:Gary
Gary earned 300 total points
ID: 39791407
Post exactly what you have now

Also you are using request.form and request.querystring - are you sure you have posted values and querystring vaues?
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:amucinobluedot
ID: 39791418
Yes Sir.

This is the page that will post to the page that has the redirect:

http://localhost/bluedot/Intranet/Qnr/Indexexistingcontact.asp?NewUserId=22698

The one parameter that matters the most is "NewUserId" which is a querystring parameter and should be passed on to the next page.

This is the redirect:

Response.Redirect "EmailQuestionnairexisting.asp?process=" & Request.Form("process") & "&draft=" & Request.Form("draft")  & "&NewUserid=" & Request.Querystring("NewUserId")

The next page gets:

http://localhost/bluedot/Intranet/Qnr/EmailQuestionnairexisting.asp?process=&draft=&NewUserid=Request.Querystring(

In this particular case I didn't pass either of the request.form parameters, thats OK, the NewUserid tho instead of passing the value passes:  Request.Querystring(

Not sure why the value is not being passed
0
 
LVL 58

Assisted Solution

by:Gary
Gary earned 300 total points
ID: 39791437
Well that's curious because it should not be happening at all.

Try

Response.Redirect ("EmailQuestionnairexisting.asp?process=" & Request.Form("process") & "&draft=" & Request.Form("draft")  & "&NewUserid=" & Request.Querystring("NewUserId"))



If still the same then separate your redirect

myURL = "EmailQuestionnairexisting.asp?process=" & Request.Form("process") & "&draft=" & Request.Form("draft")  & "&NewUserid=" & Request.Querystring("NewUserId")

Response.Redirect (myURL)
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 200 total points
ID: 39791439
Here are two demos that show how this should work.

The form page: "RRaspform.asp"
<%
dim submitr
submitr=Request.Form("submit")
If submitr <> "" Then
Response.Redirect "EmailQuestionnairexisting.asp?process=" & Request.Form("process") & "&draft=" & Request.Form("draft")  & "&NewUserid=" & Request.Querystring("NewUserId")  
End If
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>ASP Form Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<form action="RRaspform.asp?NewUserId=12345" method="post">
Your name: <input type="text" name="fname" size="20" value="Dave" />
Process: <input type="text" name="process" size="20" value="slow" />
Draft: <input type="text" name="draft" size="20" value="beer" />
<input type="submit" name="submit" value="Submit" />
</form>

</body>
</html>

Open in new window


The redirect page:  "EmailQuestionnairexisting.asp"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>EmailQuestionnairexisting</title>
</head>
<body>
<h1>Response.Redirect Example</h1>
<% 
Response.write "EmailQuestionnairexisting.asp?process=" & Request.Querystring("process") & "&draft=" & Request.Querystring("draft")  & "&NewUserid=" & Request.Querystring("NewUserId")  

 %>
</body>
</html>

Open in new window

0
 

Author Comment

by:amucinobluedot
ID: 39791474
I decided to add the value to a hidden form element and then pass it on to the redirect page and .. well ..it worked.
0
 

Author Closing Comment

by:amucinobluedot
ID: 39791475
Thx
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now