ViewModel with a list of selectlists [closed] - c#

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
How do i create a ViewModel that consist of a list of SelectLists populated by DB?

You can create a View Model that contains properties with the various data needed for the select lists. Populate those properties in your controller action, and then use that View Model as your view's strongly-typed model.

Related

Should Dto contains full information of reference object? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
Let assume I have two entities are Order and Customer. So OrderDto should have CustomerId prop or full Customer object. The same with CustomerDto, should they have full list Order object or just a list of OrderId?
I think that it depends what you're using it for. The DTO should be specific to the needs of the api, not the Entities. For example if you're creating an order, you don't need to modify any properties of the customer. You shouldn't include the full customer details, just the CustomerId.

get information from a form in partial view [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am a new developer
I want to store the form information Which is located inside the partial view to my data base.
Can this be done like a regular view with a razor? There is no need to do anything special...?
No need to do anything special zahra, just call your partial view in your razor view, by using form or ajax call, you can send the form data to mvc controller and from there you can store the data in your Database

Best practise of inheritance model from parent asp.net page with examples [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm new in asp.net. How to pass model from Main page and work with it in my partialview. Can somone show me how to do it with examples and explanation.
You can render PartialView like this example with passing model as a parameter.
#Html.Partial("YourPartialView.cshtml", model)
In your PartialView (YourPartialView.cshtml) you should define your model for the PartialView like this
#model ClassForYourModel
From now, you can use your models attributes as follows.
#model.Attribute1
#model.Attribute2
Example

State view and application view asp.net c# [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Can you give some links whit, code examples, what is State view and application view for beginners to better understand ?
http://www.w3schools.com/aspnet/aspnet_viewstate.asp
http://asp.net-tutorials.com/state/viewstate/

A list of active views in prism [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Doez prism assign any unique identifier/guid maintained for each view ?
Perhaps in tracking any references etc?
Prism doesn't do it. But you can do it easily if needed. However, I learned that you don't need to do this if you properly use navigation and navigation parameters.

Categories

Resources