Solved

Syntax (ASP/Javascript) to redirect passing parameter

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
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…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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…

687 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