asp.net mvc - Jquery .append() & Html.Helper -


is there way put html.helper inside .append() function.

success: function (html) { $("#resultaatsgebied").append(' <li>@html.textboxfor(item => model.rg1)<ul id="concretisering" class="sublist"><li>@html.textboxfor(item => model.rg1sub1)</li></ul>@html.actionlink("+", "index", null, new { id = "addconcretisering" })</li>'); } 

this works, string, not control

edit:

this works now, actionlink generated not. have same actionlink default in view, , there works. generated one, think not execute ajax call?

if code in razor view, can put brackets razor code :

success: function (html) {      $("#resultaatsgebied").append(' <li>@(html.textboxfor(item => model.rg1))<ul id="concretisering" class="sublist"><li>@(html.textboxfor(item => model.rg1sub1))</li></ul>@(html.actionlink("+", "index", null, new { id = "addconcretisering" }))</li>');  } 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -