Questions tagged [ajax.beginform]

Writes an opening

tag to the response.

You can use this method in a using block. In that case, the method renders the closing tag at the end of the using block. The form is submitted asynchronously by using JavaScript.

For more detail click here

242 questions
59
votes
3 answers

How to use Simple Ajax Beginform in Asp.net MVC 4?

I am new in Asp.net MVC and i researched about Ajax.BeginForm but when i apply codes it did not work. Can you share very simple example with Ajax.Beginform with View, Controller, Model? Thanks.
Soner
  • 1,220
  • 3
  • 14
  • 37
37
votes
3 answers

Ajax.BeginForm in MVC to upload files

I was trying to use an example mentioned here How to do a ASP.NET MVC Ajax form post with multipart/form-data? But I keep getting "fail" error message box Index.cshtml
Alexander C.
  • 1,140
  • 4
  • 15
  • 29
22
votes
7 answers

How do you submit a dropdownlist in asp.net mvc from an Ajax form

How do you submit from a dropdownlist "onchange" event from inside of an ajax form? According to the following question: How do you submit a dropdownlist in asp.net mvc, from inside of an Html.BeginFrom you can set onchange="this.form.submit" and…
Gene
16
votes
3 answers

ASP.NET AJAX.BeginForm sends multiple requests

Im relatevely new with Asp.net MVC3, I have a form handled with Ajax, like this: @using (Ajax.BeginForm("dtjson", new AjaxOptions { HttpMethod = "Post", UpdateTargetId = "detalle_tarifa", OnSuccess = "exito2", OnBegin="bloquear" })) My problem is…
mleger45
  • 337
  • 1
  • 2
  • 10
16
votes
2 answers

asp.net mvc Ajax.BeginForm

I'm having some difficulties with Ajax.BeginForm I have something like this in a view <% using (Ajax.BeginForm("ActionName", null , null, new { id = "FormName" })) {%>
Bala R
  • 101,930
  • 22
  • 186
  • 204
14
votes
2 answers

Asp.Net MVC Ajax.BeginForm is not submitting via Ajax

I've got my form as follows
Chase Florell
  • 42,985
  • 56
  • 169
  • 364
14
votes
12 answers

MVC4 Ajax.BeginForm not replacing UpdateTargetId

There are so many topics on SO about issues with the Ajax.BeginForm not correctly updating the target element with the return partial view: mvc4 ajax updating same page ASP.NET MVC 4 - Ajax.BeginForm and html5 MVC 4 (razor) - Controller is returning…
drovani
  • 890
  • 1
  • 19
  • 36
13
votes
3 answers

JQuery and Ajax.BeginForm() posting same data twice

Ok I'm a total web newbie but I must admit I'm totally hooked now. Here's my problem: I have a page with an MVCContrib grid and a "Add Accounts" link that brings up an Ajax form wrapped in a JQuery dialog. When I go through the workflow the first…
dalcantara
  • 1,573
  • 2
  • 20
  • 34
12
votes
3 answers

How to display error message only in OnFailure of Ajax.BeginForm in MVC3?

I have this simple ajax form in my MVC3 app, that sends email message: @using (Ajax.BeginForm("SendMessage", new AjaxOptions { LoadingElementId = "wait", OnSuccess = "loadMessages", OnFailure = "showError" })) {
monstro
  • 5,117
  • 7
  • 53
  • 94
12
votes
1 answer

Ajax.BeginForm with OnBegin prevent action to be called

I am using Ajax.Begin Form in my MVC 3 + Razor application using (Ajax.BeginForm("ActionName", "ControllerName", new AjaxOptions { OnBegin = "ValidateDateFunction('" + @abc.xyz + "')", HttpMethod = "POST", UpdateTargetId = "savebutton" })) { …
Yasser Shaikh
  • 44,064
  • 44
  • 190
  • 271
10
votes
4 answers

Ajax.BeginForm OnSuccess not firing

I'm using this partial view @model CreateConfigEntityModel
@using (Ajax.BeginForm("AddElement", "MerchantSites", new { merchantId = @Model.MerchantId }, new AjaxOptions { HttpMethod = "POST", OnSuccess = "alert('ok')" }, new {…
ThunderDev
  • 976
  • 2
  • 14
  • 36
9
votes
1 answer

ASP.Net MVC 3.0 Ajax.BeginForm is redirecting to a Page?

In ASP.Net MVC 3.0 i am using a Ajax.Beginform and hitting a JsonResult on success of the form i am calling a jQuery Function. but for some reason my form is redirecting to JsonAction my View @using (Ajax.BeginForm("ActionName", "Controller", null,…
HaBo
  • 12,509
  • 34
  • 102
  • 191
9
votes
1 answer

Ajax.BeginForm - Displaying Validation Errors

Using the MVC project template in VS2008 (out of the box) I noticed the following: Here is how the Register.aspx form is specified. <% using (Html.BeginForm()) { %> Selecting the Register button without supplying any account info shows this. …
A. Elliott
  • 91
  • 1
  • 1
  • 2
8
votes
2 answers

RedirectToAction with Ajax.Beginform , unexpected results

I have the following view , which contains an Ajax.BeginForm:- @using (Ajax.BeginForm("ChangeDevicesSwitch", "Switch", new AjaxOptions { InsertionMode = InsertionMode.InsertBefore, UpdateTargetId = "result", LoadingElementId =…
john Gu
  • 10,469
  • 55
  • 189
  • 381
7
votes
2 answers

MVC Ajax.BeginForm Replace strange behaviour

In a partial view, I am using MVCs Ajax.Beginform like followed:
@using (Ajax.BeginForm("Action", "Controller, new AjaxOptions { …
iappwebdev
  • 5,778
  • 1
  • 28
  • 45
1
2 3
16 17