MVC :: Ajax Call Causing RedirectToAction/ValidationSummary To Fail?

Jul 26, 2010

I think ive narrowed down my problem, I have a form but the "submit" buttons are being handled by Javascript - since i need to build arrays manually outside of the model for processing

[Code]....

I'm calling the Controller Action "Update" and passing it to string Arrays, when its finished - i want it to redirect to another action - it doesnt.

[Code]....

I just really wanna construct those arrays, and pass them to a controller...i think the ajax is waiting on a result and ignoring the redirect.

View 1 Replies


Similar Messages:

MVC2 And MVC Futures Causing RedirectToAction?

Apr 12, 2010

I've been trying to get the strongly typed version of RedirectToAction from the MVC Futures project to work, but I've been getting no where. Below are the steps I've followed, and the errors I've encountered.

I created a new MVC2 app and changed the About action on the HomeController to redirect to the Index page.

Return RedirectToAction("Index")

However, I wanted to use the strongly typed extensions, so I downloaded the MVC Futures from CodePlex and added a reference to Microsoft.Web.Mvc to my project.

I addded the following "import" statement to the top of HomeContoller.vb

Imports Microsoft.Web.Mvc

I commented out the above RedirectToAction and added the following line:

Return RedirectToAction(Of HomeController)(Function(c) c.Index())

So far, so good. However, I noticed if I uncomment out the first (non Generic) RedirectToAction, it was now causing the following compile error:

Error 1 Overload resolution failed because no accessible 'RedirectToAction' can be called with these arguments:
Extension method 'Public Function RedirectToAction(Of TController)(action As System.Linq.Expressions.Expression(Of System.Action(Of TController))) As System.Web.Mvc.RedirectToRouteResult' defined in 'Microsoft.Web.Mvc.ControllerExtensions': Data type(s) of the type parameter(s) cannot be >inferred from these arguments. Specifying the data type(s) explicitly might correct this error.
Extension method 'Public Function RedirectToAction(action As System.Linq.Expressions.Expression(Of System.Action(Of HomeController))) As System.Web.Mvc.RedirectToRouteResult' defined in 'Microsoft.Web.Mvc.ControllerExtensions': Value of type 'String' cannot be converted to 'System.Linq.Expressions.Expression(Of System.Action(Of mvc2test1.HomeController))'.

Even though intelli-sense was showing 8 overloads (the original 6 non-generic overloads, plus the 2 new generic overloads from the Futures assembly), it seems when trying to complie the code, the compiler would only 'find' the 2 non-gneneric extension methods from the Futures assessmbly.

I thought this might be an issue that I was using conflicting versions of the MVC2 assembly, and the futures assembly, so I added MvcDiaganotics.aspx from the Futures download to my project and everytyhing looked correct:

ASP.NET MVC Assembly Information (System.Web.Mvc.dll)

Assembly version: ASP.NET MVC 2 RTM (2.0.50217.0)
Full name: System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Code base: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Web.Mvc/2.0.0.0__31bf3856ad364e35/System.Web.Mvc.dll
Deployment: GAC-deployed

ASP.NET MVC Futures Assembly Information (Microsoft.Web.Mvc.dll)

Assembly version: ASP.NET MVC 2 RTM Futures (2.0.50217.0)
Full name: Microsoft.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null
Code base: file:///xxxx/bin/Microsoft.Web.Mvc.DLL
Deployment: bin-deployed

This is driving me crazy! Becuase I thought this might be some VB issue, I created a new MVC2 project using C# and tried the same as above.

I added the following "using" statement to the top of HomeController.cs

using Microsoft.Web.Mvc;

This time, in the About action method, I could only manage to call the non-generic RedirectToAction by typing the full commmand as follows:

return Microsoft.Web.Mvc.ControllerExtensions.RedirectToAction<HomeController>(this, c => c.Index());

Even though I had a "using" statement at the top of the class, if I tried to call the non-generic RedirectToAction as follows:

return RedirectToAction<HomeController>(c => c.Index());

I would get the following compile error:

Error 1 The non-generic method 'System.Web.Mvc.Controller.RedirectToAction(string)' cannot be used with type arguments

What gives? It's not like I'm trying to do anything out of the ordinary.It's a simple vanilla MVC2 project with only a reference to the Futures assembly.

I'm hoping that I've missed out something obvious, but I've been scratching my head for too long, so I figured I'd seek some assisstance.

If anyone's managed to get this simple scenario working (in VB and/or C#)

View 1 Replies

What Is Causing Error On Ajax Call

Jun 21, 2010

I can't figure out why I might be getting this error. It happens on an ajax call.This is the full error text:

