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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:38:49+00:00 2026-06-11T22:38:49+00:00

My web page / view will have 1 to many import records. Within each

  • 0

My web page / view will have 1 to many import records.
Within each import record will be 0 to many of the following:

  • Purchase Orders
  • Shipping Containers
  • Products
  • Invoices

I have coded my view model as follows:

namespace LemansCorpIntranet.Models
{    
    public class ImportWebViewModel
    {
        public string button { get; set; }
        public string status_filter { get; set; }
        public string import_id_filter { get; set; }
        public DateTime date_filter { get; set; }
        public string vendor_filter { get; set; }
        public string port_filter { get; set; }
        public string whse_filter { get; set; }
        public Boolean not_released_filter { get; set; }
        public int release_gap { get; set; }
        public List<import_row> import_rows;
    }

    public class import_row
    {
        public string update_switch { get; set; }
        public string id { get; set; }
        public IEnumerable<SelectListItem> ship_via { get; set; }
        public string broker_number { get; set; }
        public string voyage { get; set; }
        public string vessel { get; set; }
        public decimal shipment_value { get; set; }
        public int cartons { get; set; }
        public decimal weight { get; set; }
        public decimal volume { get; set; }
        public string clearance_port { get; set; }
        public string warehouses_in_shipment { get; set; }
        public string payment_type { get; set; }
        public string insurance { get; set; }
        public DateTime ship_date { get; set; }
        public DateTime close_date { get; set; }
        public DateTime customs_date { get; set; }
        public string customs_entry { get; set; }
        public DateTime pl_2_whse_date { get; set; }
        public DateTime estimated_arrival_date { get; set; }
        public DateTime wire_transfer_request_done_date { get; set; }
        public DateTime approved_broker_bill_date { get; set; }
        public DateTime product_released_date { get; set; }
        public List<Invoice> Invoices;
        public List<PurchaseOrder> PurchasOrders;
        public List<Product> Products;
        public List<Container> Containers;
    }

    public class Invoice
    {
        public string invoice_number { get; set; }
    }

    public class PurchaseOrder
    {
        public string id { get; set; }
        public string whse { get; set; }
        public string vendor_code { get; set; }
        public string vendor_name { get; set; }
    }

    public class Product
    {
        public int line_number { get; set; }
        public string description { get; set; }
    }

    public class Container
    {
        public int line_number { get; set; }
        public int size { get; set; }
        public string id { get; set; }
        public string seal { get; set; }
        public DateTime received_date { get; set; }
        public int cartons { get; set; }
    }  
}

Is the above OK? Are the classes nested correctly?

I can get the view to display my data from the server correctly, but when I “post” the form the data in the nested classes is null.

I believe this is because the input controls don’t get built as they need to be.

My view is similar to the following:

<table>
<% if (Model.import_rows != null)
   { %>
<%    for (int row = 0; row < Model.import_rows.Count; row++)
      { %>
        <tr><td>
                <%=Html.HiddenFor(x=>x.import_rows[row].id) %>
                <%=Html.TextBoxFor(x => x.import_rows[row].id)%>
            </td>
        </tr>
<%    } %>
<% } %>
</table>

Any suggestions would be greatly appreciated….

Update: I have changed my view to include “hiddenFor” items.

“import_rows” is no longer null in the controller, but the count is “0”.
I still must be missing something…..

Thanks in advance.

  • 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-11T22:38:50+00:00Added an answer on June 11, 2026 at 10:38 pm

    I was attempting to pass the viewmodel in a RedirectToAction..

    Have discovered this doesn’t work that way.

    Thanks everyone for your assistance.

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

Sidebar

Related Questions

This is my web page Grid view.If i'm add so many records it will
I'm about to have to write a web page/app that will serve the agenda
I am making a web page which will allow users to input and view
I will build an Asp.net MVC 3 web page. View : The view (web
In my application i have one web view .I will loading a simple html
Within my application I would like to show a web page within a view
I needed to build an Android app that lets you view a web page
I am opening an html page in web view and By Clicking an html
After I upload my PHP files to my web host, I view the page
Through a web browser, I can view the tweet page via visiting an url

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.