Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ASP syntax

Posted on 2014-01-18
9
Medium Priority
?
429 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 1200 total points
ID: 39791370
Response.Redirect "EmailQuestionnairexisting.asp?process=" & Request.Form("process") & "&draft=" & Request.Form("draft")  & "&NewUserid=" & Request.Querystring("NewUserId")
0
 
LVL 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 800 total points
ID: 39791388
Like that ^^^
0
Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

 
LVL 58

Assisted Solution

by:Gary
Gary earned 1200 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 1200 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 84

Accepted Solution

by:
Dave Baldwin earned 800 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

Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

Question has a verified solution.

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

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will learn how to count occurrences of each item in an array.

660 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