-- 6/21/2010 6:09:10 PM -- System.Web.HttpException (0x80004005): Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerWrapper'. ---> System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Web.HttpException (0x80004005): OutputStream is not available when a custom TextWriter is used.
at System.Web.HttpResponse.get_OutputStream()
at AjaxControlToolkit.ToolkitScriptManager.OutputCombinedScriptFile(HttpContext context) in C:AjaxBuildAjaxServerAjaxControlToolkitToolkitScriptManagerToolkitScriptManager.cs:line 286
at AjaxControlToolkit.ToolkitScriptManager.OnInit(EventArgs e) in C:AjaxBuildAjaxServerAjaxControlToolkitToolkitScriptManagerToolkitScriptManager.cs:line 246
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.Mvc.ViewPage.ProcessRequest(HttpContext context).......................

View 2 Replies

Configuration :: Error Handling Strategy For Exceptions Causing Page Request Fail?

Nov 1, 2010

I have been tasked with implementing a strategy to catch all errors in an ASP.net application which cause a user request or interaction to crash and then e-mailk this exception to a support team in advance of a user calling about the error.Some errors however are not causing the page to crash or be redirected to the custom error page but these are being emailed to the support team instead of simply being loggedMy requirement is to seperate what exception types will cause a page fail and which will not.Example I am currently receiving a System.Web.HttpUnHandledException which is not causing any page to fall over and therefore is not of relevance to the support team. this can be logged but does not require emailing.

View 1 Replies

Forms Data Controls :: Manual Call On ObjectDataSource Causing Multiple Updates

Dec 14, 2010

I have GridView that is bound to an ObjectDataSource and within that GridView I have CheckBox, DropDownList, TextBox and Label controls. All the controls except the CheckBoxs are working like a champ or normal display and Delete (Insert is handled outside the GridView, it works also). The CheckBox values are passed into the update method for the ObjectDataSource as type byte. Without doing any custom coding the CheckBoxs were always unchecked (regardless of the data being 1 or 0) and when I edit a row in the GridView and saved the values the CheckBox controls would always be 0 even if the check boxes where checked. After searching web I found a suggestion to change the binding on the CheckBox controls from, Bind("Monday") to this, CheckUncheck(DataBinder.Eval(Container.DataItem, "Monday")) with CheckUncheck being a method to make 0 or null = false and 1 = true. This seemed to the do the trick and it set the CheckBoxs correctly in the DataGrid, I was giving myself high-fives, until I tried to update a row.

When doing the update, as with my first attempt, it would always set the CheckBox values to 0, thus ignoring the checked property of the CheckBox. So I search the web again and found a suggestion to handle the update manually, due to the binding being one way. So I created a myUnhappyGrid_RowUpdating event handler and changed all the columns in the GridView to template so I could do the old school .FindControl on them and grab the values. Once I was able to grab the values from the row to be updated I added them to the ObjectDataSource .UpdateParameters and called ObjectDataSource.Update() and it worked, kind of. Now came the next trial, it did the update into the database just fine and I was happy, until. I finished stepping though the code. As I stepped through the code the update on the ObjectDataSource got called two more times, thus undoing what I had just spent hours fixing. First, is the road traveled the right way to do it? Second, if I am on the correct road how can I suppress the additional two updates that follow my manual .update call on the ObjectDataSource?

View 6 Replies

AJAX :: Validationsummary In ModalPopUpExtender?

Mar 20, 2010

I have ValidationSummary in masterpage out of UpdatePanel and inside updatePanel i have my ContentPanel. I have an user control where iam having Save button which iam using in all my pages of application. Now i have a requirement like i need to show the validation summary in ModalPopUpExtender.

View 1 Replies

MVC :: AJAX.BeginForm And Html.ValidationSummary?

Mar 22, 2010

I am trying to make an AJAX Form work correctly with Client Validation, but I can't seem to figure out how to make it work together.Currently I have a view like this:

[Code]....

My model:

[Code]....

The client validation works on the Required and Stringlength attributes, but if I put an incorrectly formatted email, it still returns successful. Is there a special way to do the regular expression attribute? Or am I doing it wrong?

View 8 Replies

AJAX :: ModalPopupExtender Fail When Using SSL?

Jul 15, 2010

Am using ModalPopupExtender (In VS 2005 ). But it doesnot showing it when i use in SSL.

View 2 Replies

AJAX :: UseHttpGet Causes PageMethod To Fail?

May 30, 2010

I have a PageMethod that works perfectly well when it either (a) running in the VS dev server, or (b) deployed but marked with UseHttpGet=false.

What doesn't work, and is driving me mad, is having UseHttpGet=true and then deploying it to a test server (Vista & IIS7). It fails to call through the proxy with error code 404 coming back. But it works find if I set UseHttpGet=false.

I have gone through all of the basic stuff I can think to check, and as noted it works perfectly well on the dev box. So there must be something particular about full-blown IIS7 and its config that I am missing..

