Solved

ASP syntax

Posted on 2014-01-18
9
423 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
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
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
 

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

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

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

Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

827 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