Solved

Syntax (ASP/Javascript) to redirect passing parameter

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ASP SQL Syntax Duplicate Key 7 66
Angular JS form 8 25
Safari SVG Image Problem 1 19
Connect MySql database to wordpress site 3 15
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
This article discusses how to create an extensible mechanism for linked drop downs.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now