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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:08:28+00:00 2026-06-16T09:08:28+00:00

This is a MVC3 project using razor. Instead of displaying another view to inform

  • 0

This is a MVC3 project using razor. Instead of displaying another view to inform the user that the changes have been saved successfully I would like to simply fire a JavaScript popup informing them… Everything I have found on the web either opens a whole new browser window, or misses what I am trying to accomplish all together… I know there is a simpler way to go about doing this but this is where I am… At the end of the controller function that does the save on the return I simply use redirect and send it to another controller function that displays a screen saying “Changes Have Been Saved Successfully” then the user clicks a button there which will take them back to the index page… IMO this is a bit shotty and think it can be cleaned up through the use of Javascript…I have not found any luck on this yet.. Currently the below code is what I am using:

 Function SomeFunctionName()
       db.SaveChanges()
       Return RedirectToAction(ChangesSaved)
 End Function

 Function ChangesSaved()
       Return View()
 End Function

And the javascript that I have implemented in the ChangesSaved view.

@Code
ViewData("Title") = "ChangesSaved"
End Code
<script type="text/javascript">
      alert("Changes Have Been Saved Successfully");
</script>

There are a few problems with this though…

JavaScript

How do I tell the javascript When the user clicks OK it should take them to another page.

I did just try the below and since I am very new to java/javascript it failed:

  var r=alert("Changes Have Been Saved Successfully");
if (r == true) {
@html.Action("***********","Admin")
}
  • 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-16T09:08:29+00:00Added an answer on June 16, 2026 at 9:08 am

    If I were you I would post your form using Jquery. Then you can set a callback. In Mvc you can return JSON data, a simple value indicating that the save worked would be enough. Then you can call your alert although you might consider using a jQuery UI dialog as it’s way more flexible. If you haven’t ever used jQuery I wouldn’t be afraid, it’s easy and there is a lot of great examples out there.

    Take a look at this http://api.jquery.com/jQuery.post/ and this, ASP.NET MVC controller actions that return JSON or partial html

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

Sidebar

Related Questions

I have one application using MVC3 w/ Razor that has been working perfectly working
I have a table in my .aspx view in MVC3 project. I am using
I have upgrade my MVC2 project to MVC3 using this tool: http://blogs.msdn.com/b/marcinon/archive/2011/01/13/mvc-3-project-upgrade-tool.aspx Which is
Quick question on best practices. I have one project MVC3 + razor that on
I have several views in an MVC3 project that allow a user to enter
I have a project that I am developing using MVC 3 using Razor views.
I have something like this in Site.Master in an asp.net mvc3 (not razor) project:
I have an MVC3 razor project, which I am trying to build using multiple
I am using JQuery and MVC3 razor on a project and I have a
In an ASP.NET MVC3 project I have a structure like this: Core.csproj -> 3rdparty1.dll

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.