anything to check in the IIS manager that would cause this to fail? I've tried with forms authentication enabled and disabled, as a few posts mentioned issues with that.

View 1 Replies

Security :: Fail To Log Out When Using Ajax For Adding Controls

Sep 30, 2010

My masterpage has a loginStatus control to let users log out and it works very well on normal pages .Recently, I created a new content page associated with the mentioned master page. Such new page allows users to add textboxes dynamically through ajax asycpostback.
Unfortunately, loginstatus right now fails to work when i click it. I traced the process and i found out that the loggingout event was not fired when i click it.

I follow this video to make such "Dynamically add control" page.

http://www.asp.net/ajax/videos/how-to-dynamically-add-controls-to-a-web-page

View 2 Replies

AJAX :: WebResource Fail To Work Under Reverse Proxy?

Jul 19, 2010

We have an issue when our web application runs under reverse proxy.

The reverse proxy change the URL for the website from for example: "http://TestWebApp/" to: "http://ProxyDomain/Test/" when it runs under reverse proxy which is mapped to "http://TestWebApp/" and rout requests to it.

This raise an issue of root relative paths (paths that start with "/" to be relative to the root of the web application i.e. "/Folder1/Test.aspx"). Generally all paths that need to be rendered to client we use ResolveClientUrl method and all is good.

When using Ajax controls and ScriptManager WebResource.axd paths are rendered in script tags as a relative url paths ("/WebResource.axd?blablabla") because the root under reverse proxy is the proxy domain itself the path is useless - the web resouce is not downloaded and the application break.

To fix this we tried to set a Response.Filter in OnPreRender event handler of our base page. In our custom filter we use Regex to search and replace all "/WebResource.axd" occurences with the resolved to client root path using the ResolveClientUrl method of the page. This works great and the web resources are downloaded to client.

But this is not the end of our troubles.

In Ajax requests the response output is fixed as described but when recieved at the client end it is not valid and the partial update fails with Sys.WebForms.PageRequestManagerParserErrorException.

It fails to parse the response because the rendered response have numbers that states the actual count of bytes per rendered component (which includes the script tags referencing the WebResource.axd). The client reciever validates the recieved response according to the numbers, but, our filter altered the response so the numbers are not correct and the response validation fails.

We can try and code a smart filter that parse the response and recalculate the numbers according to the ammount of paths fixed, but I hope there is an elegant and better solution for this.

View 3 Replies

AJAX :: Using Visual Web Developer, Register Statements Fail?

Jan 20, 2010

I installed Visual Web Developer 2010 (beta) and then I wanted to use ajax, so I downloaded and unzipped the AjaxControlToolkit.dll into a folder called c:AjaxControlKit. I added a tab to the toolbox, and I used 'choose items' to access the dll. This populated the toolbox with Ajax controls. Another thing it apparently does automatically is add the following statement to every aspx page:

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

View 1 Replies

AJAX :: MultiHandleSliderExtender Not Causing Event Trigger?

Feb 4, 2010

I created a MultiHandleSliderExtender on a web form. All works well with updating the two textboxes with the value. The problem is that when I switch to designer mode, I get the following error:

The code is as follows:

[Code]....

[Code]....

[Code]....

The control works and the 2 text boxes get updated, but I tried putting in an update panel with a trigger on mh_1_BoundControl but it never fired. I removed it thinking that was the cause of the error, but no luck.

Now when I add another sliderextender below it for a different value, the code throws an error:

Microsoft JScript runtime error: Sys.InvalidOperationException: Type AjaxControlToolkit.SliderOrientation has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update.

I found this example on this site and tried implementing it but to no avail.

View 1 Replies

AJAX :: Hidden Elements Causing Flicker?

Jul 2, 2010

I have a grid which houses a modal popup panel. When the grid binds it gives a flicker. The modal popup panel becomes visible for a second and then hides in the grid. Is there a way I can avoid this from happening.

View 1 Replies

Ajax Calls Within <table> Tag Causing Error?

Jan 12, 2011

Ajax calls within <table> tag causing error.

htmlfile: Unknown runtime error

I am pasting here full code to produce error. Please help me to sort it out.This is my code for .aspx file. Paste it in new .aspx file inside form tag.

[Code].... And this is code behind file code. Paste it inside .aspx.cs public partial class.

[Code]....

View 5 Replies

AJAX :: NumericUpDownExtenders Causing RequiredFieldValidators To Validate?

Mar 8, 2010

I have a page that has a few NumericUpDownExtenders, and the same page has some validation like RequiredFieldValidators. The problem is that when you click either of the arrows for any of the NumericUpDownExtenders, it's causing the page to try to validate. This ia making all the "required" boxes for every required field on the page pop up as if you just tried to submit an empty form.If you don't touch the NumericUpDownExtenders, then the page works exactly as intended. The "required" boxes only pop up if you've gone into one of the required fields, typed something, deleted it, and put the focus in another field.How do I fix the NumericUpDownExtenders to make them stop causing the validation?

