Solved

Syntax (ASP/Javascript) to redirect passing parameter

Posted on 2014-01-18
4
452 Views
Last Modified: 2014-01-18
I have the following piece of code which works fine so far

    // append the query string to the redirect URL
    var MM_editRedirectUrl = "SPAddAttachmentlinks.asp";
    if (MM_editRedirectUrl && UploadQueryString && UploadQueryString.length > 0) {
      MM_editRedirectUrl += ((MM_editRedirectUrl.indexOf('?') == -1) ? "?" : "&") + UploadQueryString;
    }
    Response.Redirect(MM_editRedirectUrl)

---

I need to pass a parameter to the next page named "NewUserid"

The value is: Request.Querystring("NewUserid")

How can I add that to the line:

 var MM_editRedirectUrl = "SPAddAttachmentlinks.asp";
0
Comment
Question by:amucinobluedot
4 Comments
 

Author Comment

by:amucinobluedot
ID: 39791525
I tried the following but didnt work

    var MM_editRedirectUrl = "SPAddAttachmentlinks.asp?NewUserId=rsUserid.Fields.Item('Userid')";

I get this in the URL

http://localhost/bluedot/Intranet/Qnr/SPAddAttachmentlinks.asp?NewUserId=rsUserid.Fields.Item(%27Userid%27)&GP_upload=true&UploadId=398604892

So it's not passing the parameter value
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 39791531
What about :
var MM_editRedirectUrl = "SPAddAttachmentlinks.asp?NewUserId=" + rsUserid.Fields.Item('Userid');
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39791602
What happened to this answer? http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/ASP/Q_28342256.html

I am pretty sure the issue is you are using dreamweaver and processing a form which then redirects and you are mixing up their code.  

Are you using vb script or jscript?

Which script or plug in or drag and drop are you using?
0
 
LVL 58

Expert Comment

by:Gary
ID: 39791618
If you could store Request.Querystring("NewUserid") in an hidden input field with an ID (you do this at the server with your ASP code) then you could easily access it from your javascript like so

var MM_editRedirectUrl = "SPAddAttachmentlinks.asp?NewUserid="+document.getElementById("ID_of_input").val()
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
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).

860 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