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

  • Home
  • SEARCH
  • 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 6233697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:20:49+00:00 2026-05-24T10:20:49+00:00

How can I redirect the viewer to a URL? I noticed that someone asked

  • 0

How can I redirect the viewer to a URL?

I noticed that someone asked How to redirect to another webpage in JavaScript/jQuery?, but I’m not exactly sure where this should go.

I have tried in the controller with:
window.location.replace("http://192.168.1.109/MWT/Taglist/ShowMap" + LastId);
and in the view with:

<% if (BreakCount >= 8) {  
    var url = "http://192.168.1.109/MWT/Taglist/ShowMap" + LastId;  
    window.location.replace(url);  
} %>  

Neither of these work. In both places places window has a red squiggly line underneath it and when I hover over it the message says “The name ‘window’ does not exist in the current context.”

Any help would be greatly appreciated!

=D

  • 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-05-24T10:20:50+00:00Added an answer on May 24, 2026 at 10:20 am

    Your question is tagged MVC 3, so I’ll give you the answer for that in spite of the JavaScript example you listed. In your controller class use this code:

    public ActionResult MyAction()
    {
        // Use this for an action
        return RedirectToAction("ActionName");
        // Use this for a URL
        return Redirect("http://192.168.1.109/MWT/Taglist/ShowMap" + LastId);
    }
    

    This is occuring on the server, meaning that the client browser recieves a redirect response for which the browser will likely submit an additional request. If you return a page with JavaScript it will have to load a page, run the JavaScript (presuming it is enable on the client’s browser), the load the next page. Among other problems, using JavaScript means that if the user presses the back button they will be repeatedly redirected again back to the page they are currently on.

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

Sidebar

Related Questions

Usually we can redirect to another page using ForwardResolution(path) in stripes, but I want
I know you can redirect subdomains to a different server, but can you do
I have a url redirect controller called go. It can redirect topic model and
Can someone redirect me to your own blog link or any other link explaining
how can i redirect index.php?search= to the base url? I tried it with this
How can I redirect a page request in Go running on GAE, so that
I have a batch-file program that gets called from another batch-file so I can
Can anyone suggest how I can redirect any traffic the following path to another
In Javascript I can redirect and preserve the query string and fragment ID like
I think that's an easy question but couldn't find the solution. I redirect the

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.