.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 with multiple buttons

Posted By:      Posted Date: August 25, 2010    Points: 0   Category :ASP.Net

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.

View Complete Post

More Related Resource Links

GridView Multiple Filter AJAX Control

This AJAX control enables the user to filter data within any column inside a GridView. The user can add multiple filters and can delete existing ones too.

ASP.NET Multiple Selection DropDownList with AJAX HoverMenuExtender

Recently, I was looking for a multiple selection dropdownlist control for my new project. After spending some time researching for it, I decided to put together all my finding in one web user control. This web user control consists of an ASP.NET AJAX HoverMenuExtender, JavaScript, StyleSheet and CheckBoxListExCtrl . The final product will work with or without a MasterPage and you can drag and drop more than one instances of the control on to the page.

single form multiple buttons in MVC


In a single page  has two buttons , ddown and tempname.

I wrote two actionresult separetly each one for ddown and tempname.

I need one is post and another one is get method. so i gave like

1. Get Method


        [AcceptParameter(Name = "button", Value = "tempname")]
        public ActionResult ddown_tempname(string statusName, NewsLetterAdminViewModel viewModel)

return View();



2.Post Method


        [AcceptParameter(Name = "button", Value = "ddown")]
        public ActionResult ddown(string statusName, string button, NewsLetterAdminViewModel viewModel, FormCollection collection)

return View();



if i call the post method its worked well. but if i call the get method, the code does not execute. the brea

Autocomplete with multiple word suggestions, How can we do in Asp.Net with Ajax?


Hi All,

Could you please let me know the process to get multiple word suggesions for a text box in asp.net using Ajax.  

Actually I got a solution for that,


But it used Atlas. When I am running with this code in my application, it is conflicting with Script Manager that is already there in Masterpage.

How can I overcome that problem. Is there any built-in solution in latest versions of Ajax?


Thanks in Advance,

Sateesh Nagalla,



Using ReportViewer for multiple reports by way of radio buttons

 Hi all, Thanks for taking the time to read over my scenario.  I am using one ReportViewer with already established SQL Stored Procedures connected to three report files (*.rdlc).  There are three radio buttons which are to be associated with each report that needs to be displayed in the ReportViewer.  Here is an example if a radio button is selected:ReportViewer1.Reset() Dim rds As Microsoft.Reporting.WebForms.ReportDataSource rds = New Microsoft.Reporting.WebForms.ReportDataSource ReportViewer1.LocalReport.DataSources.Clear() If RadioButtonList1.SelectedIndex = 0 Then rds.DataSourceId = ObjectDataSource1.ID rds.Name = "spEx1" rds.Value = ObjectDataSource1 ReportViewer1.LocalReport.DataSources.Add(rds) ReportViewer1.LocalReport.ReportPath = "Ex1Report.rdlc" ... The ReportViewer works for the first radio button selection but then for the other selection I get the following error: A data source instance has not been supplied for the data source 'spEx1' I'm not sure exactly what is going on or where it's still tied to the first data source.  Any help would be great!  Thank you.

Ajax Accordion - Multiple controls with the same ID '_content' were found

