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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:31:27+00:00 2026-05-27T22:31:27+00:00

I have this button with which I want to send data back to the

  • 0

I have this button with which I want to send data back to the ActioResult. I want to send and id and an entity name. The id works fine, but when I also want to send the entity name it does not work. How do I send back multiple variables to the ActionResult? This is my html/javascript:

@model test.Web.Framework.Areas.Administration.Models.TabNotesModel 
@using (UI.DocumentReadyScript())
{
    if (Model.meta.id.HasValue)
    {
        UI.jQuery("#tbl" + Model.meta.modelname).flexigrid(Model.Grid);
        }
    }
<form method="post" action="@Url.Action("TabNotes", new { cmd = "refresh" })"  id="@Model.meta.modelname">
<div class="ui-state-highlight ui-corner-all highlight" data-bind="visible: meta.message">
    <span class="ui-icon ui-icon-info"></span><strong data-bind="text: meta.message">
    </strong>
</div>
@using (UI.BeginBlock("Administation.TabNotes", UI.Label("Notes", "Notes").ToString(), test.Web.Framework.Core.enumIcons.pencil, false, false))
{
    <table id="@("tbl" + Model.meta.modelname)">
    </table>
}
</form>
<script type="text/javascript">
(function() {
    $('#load-partial').click(function() {
        $('#partial').load('@Url.Action("CreateNote", "Entity", new {itemId = @Model.meta.id, modelEntity = @Model.meta.entity})');
// I also tried modelEntity = "Phrase" to test, but that also didn't work
        }); 
    })(); 
</script>

<div id="partial"></div>
<button type="button" id="load-partial">Create Note</button>

and my ActionResult. The modelEntity stays null. The itemId does get the number.

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

        if (cmd == "Save")
        {
            Model.meta.message = "Note saved";
            Entity entity = NotesRepository.GetEntity(modelEntity);
            NotesRepository.StoreNote(Model.subject, Model.text, entity, itemId);
            return RedirectToAction("TabNotes", new { modelEntity = modelEntity, id = itemId});
        }

        Model.meta.modelname = "CreateNote";
        Model.meta.JsViewModelType = "EditNoteModel";
        Model.meta.PostAction = Url.Action("CreateNote", new { cmd = "Save", itemId = itemId, modelEntity = modelEntity});


        return PartialView("CreateNotePartial",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-27T22:31:27+00:00Added an answer on May 27, 2026 at 10:31 pm

    Url.Action only takes route values there, so you I think you need a route to cope with the second parameter. I assume your current route already has itemId which is why it works.

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

Sidebar

Related Questions

I have this solution for a single button: myButton.Attributes.Add(onclick, this.disabled=true; + GetPostBackEventReference(myButton).ToString()); Which works
I have login form which i want to send via ajax using serialize but
I have a button in my application which is bound to a command. This
In JSF2 I have a command button, which should send only one field: <h:inputHidden
I have the following Code for a Button, which i want to built up
I have jQuery code which looks something like this on Button1 Click $('table.result_grid tbody
I have this button on the leftside of my UISplitViewController (RootViewController) that has a
I have this code in the end of link button click: Response.ContentType = application/zip;
I have this code that has one button that let's me choose an entry
I have this little script to toggle a contact form when a button is

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.