Here is the problem Here is the problem I ran into with getting the current instance of the view model.
Here is the problem I ran into with getting the current instance of the view model.
Here is the problem I ran into with getting the current instance of the view model.
ASP.NET MVC: Implementing a generic DropDownList attribute and templating solution
Here is the referenceHere is the reference I used to create the custom ModelMetadataProviderModelMetadataProvider
and custom attributes:
Here is the problemHere is the problem I ran into with getting the current instance of the view model:
Here is my implementation using the resource referenced above. This is a simple version that only uses a List<string>
for the DropDownListDropDownList
. Using this example it would be trivial to use dictionaries and set the text/value properties:
Please let me know what you think of the implementation. I'd be interested to know if anyone has found a more elegant way of achieving this result. I also hope this can help someone who is searching for a solution to this problem.
Thanks!
ASP.NET MVC: Implementing a generic DropDownList attribute and templating solution
Here is the reference I used to create the custom ModelMetadataProvider and custom attributes:
Here is the problem I ran into with getting the current instance of the view model:
Here is my implementation using the resource referenced above. This is a simple version that only uses a List<string>
for the DropDownList. Using this example it would be trivial to use dictionaries and set the text/value properties:
Please let me know what you think of the implementation. I'd be interested to know if anyone has found a more elegant way of achieving this result. I also hope this can help someone who is searching for a solution to this problem.
Thanks!
Implementing a generic DropDownList attribute and templating solution
Here is the reference I used to create the custom ModelMetadataProvider
and custom attributes.
Here is the problem I ran into with getting the current instance of the view model.
Here is my implementation using the resource referenced above. This is a simple version that only uses a List<string>
for the DropDownList
. Using this example it would be trivial to use dictionaries and set the text/value properties:
Please let me know what you think of the implementation. I'd be interested to know if anyone has found a more elegant way of achieving this result.