asp.net-ajax

Making a difference between AsyncPostbacks in nested UpdatePanels in Asp.Net AJAX

拈花ヽ惹草 提交于 2019-12-01 13:09:19
问题 In an ASP.net AJAX project (WebForms), I have an UpdatePanel, and in UpdatePanel i have multiple nested Controls with UpdatePanels, basically i have control trees. The Parent Control is huge and very important part of the site i cannot touch it,(and also it is reused on many places),the UpdatePanel shoud remain on current position. The child controls in the update panel have functionality's wich are separated from each other(also they are separated with UpdatePanel),to be able to refresh just

How to post the viewmodel to action method using JQUERY AJAX in MVC

孤人 提交于 2019-12-01 13:01:08
问题 I want to achieve create (INSERT) screen using $.POST or $.AJAX. Note: code is working fine without AJAX call..it is already there.. now i need to do ajax call and save without postback. I wrote below code: On submit click event following is the code: $.ajax( { url: '@Url.Action("CreateProduct","ProductManagement")', dataType: 'json', contentType: 'application/json; charset=utf-8', type: 'post', data: $('frm').serialize(), success: function () { alert('s'); }, error: function (e1, e2, e3) {

ASP.NET Ajax partial postback and jQuery problem

被刻印的时光 ゝ 提交于 2019-12-01 12:56:47
A control contains some HTML and some jQuery to handle a fancy tooltip to display when you click an image within a div. The control is then used on several different pages, sometimes within an updatePanel, sometimes not. I have the following code to handle loading the jQuery after a partial postback when the control is displayed within an update panel. Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler); function EndRequestHandler(sender, args) { $('img.ormdShipping').each(function(){ $(this).qtip({ // some qtip options go here }) }); } Problem is, the jQuery doesn

Response.Redirect in ASP.NET AJAX calls

余生颓废 提交于 2019-12-01 12:39:39
I have a button in an UpdatePanel that if it is clicked will redirect the user to another page in the same folder in some cases and otherwise will update the UpdatePanel with some info. If I do a redirect in this way: Response.Redirect("Test.aspx"); it does a redirect to /Test.aspx which in most cases would be fine, but the problem is that the application is accessed through a reverse proxy (at x.com/y/) which will cause some problem since /Test.aspx will redirect the user to a nonexisting file in the root of the server that does the proxying. Is it possible to force the redirect to skip the /

jQuery Modal Window to Display a Table in MVC

為{幸葍}努か 提交于 2019-12-01 12:01:49
问题 Let me start of by saying that I am inexperienced with JavaScript. Here is what I want to do. When the user clicks "Show Details" on a row of data, they get a pop-up (modal?) window that has some data generated from another action within the MVC application. Where can I find an example of implementing something like this? Also, when a user clicks "Approve" on either this pop-up or on the original data row another pop-up will display with a form a person needs to fill out. Any direction will

How to get Id update panel that initial a request in javascript

半世苍凉 提交于 2019-12-01 11:22:48
I want to know Id update panel that initial a request in JavaScript .I write this script but it return undefined . var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_initializeRequest(InitializeRequest); prm.add_endRequest(EndRequest); function InitializeRequest(sender, args) { alert(sender.ID); } function EndRequest(sender, args) { } sender is not null and it return [object] but How I can get ID ? Edit 1) I think when UpdatePanel be inside MasterPage it does not work.this is my code: <script type="text/javascript"> $(document).ready(function () { var prm = Sys.WebForms

Response.Redirect in ASP.NET AJAX calls

*爱你&永不变心* 提交于 2019-12-01 10:37:55
问题 I have a button in an UpdatePanel that if it is clicked will redirect the user to another page in the same folder in some cases and otherwise will update the UpdatePanel with some info. If I do a redirect in this way: Response.Redirect("Test.aspx"); it does a redirect to /Test.aspx which in most cases would be fine, but the problem is that the application is accessed through a reverse proxy (at x.com/y/) which will cause some problem since /Test.aspx will redirect the user to a nonexisting

ASP.NET Ajax partial postback and jQuery problem

孤街醉人 提交于 2019-12-01 10:31:02
问题 A control contains some HTML and some jQuery to handle a fancy tooltip to display when you click an image within a div. The control is then used on several different pages, sometimes within an updatePanel, sometimes not. I have the following code to handle loading the jQuery after a partial postback when the control is displayed within an update panel. Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler); function EndRequestHandler(sender, args) { $('img

How can I programmatically add triggers to an ASP.NET UpdatePanel?

跟風遠走 提交于 2019-12-01 08:18:34
I am trying to write a quote generator. For each product, there are a set of options. I want to dynamically add a drop down list for each option, and then have their SelectedIndexChanged events all wired up to update the quote cost. I am not having any trouble adding the DropDownList controls to my UpdatePanel, but I can't seem to wire up the events. After the page loads, the drop downs are there, with their data, but changing them does not call the SelectedIndexChanged event handler, nor does the QuoteUpdatePanel update. I have something like this: Edit: Since programmatically adding

How to get Id update panel that initial a request in javascript

我与影子孤独终老i 提交于 2019-12-01 08:11:20
问题 I want to know Id update panel that initial a request in JavaScript .I write this script but it return undefined . var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_initializeRequest(InitializeRequest); prm.add_endRequest(EndRequest); function InitializeRequest(sender, args) { alert(sender.ID); } function EndRequest(sender, args) { } sender is not null and it return [object] but How I can get ID ? Edit 1) I think when UpdatePanel be inside MasterPage it does not work.this is my