this is my UI code in which i have multiple text fileds that i add dynmically from add rows button
<div class="col-md-12">
<div class="col-md-8" style="float:left;overflow-y: auto;height:260px;">
<div class="text-right" style="margin-bottom:10px;">
<input type="button" class="btn btn-primary" value='Add Row' id='addButton' />
<input type="button" class="btn btn-default" value='Remove Row' id='removeButton'>
</div>
<div id='TextBoxesGroup'>
<div id="TextBoxDiv1">
<div class="col-md-12">
<div class="col-md-6 form-group">
<label class="control-label col-md-2">Key</label>
<div class="col-md-10">
<input type='text' id='key1' class="form-control">
</div>
</div>
<div class="col-md-6 form-group">
<label class="control-label col-md-2">Value</label>
<div class="col-md-10">
<input type="text" id="value1" class="form-control" />
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4" style="top:40px;">
PLEASE PASTE DATE HERE:
<textarea style="width:340px;height:200px;margin-bottom:20px;"></textarea>
</div>
</div>
I want to bind this values to dictionary using javascript
var specList = [];
for (var i = 1; i < counter; i++) {
var _key = $("#key" + i).val();
var _value = $("#value" + i).val();
specList.push({
key: _key,
value: _value
});
alert(specList['key']);
}
than i want to append using formData Like this
var formdata = new FormData($('#formAddProduct').get(0));
formdata.append('prodSpecification', JSON.stringify(specList));
than I want to get on controller action
Here is my model code
public Dictionary<string,string> prodSpecification { get; set; }
I am stuck here from almost one month I will be very thankful if some one give me good answer