2

I need to create editors for model properties through ajax calls. Similar to this http://www.mattlunn.me.uk/blog/2014/08/how-to-dynamically-via-ajax-add-new-items-to-a-bound-list-model-in-asp-mvc-net/

Please see the htmlHelperExtension in the above article. How can I create a similar extension in mvc 6 ?

Eilon
  • 25,582
  • 3
  • 84
  • 102
eadam
  • 23,151
  • 18
  • 48
  • 71
  • 1
    I have edited your title. Please see, "[Should questions include “tags” in their titles?](http://meta.stackexchange.com/questions/19190/)", where the consensus is "no, they should not". – John Saunders Jan 13 '15 at 13:44

3 Answers3

0

I suppose you have to start to look to asp.net tag helpers.

https://github.com/DamianEdwards/TagHelperStarterWeb
this is the version of the starter web site developer using tag helpers.

Luca Morelli
  • 2,530
  • 3
  • 28
  • 45
0

You may want to check the answer in Question

What you need to do is use DefaultHtmlGenrator injected to the controller to generate your editors.

Community
  • 1
  • 1
Helen Araya
  • 1,886
  • 3
  • 28
  • 54
0

You can get HtmlHelper using Dependency Injection to your controller constructor.

Check my Answer for more detailed code.

Community
  • 1
  • 1
Helen Araya
  • 1,886
  • 3
  • 28
  • 54