.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Ajax.BeginForm doen't work properly with AjaxOptions.OnSuccess

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :ASP.Net

Hi All,

I want to use Ajax.BeginForm instead of Html.BeginForm.

I can use it with out OnSuccess option. When I include it, i doesn't save and give validaiton messages.

How can I solve this ?

Kind Regards


View Complete Post

More Related Resource Links

Looking for guidance: wanting to work with AJAX architecture



I'm starting a small website that will be backed by a database, and will allow a small number of users to authenticate and select an entry in the database, and then view (and optionally update) a corresponding entry (think master-detail).

I have some flexibility in how I'll do this, but I'd really like to incorperate some newer AJAX style coding, eliminating some page postbacks. I think this is a great opportunity to learn the concepts well.

I'll probably go with an ASP.NET 4.0 site. From what I've seen there are MANY ways to go about this:

-WCF Data Services to expose the data, and consume in ASP.NET

-Page methods to expose the data, separate method to update the data

-I'd rather avoid the UpdatePanel because I'm really looking for a full hands-on approach, with learning client side scripting being an objective as well.

Beyond that, it seems that one can use jQuery to build clientside templates, but also one can use the ASP.NET AJAX template engine (in ASP.NET 4.0 I believe).

A concern I have: users should only be able to work with the data exposed via these endpoints if they are logged into the website. Hopefully I can somehow reuse the ASP.NET forms authentication cookie for this purpose. 

Well, I hope I've posted enough to a

Ajax Asyncfileupload doesn't work as soon as I put it in a control


Hi guys,

I can't get my <ajax:asyncfileupload> working and I don't see why...

When outside any panel or table it is working well, but as soon as I put it in a <asp:panel> or table I get a strange error which seems to be on client-side but I don't understand what's happen here. Here is the code and code-behind and Javascript.

Here's the error: 


Here's my front-code:

<%@ Page Language="VB" MasterPageFile="~/masterpages/mpSqueletton.master" AutoEventWireup="false" CodeFile="frmAdmGestSocietes.aspx.vb" Inherits="adm_frmAdmGestSocietes" title="Untitled Page" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" Runat="Server">
<script type="text/javascript" language="javascript">    
        function uploadError(sender,args)
          document.getElementById("<%= lblStatus.ClientID %>").innerText = args.get_fileName(), "<span style='color:red;'>" + args.get_errorMes

Ajax.BeginForm with multiple buttons


can i have more than one AjaxOptions in Ajax.BeginForm targetting different controls?

Actually I want to exchange data between two listboxes placed in a single ajax.beginform.

How to do it..................help me.

Field validators does not work when field is manipulated with ajax

Hi.I have defined a field validator that works fine on normal behavior on a page:<asp:RequiredFieldValidator runat="server" ErrorMessage="errroooorr"  ControlToValidate="TextBoxHouseNumber" Display="Dynamic"></asp:RequiredFieldValidator>Now if I dont insert any text in the TextBoxHouseNumber field, and push submit, the FieldValidator fires as it should. But if I now click a button that automatically fills the TextBoxHouseNumber with text from a Jquery/Ajax function, the field validator still shows. It´s like "Hey, the user hasnt made any changes to the textbox, so I wont bother check it".How can I overcome this problem?Thanks alot! :)

browser history do not work properly

Hi,  I have an ajax enabled asp.net 2.0 page. There are some updatepanels on it and I use the history control to enable the browser history buttons. For first time the AddHistoryPoint method adds a history point to my history control. That works, I think. But on Navigate event, the args.State will contain no key! There is no entry in the dictionary! Therefore my navigation function breaks. Has anybody some similar effect? Or better a solution! Thnxs.

AJAX SlideShowExtender doesn't work, but I don't know why.

I try to use an AJAX SlideShowExtender, but I can't get it to work.This is my default.aspx code:<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestConnectionString._Default" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:Panel ID="SlideShowPanel" runat="server"> <asp:SlideShowExtender ID="SlideShowExtender1" runat="server" TargetControlID="Image1" SlideShowServiceMethod="GetSlides" AutoPlay="True" Loop="True" PlayInterval="1000">

Ajax.BeginForm doubt

Hi everyone,I got a problem with an Ajax form in MVC2 (VS 2010).Well I got an Index.aspx that has a Ajax.BeginForm, with a textbox and a input button (Button 1). The HttpPost of this simple form, will be handled by an action of my controller. This action will render a PartialView.The PartialView has a table that I fill with a ViewModel. Also it has another Ajax.BeginForm and another input button (Button 2). This new Ajax.BeginForm is handled by an action that has to do something with the data posted.Here's the thing: I click the Button 1, fill the table and everything is going well, but after that when I click everywhere in the page, the Button 2 change it's position to the bottom of the page and get the focus ... I don't know why ...Can anyone tell something that helps me?Thanks!

Sharepoint2007 + Ajax slow work

