Dear Experts,
I am following [Mr.Steve Sanderson Example][1] for working with variable length list, ASP.NET MVC 2-style.
The code Below is adding New Items perfectly when we click on “Add More” hyperlink: –
I want instead of click on “Add More”, make a function which do same as $("#addItem").click is doing and I call that function in my routine.
Can some one please guide me how can I do this?
Controller Code: –
public ViewResult BlankEditorRow(string formId)
{
return new AjaxViewResult("ChequeDetail", new cheques()) { UpdateValidationForFormId = formId };
}
View Code: –
<%= Html.ActionLink("Add More", "BlankEditorRow", new { ViewContext.FormContext.FormId }, new { id = "addItem" }) %>
JQuery : –
$("#addItem").click(function() {
$.ajax({
url: this.href,
cache: false,
success: function (html) {
$("#editorRows").append(html);
}
});
return false;
});
I get it work with this line of code: –
Sorry if I was not expressed my question clearly.