Questions tagged [asp.net-mvc-ajax]
117 questions
94
votes
15 answers
How to get an ASP.NET MVC Ajax response to redirect to new page instead of inserting view into UpdateTargetId?
I am using the Ajax.BeginForm to create a form the will do an ajax postback to a certain controller action and then if the action is successful, the user should get redirected to another page (if the action fails then a status message gets displayed…

Jeff Widmer
- 4,746
- 6
- 37
- 51
34
votes
2 answers
Why does setting UnobtrusiveJavaScriptEnabled = true prevent ajax from working?
While doing a sample using MVC3 razor, I wrote:
Show me the time in: @Ajax.ActionLink("UTC", "GetTime", new { zone = "utc" }, new AjaxOptions { UpdateTargetId = "myResults" }) @Ajax.ActionLink("BST", "GetTime", new { zone = "bst" },…

Amr Elgarhy
- 66,568
- 69
- 184
- 301
7
votes
2 answers
Add a css class for Ajax Action link
How I can add a class for Ajax.ActionLink?
@Ajax.ActionLink("Remove this photo","RemovePhoto","Admin",new{Id=Model.filename, @class="ActionClass"},new AjaxOptions{OnSuccess = "RemoveSuccess"})
but this method don't create css class for this…

SirRoland
- 187
- 2
- 2
- 10
6
votes
2 answers
Is there a good explanation on what ASP.NET MVC3 is doing with its ajax helpers and rendering unobtrusive javascript?
I'm trying to look for good (in-depth) explanation on what happens when you use MVC ajax helpers. What events and css classes get added. I can find sprinkle of info here and there but no overall explanation of how this ajax framework works. Is…

dev.e.loper
- 35,446
- 76
- 161
- 247
6
votes
2 answers
asp.net mvc ajax post - redirecttoaction not working
I used the following code in one of my controller;
if (Request.IsAjaxRequest()) {
return RedirectToAction("PreviewAndSendEmail");
}
I debugged it and it comes to return line and but redirect didn't occur. Is it…

tugberk
- 57,477
- 67
- 243
- 335
5
votes
2 answers
How to open a new popup window by clicking an html action link in MVC?
I've a view page in which there's an HTML ActionLink. Now on click of that action link, i want to open a new popup window without closing the previous one. In this new popup window i want to show my existing view page. please provide me a better…

SRV
- 51
- 1
- 1
- 2
5
votes
2 answers
using ajax with dropdownlist mvc3
Is there any way to refresh some part of page (e.g div/span) on selection of dropdownlist option ... ?? Please note I'm using razor syntax.
If yes, then please give some sample code.

Milan Mendpara
- 3,091
- 4
- 40
- 60
5
votes
1 answer
The partial view 'First.cshtml' was not found or no view engine supports the searched locations
I'm trying to call partial view in div on click. I've written this:
@Ajax.ActionLink("Second", "Second", new AjaxOptions()
{
HttpMethod = "GET",
UpdateTargetId = "partials",
InsertionMode = InsertionMode.Replace
})

gsiradze
- 4,583
- 15
- 64
- 111
5
votes
2 answers
MVC 4 - Ajax - Replace one partial one view with another
I'm trying to replace the contents of a div in a Main view with partial views depending on which @Ajax.ActionLink is clicked.
Initally I load the _CaseLoad partial view then I would like to be able to switch between the two partial views _CaseLoad…

James P
- 2,201
- 2
- 20
- 30
4
votes
1 answer
use @Ajax.ActionLink to popup a form
i want to use @Ajax.ActionLink to popup a form so i did this in my cshtml page :
@Ajax.ActionLink("click ", "AddToMembers", new AjaxOptions { HttpMethod = "GET", UpdateTargetId = "result", InsertionMode = InsertionMode.Replace, OnSuccess =…

MHF
- 511
- 8
- 22
4
votes
2 answers
Ajax.BeginForm check if request was redirected
How to determine if async request form ajax form was redirected?
In my case request is redirected to login page if user's session is closed.
I tried to check arguments of OnComplete, OnSuccess and OnBegin events (OnFailure is not called) but no one…

Serhiy
- 4,357
- 5
- 37
- 53
4
votes
2 answers
How to call partial view through ajax in mvc3
I need to call a partial view through ajax. I have tried the following, but I am not sure how to complete it.
$("#UserName").change(function () {
var userid = $("#UserName").val();
var ProvincialStateID = $("#State").val();
…

MVC_Nhibernate
- 447
- 11
- 30
3
votes
1 answer
get value of last appended textbox asp.net mvc
if I'll click to add date begin_date and end_date will added to my view. At start I have only 1 begin and end date. dates are added using this:
$(document).ready(function () {
var str = '
' +
…

gsiradze
- 4,583
- 15
- 64
- 111
3
votes
0 answers
post serialise form pass null value to my controller
I am serialising my form and post it via javascript function
3
votes
2 answers
Returning partial view and error response together
I have a situation whereby I need to return an exception to the client in the form of a partial view. Here is my code
catch(PasswordException ex)
{
Response.StatusCode = 500;
ViewBag.Message =…

heymega
- 9,215
- 8
- 42
- 61