-2

I have a question about the design of the form that is automatically generated. Can I modify the CSS behind and where ? the problem is maybe easy but I am beginner so be comprehensive :)

Also what I want to do, is when the user fill the form and send it, that he will be able to see the last records that have the same first property of my model (ClientID) when filling the next records.
I know there is the partial view but how can I implement it ?

Thank you for your help!

Best regards,

nabs
  • 51
  • 1
  • 6

1 Answers1

1

have a question about the design of the form that is automatically generated. Can I modify the CSS behind and where ? the problem is maybe easy but I am beginner so be comprehensive :)

You Modifiy the CSS just like a normal website. By default this is in your Content folder labeled 'Site.css'

The second part of the question is too broad to answer well. Please update the question with methods you have tried and some code.

Partial views enables you to define a view that will be rendered inside a parent view. After the site is rendered they become one HTML. Just a way for you to separate and reuse your view.

The pseudo idea would you to

  1. Retrieve records var matchingRecords = Records.Where(x => x.ClientID == ClientID)
  2. Store records to a viewModel var viewModel = new yourViewModel{Records = matchingRecords}
  3. Pass your viewModel to your view
  4. Have your partial view also inherit that viewModel (or interface of viewModel with records) and have it loop over said records and do what you need

Again this is very broad because your question is broad. In general it is best to supply code with your question and be specific. Also show what you have tried.

PaulBinder
  • 2,022
  • 1
  • 16
  • 26
  • thank you very much, but what I don't understand is specially that concept of viewModel how can I pass it to my view ? I know that I have to give code but for this question I did not know how to begin sorry about that. I just have my form to create references of Clients but it is not useful I think. – nabs Aug 15 '14 at 13:50
  • 1
    http://stackoverflow.com/questions/16548376/asp-net-mvc-how-exactly-to-use-view-models Good summary and example of viewModels – PaulBinder Aug 15 '14 at 13:56