Hello, I write Sharepoint WebPart with jQuery plagin jqGrid to show DB data in table view on Sharepoint Server 2007 (of cource to manipulate with data jQuery plagin use Ajax technology). It works fine, but I have a very important trouble with productivity, it's unacceptable for my project. As I see the trouble is that Ajax work very slow on Sharepoint. For test I wrote ASP.NET project with the same code and same data, user can get and update data less than 1 second, the same action on Sharepoint takes over 12 seconds. IT'S UNACCEPTABLE!!! Does any body can help me? Any suggestions...

jquery ajax call does not work after adding routes

Hi.   I've added routes to my asp.net 4 website so that, for example the page: "~/Main/About/Careers.aspx"  is mapped to the url:  http://localhost/mysite/careers/   I'm using jquery to make an ajax call and it simply does not work after I've added the routing, I used the following code, and it remains stuck on the spinner image:$.ajax({ type: "POST", url: "Careers.aspx/SubmitApplication", data: "{" + paramList + "}", contentType: "application/json; charset=utf-8", dataType: "json", beforeSend: function () { $(".applySpinner").show() }, success: function (msg) { $(".applySpinner").hide(); // Replace the div's content with the page method's return. if (msg.d == "") { $(".applySuccess").hide(); $(".applyFailure").show(); return; } else $(".applyFailure").hide(); $(".sentTime").text(msg.d); $(".applySuccess").fadeIn(1000); } }); Thanks.  

File upload using AJAX.BeginForm

Hi Everyone,I am new to ASP.NET 3.5 MVC, I want to upload file using AJAX form. When I am using html form then I am able to upload files but my requirement is that I am using user control for edit profile, I am using tabs for the same where in we are having multiple tabs for edit profile, change password, etc.While using AJAX form having enctype = "multipart/form-data" then following statement did not get the files foreach (string filename in Request.Files)Please help me find the solutionThanks in advance

Does AJAX 2.0 work with ASP.Net 2.0 or ASP.Net 3.5


I wanted to know if AJAX 2.0 version is compatible with ASP.Net 2.0 ?

Thanks in Advance

Get the value of hiddenField HTML control not work properly in FireFox


Hi Guys,

I'm trying to access the the value of Hidden field as follows:

var empID= document.getElementById('HiddenField1').value;

It works well in IE but gives null in FireFox

Ajax.BeginForm does not update/show the result in partial view


I have a view.On which i have two partial viewMy m ain is like this ->.(Note i am using Ajax.BeginForm here.)

<body >
<% using (Ajax.BeginForm("SearchRequests", new AjaxOptions { UpdateTargetId = "SearchRequestDIV" }))
   { %>
 <%-- <%using  (Html.BeginForm("SearchRequests", "PlanRequest", FormMethod.Post, new { enctype = "multipart/form-data" })){ %>--%>
    <div >
       <table class="tableborder" border="0" cellpadding="0" cellspacing="0">
            <%if (Model.MessageText !="" && Model.MessageText !="undefined") { %>
                <td >
                    <font color="red"><%=Html.Encode(Model.MessageText)%></font>
                   <% Html.RenderPartial("SearchRequestCriteria", Model); %>         
            <% if (Model.SearchResults.Count > 0)
               { %>
                 <div id="SearchRequestDIV">

Updation in gridview using Ajax XmlHttp Object does't work



I have many divs in 1 page and each div consists of a gridview, the gridview is loaded by making AJax calls.

On load of the page, all the grid load data properly.

But now when i update any row in either of the grids, and make a call to the javascript that loads the grid in the page, it doesn't work rightly.

Any advices. Am i doing something wrong.

Wat are the options to update/refresh the grid.


Ajax MaskedEditExtender mask not working properly after turning off readonly



I ran into a strange issue with the AJAX MaskedEditExtender control, the extender is used with the Mask="99/99/9999" and MaskType="Date". Initially when the page loads the textbox was set to readonly using textbox.Attributes.Add("readonly", "readonly") in the codebehind. After the page loads if the user clicks on a certain button it would change the textbox to editable using javascript code: textbox.readOnly = false. The strange thing is after that if you start typing in the textbox you can see the entire mask (__/__/____) shifting to the right as you type. For example it looks something like this: 09__/__/____ instead of the normal 09/__/____.

If the textbox was never set to readonly in the first place this behavior won't happen. So it seems something got messed up when changing from readonly to not. I was able to reproduce this in a barebone aspx page with just the textbox, the mask extender, and a button that when clicked turning off the textbox's readonly. Anyone knows how I can fix this?

I'm using Ajax toolkit v3.0.30512


Client Side Validations with Ajax.BeginForm not working


I have a webform in which i am using Ajax.BeginForm.

But due to this my client side required fields are not working.

Please help.

problem with ajax control while upgrading website from 3.5 to 4.0 frame work



i am working on asp.net website.

on my web page i  submit some data on click at button , this block is inside update panel.

this functionality working fine in 3.5 frame work.

Now  our website is using 4.0 frame work.

controls inside update panel giving following error on submting data :

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500.

 thanks in advance

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend