@using (Ajax.beginform ("Addhomerule", "MyHome", New ajaxoptions
{
HttpMethod = "Post",//Get or Set HTTP request method
Confirm = "OK commit",//Gets or sets the message that is displayed in the confirmation window before the request is submitted
Insertionmode = insertionmode.replace,//insertionmode.insertafter: Insert after element insertionmode.insertbefore before element; Nsertionmode.replace replacing elements
Loadingelementduration = 2000,//Indicates the duration of the animation when an element is loaded or hidden
Loadingelementid = "Loaddingid",//The id attribute of the HTML element to display when the AJAX function is loaded
Onbegin = "Begin",//JavaScript function name that is called immediately before the page is updated
OnComplete = "",//the JavaScript function name to invoke after the corresponding data is instantiated but before the page is updated
OnFailure = "Ajaxerror", the name of the JavaScript function to invoke when the//string type fails on a page call
Updatetargetid = "Rulesubmit",//Gets or sets the ID of the DOM element that is updated with the service response
onsuccess = "Success",//The name of the JavaScript function to invoke after the page is successfully updated
url = ""//Gets or sets the URL to send the request to
}))
{
<div class= "Form-group" >
<label for= "" class= "Control-label" > Rules:</label>
<textarea id= "Txtrule" name= "Hrl_ruleinfo" rows= "5" cols= "" "class=" Form-control "placeholder=" please write the love rules to be specified "> </textarea>
</div>
<div class= "Form-group" >
<label for= "" class= "Control-label" > Punishment:</label>
<textarea id= "Txtpunishe" name= "Hpl_punishmentinfo" rows= "ten" cols= "" class= "Form-control" placeholder= "please write the offending rule , the punishment to be accepted "></textarea>
</div>
<div class= "Form-group" >
<input type= "Submit" value= "OK"/>
</div>
}
Use of Ajax.beginform