Solved

Syntax (ASP/Javascript) to redirect passing parameter

Posted on 2014-01-18
4
455 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
[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 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 53

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to dynamically set the form action using jQuery.

740 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