Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8232887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:58:14+00:00 2026-06-07T17:58:14+00:00

I am using javascript to load up an Action and finding that when the

  • 0

I am using javascript to load up an Action and finding that when the action method is called one of the parameters “returnUrl” is always null. I have confirmed that returnUrl is populated in the javascript correctly using firebug, but somewhere between executing the .load function and the action method the value for returnUrl is lost and set to null. I have found that if I remove the “id” parameter and just have the “returnUrl” parameter that returnUrl has the correct value. I have spent many hours trying to figure out what is going on here and am completely stumped, I would apprectiate some help.

My Javascript:

<!-- Review Dialog Popup -->
<script type="text/javascript">
function showWriteReviewDialog(gameId, returnUrl) {
    if( $("#Review").length == 0)
    { 
        var url = "@Url.Action("WriteUserReview", "UGDBUser", new { id = "PLACEHOLDER", returnUrl =  Request.Url.ToString() })";

        // ajax load
        $('#writereview').load(url.replace('PLACEHOLDER', gameId));
    } else {
        // clear summary & reviewtext fields
        $('#summary,#reviewtext').val('');

        //reopen the write review dialog which was previously rendered
        $("#Review").dialog({
            modal: true, 
            autoOpen: true,
            resizeable: false
        }); 
    }
};
</script>

My Dumbed Down Action Method:

     [Authorize]
     public ActionResult WriteUserReview(Guid id, string returnUrl)
     {
        return Redirect(returnUrl);
     }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T17:58:15+00:00Added an answer on June 7, 2026 at 5:58 pm

    There must be something wrong with the URL generated. Also make sure the id is a guid. Here is an example.

    Option 1

    function showWriteReviewDialog(gameId, returnUrl) {
    
        var url = '@Url.Action("TestParams", "Home")?id=' + gameId + '&returnUrl=' + returnUrl;
        $("#writereview").load(url);
    
        //rest of your operations
    };
    

    Option 2

    function showWriteReviewDialog(gameId, returnUrl) {
    
        var url = '@Url.Action("TestParams", "Home", new { id = "guid_replace", returnUrl = "url_replace"})';
        url = url.replace('guid_replace', gameId);
        url = url.replace('url_replace', returnUrl);
    
        $("#writereview").load(url);
    
        //rest of your operations
    };
    

    Screen shot on hitting the action; it returns both the values (have a look at the watch window)

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to load javascript contents using php. Suppose when php saves a file using,
Suppose a HTML document has a iframe. Using javascript,I want to detect ,on load
I am using an JavaScript (and AJAX) to dynamically load a PHP page into
When trying to dynamically load a Javascript file using jQuery I keep getting a
We are trying to load a pdf file in web browser using pdfobject javascript
I'm using Head js to load my javascript files in parallel. I added head
When I load jquery using: <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js></script> it works on IE9, firefox, chrome,
I'm using this to load php functions and send them to javascript in a
Javascript newbie here, trying to load Twitter profile images using the URLs returned by
I am reading javascript web application and the author is using following code: mod.load

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.