Solved

Syntax (ASP/Javascript) to redirect passing parameter

Posted on 2014-01-18
4
453 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 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

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.

Question has a verified solution.

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

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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
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…
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).

756 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