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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:28:30+00:00 2026-05-17T00:28:30+00:00

Below is the short version of my code, it’s very basic. In my page

  • 0

Below is the short version of my code, it’s very basic. In my page model, I have an enumerable field that I’m passing into an Action() method. The problem is, right before Html.Action() is invoked in the view, it’s NOT null. However, once it’s inside the child action, it’s suddenly null – as if it’s not being passed in.

On a similar attempt, I tried doing Html.Partial(“OverlayAlerts”, Model.Alerts) and it still passes the data in as null. I’m not sure why this is. When debugging, the Alerts property is being populated before calling the Action() (or Partial()) method. Any ideas? Thanks.

PAGE CONTROLLER ACTION

public ActionResult Index() 
{
    var model = new DashboardModel()
    {
        ...
        Alerts = GadgetService.GetAlerts()
        ...
    };

    return View(model); 
}

MODEL:

public class DashboardModel
{
    ...
    public IEnumerable<AlertMessage> Alerts { get; set; }
    ...
}

VIEW

<%: Html.Action("GetOverlayAlerts", Model.Alerts)%>

CHILD ACTION (same controller)

[ChildActionOnly]
public ActionResult GetOverlayAlerts(IEnumerable<AlertMessage> alerts)
{
    alerts.Any(); // <--- FAILS: alerts is passed through as null?
}
  • 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-17T00:28:30+00:00Added an answer on May 17, 2026 at 12:28 am

    Try this:

    <%: Html.Action("GetOverlayAlerts", new {alerts = Model.Alerts})%>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Short version: $count in the code below seems to be 0 even when it
I have a JSF page with two forms (pseudo-code below). First form is for
Short version: I have a third-party MVC Extension that returns the FileResult. I would
I have a performance bottleneck on a DataView.Sort. The code is below. /// <summary>
Below is code to an inherited ComboBox. The issue is that the ComboBox is
http://pastebin.com/1MGTtzij here is my full html document, and below is the short version: $(document).ready(function
Short Version For those who don't have the time to read my reasoning for
I've got a short piece of code that originally created an SqlDataAdapter object over
Short version I would like to scroll the ListBox item into view when the
I have a program that sorts big files by splitting them into chunks, sort

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.