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 8557439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:34:22+00:00 2026-06-11T15:34:22+00:00

In an ASP.NET MVC3 project, I have 2 controllers: one is HomeController.cs public class

  • 0

In an ASP.NET MVC3 project, I have 2 controllers: one is

HomeController.cs

public class HomeController : Controller
{
    //
    // GET: /Home/

    public ActionResult Index()
    {
        return View();
    }

    //
    // POST: /Home/CheckLogin/

    [HttpPost]
    public ActionResult CheckLogin()
    {
        // setting the session variable if login is correct
        // and redirecting to /ReWeb/

        // else, reloading the login.
    }
}

and the other is ReWebController.cs

public class ReWebController : Controller
{
    //
    // GET: /ReWeb/

    public ActionResult Index()
    {
        // Session verification
        if (Session["_ReWeb"] != null)
        {
            return View();
        }

        // If session is null or not valid,
        // redirect to login page
        return RedirectToAction("Index", "Home");
    }
}

In the login page, which is the view returned by the HomeController Index action, I have the following form:

<div id="loginPanel">
    <form enctype="application/x-www-form-urlencoded" id="login" method="post">
        <h1>Log In</h1>
        <fieldset id="inputs">
            <input id="Utente" name="Utente" type="text" placeholder="Utente" autofocus="true" required="true" />   
            <input id="Password" name="Password" type="password" placeholder="Password" required="true" />
        </fieldset>
        <fieldset id="actions">
            <input type="submit" id="submit" value="Log in" onclick="javascript:window.open('/Home/CheckLogin/', 'WebClient', 'width=500,height=250,left=100,top=100')"/>
        </fieldset>
    </form>
</div>

What I’m trying to do is, when the user clicks the Log in button, the application to return the view of the ReWebController in a popup page. From what I’ve done here, it opens the popup, but gives an 404 error: Server Error in ‘/’ Application. The resource cannot be found. Requested URL: /Home/CheckLogin/.

How can I accomplish this approach? Am I doing it right?

Many thanks!

  • 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-11T15:34:23+00:00Added an answer on June 11, 2026 at 3:34 pm

    You’re getting the 404 error because your HomeController only contains a CheckLogin action that accepts POST-requests. When clicking your login button, your just loading a URL in a new window, which is a GET-request.

    One option to handle this to let you CheckLogin action return a JSON object containing true or false, depending on whether or not the login was successful. In your login view, you can then do something like this:

    $('form#login').submit(function () {
        var data = {}; // put the login data in here
    
        $.post('/Home/CheckLogin', data, function (result) {
            // Here you can check 'result'
            if (result.success === true) {
                window.open('/ReWeb', 'WebClient', 'width=500,height=250,left=100,top=100');
            }
            else {
                // The login failed
            }
        }).error(function() {
            // Something went wrong when trying to make the request.
            // Like a 404, 501, ... error
        });
    
        return false;
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a ASP.NET MVC3 Razor project I have 2 Models public class Post {
I am using asp.net Mvc3 I have 2 controllers in two different projects. HomeController
I have a new asp.net mvc 3 project with following structure: Views: /Home/Index.cshtml @{
In an ASP.NET MVC3 project I have a structure like this: Core.csproj -> 3rdparty1.dll
i have a problem with the asp.net MVC3. when i create a new project
I'm creating a project from the book Sanderson Pro ASp.net mvc3. But I have
I have a MVC3 ASP.NET Project in which I am using jQuery and KendoUI
At the moment I have a MasterPage in an ASP.NET MVC3 project with a
I have an asp.net mvc3 project, it has some reports in aspx web pages.
I have an ASP.NET MVC3 project that uses a tab strip on certain pages.

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.