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

  • Home
  • SEARCH
  • 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 3853902
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:32:27+00:00 2026-05-19T17:32:27+00:00

Hi, I have a View class that contains a list, this list explains the

  • 0

Hi,

I have a View class that contains a list, this list explains the available files that the user have uploaded (rendered with an html helper).

To maintain this data on submit I have added the following to the view :

<%: Html.HiddenFor(model => model.ModelView.Files)%>

I was hoping that the mode.ModelView.Files list would be returned to the action on submit but it is not?

Is it not possible to have a list as hiddenfield?

More information : The user submit a couple of files that is saved on the service, when saved thay are refered to as GUID and is this list that is sent back to the user to render the saved images. The user makes some changes in the form and hit submit again the image list will be empty when getting to the control action, why?

BestRegards

  • 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-19T17:32:28+00:00Added an answer on May 19, 2026 at 5:32 pm

    Is it not possible to have a list as hiddenfield?

    Of course that it is not possible. A hidden field takes only a single string value:

    <input type="hidden" id="foo" name="foo" value="foo bar" />
    

    So if you need a list you need multiple hidden fields, for each item of the list. And if those items are complex objects you need a hidden field for each property of each item of the list.

    Or a much simpler solution is for this hidden field to represent some unique identifier:

    <input type="hidden" id="filesId" name="filesId" value="123" />
    

    and in your controller action you would use this unique identifier to refetch your collection from wherever you initially got it.

    Yet another possibility is to persist your model into the Session (just mentioning the Session for the completeness of my answer sake, but it’s not something that I would actually recommend using).

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

Sidebar

Related Questions

I have a strong typed partial view of a class that contains a list
Hi, I have a .net class that contains a Boolean, this class is sent
I have a model that contains a collection, such as this: class MyModel {
I have list view with custom row layout (list_row.xml) that contains CheckBox element: <TableLayout
this is my escenary, I Have a class called Plantilla that contains severals propertyes
I have a view that - among other things - contains a list of
I have a view controller class that has to implement several protocols. Too keep
I have a class that extends View. I override the onDraw method and allow
I have a custom-made view that extends the View class. I would like 2
I have the problem that my view controller class has too many delegates and

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.