JavaScript How do I redirect to a action result in a mvc view redirect action result mvc,redirect to actionresult,redirect action result

When coding a MVC 5 view, how do I redirect to a specific action result specifying the controller, action result and a parameter?

I am wanting to redirect to this action result in a Dashboard controller:

public ActionResult Location(long id)
{

}

I am wanting to do this in a javascript function if possible.

Here is my javascript code:

function MapMarkerClick(locationId)
{
    Response.Redirect(Url.Action("Location", "Dashboard", new { id == locationId }));
}

This is the error that I am getting in the browser console:

Uncaught SyntaxError: Unexpected token ==

Answer:1

Below is a very simplified version of my problem. Without changing the definition of object "o" and without using the name "obj", how can i refer to obj inside foo. var obj = { foo: function () {...

Below is a very simplified version of my problem. Without changing the definition of object "o" and without using the name "obj", how can i refer to obj inside foo. var obj = { foo: function () {...

Ok. So I'm trying to re create this really cool looking button that I found. The example is at http://gyazo.com/cafe378e8340d71c341b7c52857b2689 See how it is first invisible but now it's faded a ...

Ok. So I'm trying to re create this really cool looking button that I found. The example is at http://gyazo.com/cafe378e8340d71c341b7c52857b2689 See how it is first invisible but now it's faded a ...

So I've used bootstrap accordion to hide/unhide info. I needed the wording to change from 'See more' to 'See less' continuously. I've implemented this as you can see in the bootply As you will see,...

So I've used bootstrap accordion to hide/unhide info. I needed the wording to change from 'See more' to 'See less' continuously. I've implemented this as you can see in the bootply As you will see,...

I'm using the following code to detect multiple keys on a keypress event: var down = []; $(document).keydown(function (e) { down[e.keyCode] = true; }).keyup(function (e) { if (down[17] &...

I'm using the following code to detect multiple keys on a keypress event: var down = []; $(document).keydown(function (e) { down[e.keyCode] = true; }).keyup(function (e) { if (down[17] &...

  1. prevent spaces input
  2. prevent spaces in input field
  3. prevent spaces in input field angular
  4. prevent spaces in input field html
  5. javascript prevent spaces in input
  6. angular prevent spaces in input
  7. jquery prevent space input