View 2 Replies

AJAX :: Timer Causing Dashboard Reload?

Jan 26, 2011

I have a dashboard made of multiple webparts. One of the webpart is a usercontrol with a timer wrapped in UpdatePanel. When it is loaded in the dashboard I notice that it causes a Page_Load, and that triggers personalization procedures aspnet_PersonalizationAllUsers_GetPageSettings and aspnet_PersonalizationPerUser_GetPageSettings to fire.

Can can I avoid that? I read many posts on Timer controls within UpdatePanels, and it is my understanding that Timer would cause a full page postback, but only render the UpdatePanel that it is part of. However, these personalization functions execute every time Timer ticks.

View 1 Replies

Ajax TabContainer Causing Browser To Close Automatically?

Feb 25, 2010

am trying to fix an issue. I have an ASP.NET Ajax's TabContainer on the page. And each tab there is a gridview control that gets binded onload. However for some reason the browser gets closed automatically after the page renders. If I remove the TabContainer then it works fine. I think the binding code will no way effect the browser to close bacause no where in my code I am registering any Script block.Also one notable thing is this happens only in IE 8. It works fine in firefox and other browsers.I don't know if anyone encountered a similar issue before.

View 1 Replies

AJAX :: MaskedEditExtender And MaskedEditValidator Causing Refresh/postback?

Sep 7, 2010

I have the following tabpanel (it actually contains a bit more content, but that content doesnt influence my issue):

[code]....

When I remote the MaskedEditExtender and MaskedEditValidator, it doesnt show that (undesired) behaviour anymore.Is there something special these controls do that cause them to refresh? Is there a workaround for this?

View 1 Replies

AJAX :: Update Panel Causing Complete Postback?

Jan 1, 2010

Below is the sample code on using the update panel. The page just has a button and a label. On button click it updates the label with the server time. Though the label is inside the update panel the page goes for a complete postback. in understanding why it is behaving like that. I tried the options of Updatemode, using different script references nothing seems working for this simple application.

-- aspx page
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

View 2 Replies

AJAX :: Tab Panels Causing Undesirable Mark-up Reformatting?

Sep 15, 2010

I am using VS 2010 and making extensive use of tab panels with gridviews inside of each. I very often am required to reformat the whole document as it seems that the gridview mark-up gets completely reformatted in one continuous line. In the act of reformatting unwanted things get inserted such as linebreaks. When I was using VS 2008 this behavior was even worse. Does anyone have a suggestion to fixing this issue? I am wasting time because things are changing visually and tested work is getting automatically changed.

View 4 Replies

AJAX :: Update Panel Causing Unwanted Viewstate?

Jan 5, 2010

I have a gridview which has a checkbox column which are set to automatically postback. When a checkbox is clicked, a partial postback occurs, and the associated record is displayed to the user (this is the required function).My problem is regarding when a user clicks a number of checkboxes in quick succession. I have got ajax request queuing working fine, so each checkbox postback is eventually dealt with. However as the gridview also postsback, it resets its viewstate on which boxes are checked, removing some of the boxes which the user may have checked.I've attempted to take off the viewstate on the gridview which seems to achieve nothing, neither does placing the gridview in a separate update panel.

View 1 Replies

AJAX :: Greater Than Symbol Causing Internal Server Error 500?

Feb 8, 2011

If a user enters "<" or if it already exists in a textbox inside an update panel, I am getting "internal server error 500" during post back. I believe the page suspects a HTML injection and is attempting to stop it. I could use Page.EnableEventValidation to avoid it but I really don't want to do that. Is there any other way, I could resolve it (like replace < with > or something like that)?

Update:

This is happening in a textbox inside a gridView.

[Code]....

View 2 Replies

AJAX :: How To Update The Information Without Causing A Postback And Having To Re-show The Modal

Nov 9, 2010

I have a modalpopupextender and I want to be able to update the information without causing a postback and having to re-show the modal, normally I use an updatepanel and this is working in most cases but I have an issue with a repeater where the ItemCommand has been set but clicking the button does not fire anything, unless I set the repeater as a trigger but this then does postback and I lose where I am. Not the usability I want to provide.

View 4 Replies

AJAX :: Link Button In Gridview Causing Full Postback?

Feb 11, 2011

I have a link button inside a template field of a gridview. The gridview is wrapped in an update panel. I want the link button to fire an async postback but it always fires a full postback. Why is this?

This is a similar problem to the one described in the link below. However, I have tried doing a RegisterAsyncPostbackControl in the gridview databound, but this did not work.

[URL]

View 10 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved