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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:46:30+00:00 2026-05-27T18:46:30+00:00

I have an ActionResult that returns a View with a grid that show notes

  • 0

I have an ActionResult that returns a View with a grid that show notes from a database. On the same page there is a button to call CreateNote, which returns a PartialView where I can add new notes. This all works, but after adding the new note I want the view to go back to the TabNotes showing the grid.
I tried using

return Redirect(HttpContext.Request.UrlReferrer.AbsoluteUri);

but this goes to the wrong page. So instead I want to return the TabNotes ActionResult. Is this possible?

  public ActionResult CreateNote(
        [ModelBinder(typeof(Models.JsonModelBinder))]
        NoteModel Model, string cmd, long? itemId, string modelEntity)
    {

        if (cmd == "Save")
        {
            Model.meta.message = "Note saved";
            //standard user = 1, needs to be changed to variable
            test.Database.User User = UserRepository.GetUser(1);
            Entity entity = NotesRepository.GetEntity("Phrase");
            NotesRepository.StoreNote(Model.subject, Model.text, User, entity, itemId);
            return Redirect(HttpContext.Request.UrlReferrer.AbsoluteUri);
        }
        Model.meta.modelname = "CreateNote";
        Model.meta.JsViewModelType = "EditNoteModel";
        Model.meta.PostAction = Url.Action("CreateNote", new { cmd = "Save", itemId = itemId});


        return PartialView("CreateNotePartial",Model);

        }

‘

    public ActionResult TabNotes([ModelBinder(typeof(Models.JsonModelBinder))]
        TabNotesModel Model, string cmd)
    {
        Entity entity = NotesRepository.GetEntity(Model.meta.entity);
        if (Model.meta.id.HasValue)
        {
            Model.meta.modelname = "TN" + Model.meta.entity + Model.meta.id.Value.ToString();

            Dictionary<string, object> defaultValues = new Dictionary<string, object>();
            defaultValues.Add("Entity", entity.EntityId);
            defaultValues.Add("ItemId", Model.meta.id.Value);
            Entity noteEntity = NotesRepository.GetEntity("Note");
            var grid = UI.GetEntityFlexiGrid(noteEntity, true, true, true, true, defaultValues);
            grid.buttons.Clear();
            grid.title = "";
            Model.Grid = grid;

            Model.Grid.url = Url.Action("TabNoteData", new { id = Model.meta.entity, itemId = Model.meta.id.Value});
        }


       return View("TabNotes", Model);
    }
  • 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-27T18:46:31+00:00Added an answer on May 27, 2026 at 6:46 pm

    You should redirect to the action:

    return RedirectToAction("TabNotes");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I create an controller method that returns ActionResult, then call View() at the
I have an action that returns a view with a master page with a
We have a pluggable framework that returns ActionResult objects that render things to a
I have a really simple action in a controller that simply returns a view
I have a partial view that upon adding an item to the database needs
I have a view with a grid that contains items added to a workstation.
I have a partial view that returns an HTML chunk of list items that
I have a Html.Helper that I use to delete rows from my grid. It
I have created a repository that is returning data from my database using Entity
I have this controller function that returns cpu stats: public ActionResult GetStats() { Random

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.