I dynamically change DOM on client-side to add some new input fields using JavaScript.
Can I obtain the data on the server-side without using Ajax? Just pushing send but
If you're posting the form, sure. You can use either the FormCollection to get the element you want, or explicitly identify the parameter in your method signature. Assume you added an input element with the name "myTextBox", you could do the following:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Edit(int id, string myTextBox, FormCollection collection) {
// better
if (myTextBox != null) {
// do something with the string
}
// good
if (collection["myTextBox"] != null) {
string textboxvalue = collection["myTextBox"].ToString();
}
}
You need to add "name" attribute to the control, so the data will be sent to the server on form submit.
ANSWER IS HERE: http://habrahabr.ru/blogs/aspnet_mvc/88766/, Don't pay attention to language, look code samples