Hi I'm dynamically adding accordion panes to an Accordion Control. When I add a single pane, no problem but trying to add 2nd pane I get the exception: *Multiple controls with the same ID '_content' were found* I've tried assigning unique Ids to the panes as follows but not joy. Can anyone please help? Thanks Rob.    if (User.IsInRole(@"arcpet\RDLM - Tradecapture Initial Margin Users - Security")) {      //build header for pane      AccordionPane pneTCaptureInitalMargin = new AccordionPane();      pneTCaptureInitalMargin.HeaderContainer.Controls.Add(new LiteralControl("(TCIM)T/Capture Initial Margin"));      pneTCaptureInitalMargin.ID = "AccordionPane" + Guid.NewGuid().ToString();      pneTCaptureInitalMargin.HeaderContainer.ID = "HeaderContainer" + Guid.NewGuid().ToString();      //build content for pane      pneTCaptureInitalMargin = AddHyperLink("Trade Books & Markers", "TradeBook/TradeBook.aspx?4", pneTCaptureInitalMargin);      acc.Panes.Add(pneTCaptureInitalMargin);           pneTCaptureInitalMargin = AddHyperLink("+Create New Records", "TradeBook/TradeBookDetail.aspx?acPane=4&type=new", pneTCaptureInit

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!

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

How can I process multiple buttons with one click event?


I want to dynamically build a table where each of the first three cells may or may not contain an image.  If a cell contains an image, it may or may not contain a radio button.  The last cell contains a button or link button.  I want all the buttons to be handled by the same click event.  The number of rows, which cells will have an image, and which cells will have a radio button is not known at design time.  Finally, the images are displayed using the better image control.

I'm trying to get this to work usinging a repeater, but at the moment I can't get the radio button checked propety to change from the default value.  I'm using an arraylist as a datasource.  I thought of using a gridview, but I don't know how to add a radio button and a better image control to a cell. 

I've gone round and round with this thing. Each time after a lot of work I find there is something I can;t get working.  Is there a reasonable solution for this? 

I'm back to wanting to build a table, but how do I handle the buttons?

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">

How to navigate through AJAX TabContainer Tabs using buttons


Hi Forumians,

In a web page i have 5 tabs from 1 st tab to 2 tab

i have to go by a linkbutton click not through header navigation

so i created a link button and in the button click event

i have written the code like below

protected void lnkproceceed2tab3_Click(object sender, EventArgs e)
        TabContainer1.ActiveTab = TabContainer1.Tabs[3];


its sitting in same tab i cant go to the next tab by a link button.

Kindly find a solution and tell me

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


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


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.

ajax.beginform inside a for loop


so I am using a foreach loop to iterate through comments. The comment section is wrapped inside "Comments" div. My function **DeleteComment** fetches comments again once you delete a comment and rebinds it to the control. However, after you delete a comment, anytime you try to delete another comment, the commentId of the very first deleted comment would keep getting passed to **DeleteComment** function instead of the passing the commentId of the comment you are trying to delete. If you refresh the page, then you can delete ONE comment again, and the same problem if you try to delete another. 
     <% foreach (var item in Model) { %>

avoid postback in multiple drodown list using ajax


i have 4 dropdownlist..state,district,place,product..where we have to select the product depend on state ,district ,place and product and there is search button for search particular product where iam using gridview to dipslay particular product deatails . i do not want to do auto past back eventfor page  when i select dropdownlist...i tried using ajax but still i cant get through..i tried this code but,,,,please helpme...how to use ajax for 4 dropdownlist & 1 button so that i can dispaly product deatails.....

<asp:scriptmanager id="ScriptManager1" runat="server">
                    <asp:updatepanel id="UpdatePanel1" runat="server">
                    <asp:label id="Label1" runat="server" stext="STATE:" style="display:inline " mce_style="display:inline ">STATE:</asp:label>
                    <asp:dropdownlist id="DDLSTATE" runat="server" height="18px" style="position :relative; top: 6px; left: 2px;" mce_style="/position :relative; top: 6px; left: 2px;" autopostback="True" datasourceid="SDSSTATE" datatextfield="PUSTA" datavaluefield="P

Handling Form Controls After Ajax.BeginForm Submission


Currently I have a comments section integrated into a blog I am writing. 
The comments are Ajaxified, when you post a comment the comment list auto updates with the comment you just added. 
Everything is working great but I would like to do some cleanup after a comment is successfully posted. 
Specifically I would like to disable the textarea and submit button which I would have no issues doing through javascript by using the AjaxOption OnComplete parameter.
To avoid double posts or just plain abuse. I know I will need other safegaurds as well but this is my first step.
The thing is Ajax.BeginForm does not give the form an id or name so I can not reference the form in javascript.
Is there a workaround here? Can I disable these form controls from the controller? 

Here is my code.

<% using (Ajax.BeginForm("Details", new AjaxOptions {UpdateTargetId="divCommentList"})) {%>
    <p>Add Your Own Comment</p>
    <p><%= Html.TextArea("Comment1")%></p>
    <input type="submit" value="Add Comment" id="submit" />
    <% } %>

EnableClientSideValidation in a PartialView (jQuery tab) with a Ajax.BeginForm



I got a problem with client side validation not firing, after reading many posts I believe it as to do with the HTML being loaded "afterwards". But I can not seem to find any solution.

You got any ideas how to solve it?

<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
        <asp:ContentPlaceHolder ID="TitleContent" runat="server" />
    <link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
    <%-- jQuery --%>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js"></script>
    <!--<script src="../../Scripts/jquery.validate.min.js" type="text/javascript"></script>
    <script src="../../Scripts/MicrosoftMvcJQueryValidation.js" type=
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