asp.net-ajax

how does the __doPostBack method get called? Where is the calling method?

笑着哭i 提交于 2019-12-08 16:14:56
问题 I used an <asp:Button /> control, and after rendering in the browser that control doesn't have a click event property assigned. How exactly is it calling the sever side event? ASPX code: <asp:Button ID="Button1" runat="server" Text="Button" OnClick="TestClickEvent" /> The above control was rendered in browser as following code: <input type="submit" name="Button1" value="Button" id="Button1"> The following code is rendered in the browser, which sets __EVENTTARGET . My doubt is how does the _

Adding Triggers dynamically on UpdatePanel for dynamially added controls

别说谁变了你拦得住时间么 提交于 2019-12-08 15:43:42
问题 I am Adding array Buttons to a simple panel dynamically which is located in an Update Panel, now I want to Add triggers for UpdatePanel on click event of these buttons. My codes is as below: protected void AddButtons() { Button[] btn = new Button[a]; for (int q = 0; q < a; q++) { btn[q] = new Button(); buttonsPanel.Controls.Add(btn[q]); btn[q].ID = "QID" + q; btn[q].Click += new EventHandler(_Default_Click); btn[q].Attributes.Add("OnClick", "Click(this)"); AsyncPostBackTrigger trigger = new

How to check if client script is already registered during a partial postback

狂风中的少年 提交于 2019-12-08 15:00:07
问题 Below is the code I've currently implemented. if (!Page.ClientScript.IsStartupScriptRegistered(Page.GetType(), scriptKey)) { ScriptManager scriptManager = ScriptManager.GetCurrent(page); if (scriptManager != null && scriptManager.IsInAsyncPostBack) { //if a MS AJAX request, use the Scriptmanager class ScriptManager.RegisterStartupScript(Page, Page.GetType(), scriptKey, script, true); } else { //if a standard postback, use the standard ClientScript method Page.ClientScript

Multiple parameters on jquery ajax call asp.net

偶尔善良 提交于 2019-12-08 13:02:10
问题 I am trying to pass two parameters on an ajax call. I already tried several ways suggested on StakeOverflow but none worked. Here is my method signature on controller: [HttpPost] public ActionResult UploadFile(HttpPostedFileBase[] files, string[] usersToShare) Here is my function: function uploadFile() { var formData = new FormData(); var totalFiles = document.getElementById("files").files.length; for (var i = 0; i < totalFiles; i++) { var file = document.getElementById("files").files[i];

Asp.net updatepanel Listbox not refreshing layout

我与影子孤独终老i 提交于 2019-12-08 12:32:57
问题 so my problem is fairly simple i have 2 list-boxes and one button. when an item is selected in listbox2 and the button is clicked i would like to add the selected item to listbox1. And it all seams to work until I add the second item. then listbox1 doesn't refresh it's items... <body> <form id="form1" runat="server"> <asp:ScriptManager runat="server"></asp:ScriptManager> <div> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:ListBox ID="ListBox1" runat="server"></asp

How to send a list of data to Controller Action method using jQuery ajax method in ASP.NET MVC?

南笙酒味 提交于 2019-12-08 10:23:27
问题 Here is my Action Mehtod public JsonResult GetById(IEnumerable<Guid> idList) { //..... } And my JavaScript . I'm making an array of strings using li element's id property var idArr = []; var list = $("#ulApplications li"); $.each(list, function () { idArr.push($(this).attr("id")) }); $.ajax( { type: "GET", url: "/rolemanagement/application/GetById/", contentType: false, datatype: "json", data: { 'idList': idArr }, success:........ On my Action method I'm not getting any data.It seems I'm

How to accept a JSON string array in an .aspx Page method

橙三吉。 提交于 2019-12-08 09:31:07
问题 I am using jQuery ajax to pass a string array to a page method. I need to know what to do with that data once it gets to that page method. My goal is to insert it into a DB but before that I need to make sense of the array. As it is, it is coming over like this: { data : theArray} which correlates to {data: 1,2,3,4,5,6}. But 4,5, and 6 represent another row in the underlying DB and so would 7,8 and 9, and so on and so forth. I am new to Ajax. Here is the jQuery: //packaging table data for

What is the request life cycle for asynchronous (ajax) ASP.NET Page Method calls?

好久不见. 提交于 2019-12-08 08:45:52
问题 What is the application event/processing timeline for an asynchronous request made to a page method on a Web Form? Looking for a canonical answer or resource. Note: This is a request for information about how ASP.NET AJAX handles incoming requests made to web services exposed to client script as described here in the section named "Calling Static Methods in an ASP.NET Web Page." This is not to be confused with the page life cycle. It should also be mentioned that [WebMethod] and [ScriptMethod

json ihttpmodule compression

谁说我不能喝 提交于 2019-12-08 08:28:24
问题 I wrote an IHttpModule that compress my respone using gzip (I return a lot of data) in order to reduce response size. It is working great as long as the web service doesn't throws an exception. In case exception is thrown, the exception gzipped but the Content-encoding header is disappear and the client doesn't know to read the exception. How can I solve this? Why the header is missing? I need to get the exception in the client. Here is the module: public class JsonCompressionModule :

Web Service Call in JavaScript Causing White Screen of Death (WSOD) in Browser

十年热恋 提交于 2019-12-08 07:28:46
问题 Here's the specs: ASP.NET 3.5 using ASP.NET AJAX AJAX Control Toolkit jQuery 1.3.2 web services IIS6 on Windows Server 2003 SP1 SP1 SQLServer 2005 SP3 Site is SSL Infragistics Web Components 2009 Vol. 2 (using non-Aikido controls), UltraWebGrid and Tree control are main ones used. Here's the problem: I'm getting the White Screen of Death (WSOD) in IE 7/8. Basically, I have a page that has a left pane that has an AJAXControl Toolkit Accordion control where each accordion panes content is an