So I have a panel with 3 DDL, 2 TextBoxes, a Cancel
button and an Apply
button. I want my button work this way:
When I click it, I want it to take the data from 3 DDL and 2 TextBoxes and build a model, send it to my controller/function and refresh the gridview .
But the function also has to check there is no duplicate entries.
So if that function returns a partial view, in case the entry I am adding is duplicated, how can I show a message to display the error?
button:
<button id="btnAddUpdateConfig" name="btnAddUpdateConfig" value="Apply" onclick="ValidateValues()">Apply</button>
My problem also comes before that; how can I send the values to the controller function? Is there a way to call a controller method passing values from the button? But that method will have to refresh the gridview if the item is added or show and error if it is not.
If I want to do it from JS, how can I do the same? I just know Ajax.ActionLink and that creates a link when I just want to call a controller method.