Add a dropdown for a field not in the model (asp.net mvc)

后端 未结 1 554
暖寄归人
暖寄归人 2021-01-27 17:05

I am using Active Directory Authentication Library to create users and list them. I have a view and controller action to do this.

However please review the MODEL of the

相关标签:
1条回答
  • 2021-01-27 17:37

    You can always add a key-value pair list property to your view model. And you can extend that list as your users add extended properties to your AD entity. Your list can start as an empty collection when you pass to your view. Then in your view, you iterate through the items in your collection to show each key-value pair in a list type display.

    Your controller can have a method that serves a partial view of your key-value pair entry (ie, partial view with two input: one for the property name and one for the value), so when a user clicks the button on your view to add a new extended property, you call that controller method to give you a rendering of the input fields.

    0 讨论(0)
提交回复
热议问题