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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:27:28+00:00 2026-05-15T07:27:28+00:00

I am just starting on MVC so this should be an easy question to

  • 0

I am just starting on MVC so this should be an easy question to answer.
I am using MVC 2 for ASP.Net.
I have a drop down list which when changes should cause the grid to change as well.
I have found a way to catch the change selection event and refresh the whole form using the code below.
The $(‘#TheForm’).submit(); command causes the Index method of the Controller to run, and resets everything back as before.
What I want of course is for this method to pick up the new value of the dropdownlist, extract and display the new data in the View accordingly.
Is this how I should do it, or should I do more on the client side instead?

$(function () {
$(“#StatusId”).change(function () {
$(‘#TheForm’).submit();
});
});

<p>
    <% using (Html.BeginForm("Index", "Home", FormMethod.Post, new { id = "TheForm" })){%>
        <%: Html.DropDownList("StatusId", (SelectList) ViewData["Status"]) %>
    <%}%>
</p>

<p>
    <% if (Request.IsAuthenticated) {  %>
     <%:  Html.ActionLink("Add new item", "Add")  %>
    <% }  %>
</p>

<table>
    <tr>

        <th>
            Title
        </th>

        <th>
            Date
        </th>
        <th>
            Status
        </th>
    </tr>

<% foreach (var item in Model) { %>

    <tr>


        <td>
            <%: Html.ActionLink(item.Title, "Details", new { id = item.ItemCode }) %>
        </td>

        <td>
            <%: String.Format("{0:g}", item.DateCreated) %>
        </td>
        <td>
            <%: item.Status %>
        </td>
    </tr>

<% } %>

</table>

  <p>
    <%: Html.Label("Page: ") %>

    <% for (int i = 1; i < Convert.ToInt32(ViewData["NumberOfPages"]); i++)
       {  %>

    <%: Html.ActionLink(i.ToString(), "Index", new { page = i })%>

    <% }  %>

  </p>

  • 1 1 Answer
  • 1 View
  • 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-15T07:27:29+00:00Added an answer on May 15, 2026 at 7:27 am

    The Index action needs a parameter StatusId.

    It has to filter the list of items by StatusId. If this does not work please post the code of the action.

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

Sidebar

Related Questions

I'm new to ASP.NET and have just starting to learn ASP.NET MVC 3. I've
Just starting out in ASP.NET MVC - I have a page in ASP.NET MVC3
I am just starting porting an application to ASP.net MVC and I have an
As a fairly experienced ASP.Net developer just recently starting using MVC, I find myself
I am just starting to investigate ASP.NET MVC, and I am using the latest
i'm just starting to use asp.net mvc.. since i'm not familiar with it, i
I am just starting with OpenID in an Asp.net MVC application and was wondering
Just starting to learn ASP.NET (C#) and I am using Visual Studio 2008. I
I'm just starting to learn asp.net mvc and I'm not sure what the right
I'm just starting with ASP.Net MVC 2 and might be doing something wrong. I

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.