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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:35:26+00:00 2026-05-25T10:35:26+00:00

In my _Layout.cshtml I write javascript code, that allow me to display modal dialog

  • 0

In my _Layout.cshtml I write javascript code, that allow me to display modal dialog on the page with form for user login when I click on link, and that is work. My problem is that I want do something like that:

I click on ActionLink, that run code from controller, i.e:

    public ActionResult Create()
    {
        if (Session["UserID"] != null)
        {
            ViewBag.PlaceID = new SelectList(db.Places, "PlaceID", "Name");
            ViewBag.UserID = new SelectList(db.Users, "UserID", "FullName");
            return View();
        }
        else
        {
            return RedirectToAction("LogIn", "User");
        }
    } 

Anyone have idea, how to change return RedirectToAction("LogIn", "User"); code, for something that show me my modal dialog instead of opening new page for login?

  • 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-25T10:35:27+00:00Added an answer on May 25, 2026 at 10:35 am

    You should handle the click in javascript.

    Your click should open the modal window, this could be a partial you return from a controller.. or just do a show hide. have the login sitting on the page already. But if you wanted to you could put a remote URL (which would be a call to your controller) in the source of the modal window.

    check out this:

    ASP.Net MVC jQuery Dialog Partial

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

Sidebar

Related Questions

I am using an mvc application and in _Layout.cshtml page I have some javascript
On my MVC3 _Layout.cshtml page I show a banner image like this <body> <div
I have a MVC 3 project in which I use _Layout.cshtml as master page
I use @RenderSection(Contextual, false) within my _Layout.cshtml to allow different views to render their
I have a top-level _Layout.cshtml that looks something like this: <html> <head> @RenderSection(Header, required:
I currently have a partial view that is called within my _Layout.cshtml, and is
I have _Layout.cshtml defined for my mvc application, which is shown below: @inherits System.Web.Mvc.WebViewPage
Hi I would like to dynamically load meny items in the _Layout.cshtml file. How
Im having some trouble getting Ajax.ActionLink to work how I expect. In /views/layout/_Layout.cshtml I
In my application I have some basic user information that needs to be displayed

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.