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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:48:07+00:00 2026-06-07T20:48:07+00:00

I am building a Website for document management system on ASP.NET MVC3, in a

  • 0

I am building a Website for document management system on ASP.NET MVC3, in a page I am using a Partial view, the Partial View represents a simple Form.There is a drop down list and when one option is selected the ID of selected option should go to action Result. To do that i used $.getJSON method to pass values to action method. but problem is ID not goes to ActionResult. Can anyone help me to solve this problem?

cshtml code

<div >
  @using (Html.BeginForm("GetFilteredActivityLogs", "Document", FormMethod.Post, new
    {
        id = "activityLog",
        @class = "form-horizontal",

    }))
  {
<h3>Activity Log</h3>
   <div>
    <div style="float: left" class="control-label">
        <label>
            Action Type
        </label>
    </div>
    <div class="controls">
    @Html.DropDownListFor(model => model.SelectedActionId, Model.ActionTypes as SelectList, "All", new { 
        id = "SelectedActionId" 
})
    </div>
    <table class="table table-bordered" style="margin-top: 20px;  width: 100%;">
        <thead>
            <tr>
                <th style="width: 15%; text-align: center">
                    Employee No

                </th>
                <th style="width: 20%; text-align: center">
                    Employee Name
                </th>
                <th style="width: 45%; text-align: center">
                    Action
                </th>
                <th style="width: 20%; text-align: center">
                    Date and Time
                </th>
            </tr>
        </thead>
        <tbody id="Activities">
        </tbody>
    </table>
    </div>
  }
</div>

controller:

 public ActionResult GetFilteredActivityLogs(int actionTypeId)
    {
        return View();
    }

Script:

<script type="text/javascript">
    $(function ()
    {
        $('#SelectedActionId').change(function ()
        {
            var selectedActivityId = $(this).val();

            $.getJSON('@Url.Action("GetFilteredActivityLogs", "Document")', { activityId: selectedActivityId }, function (FilteredActivities)
            {
                var ActivitySelect = $('#Activities');
                // GroupSelect.empty();
                $.each(FilteredActivities, function (index, activity)
                {
                    // some code goes here...
                });
            });
        });
    });
</script>
  • 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-07T20:48:09+00:00Added an answer on June 7, 2026 at 8:48 pm

    As BuildStarted says I think you need to make the data key you’re sending in the getJSON request (“activityId”) match the parameter on your action. I often just use “id” when there’s a single parameter in order to get a match on the default route and therefore a nice URL (ie /Document/GetFilteredActivityLogs/123).

    One other observation here: I think it would be worth having a look at the jQuery form plugin (http://malsup.com/jquery/form/). As it stands you’re defining your parameters twice, once in BeginForm and again in your javascript. If you enable ajax on the form itself using the plugin you can define the params only in BeginForm, then in the “change” event handler submit the form.

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

Sidebar

Related Questions

I'm building a website with ASP.NET MVC3. When a user signs in, I pull
I am building an asp.net website and I am constructing a Excel document based
I'm looking at building a templating engine for my website. I'm using ASP.NET MVC
I'm building an ASP.NET MVC3 website. I have some javascript in my .cshtml file:
i am building a website using asp.net mvc and jquery. as a best practice
I am building a website using ASP.NET MVC and entity framework. I have a
I'm working on a web page (ASP.NET 4.0) and am just starting simple to
I am building a website templating system where multiple user can create their own
I am building a website using php and mysql.I have a login that is
I am building my portfolio website simply using HTML , Flash , and the

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.