Solved

ASP syntax

Posted on 2014-01-18
9
426 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 
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 Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
The viewer will learn how to count occurrences of each item in an array.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

734 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