asp.net-ajax

How do I disable or remove unnecessary form elements before an ASP.NET asynchronous postback?

自作多情 提交于 2019-12-10 08:01:36
问题 I'm building a shopping cart page that could potentially contain dozens of separate items. Each item has a collapsible panel that contains several form elements that can be used to customize it. Most of the cart is wrapped in an UpdatePanel so that I can avoid a full postback when the user makes changes. When there are many items in the cart, there are of course many many postback elements, all of which are included in the raw form post, even though each post is really only triggered by the

Asychnronous Message Send Asp.net

£可爱£侵袭症+ 提交于 2019-12-09 22:40:14
问题 I'm trying to learn about how AJAX stuff works under the hood. Say I have an asp.net form with a button on it. I then have a database with a single column DateTime . When I click the button on the asp.net form I want to insert a column in the database with the current time. I'll have a C# event handler: protected void btnButton_OnClick(Eventargs e, object sender) { //insert DateTime.now into DB //This part is easy } What I would like to happen on the form itself is to have the button click

ASP.NET AJAX: Firing an UpdatePanel after the page load is complete

≡放荡痞女 提交于 2019-12-09 12:26:28
问题 I'm sure this is easy but I can't figure it out: I have an ASP.NET page with some UpdatePanels on it. I want the page to completely load with some 'Please wait' text in the UpdatePanels. Then once the page is completely loaded I want to call a code-behind function to update the UpdatePanel. Any ideas as to what combination of Javascript and code-behind I need to implement this idea? SAL PS: I've tried putting my function call in the Page_Load but then code is run before the page is delivered

How do I load an external file and make sure that it runs first in JSFiddle?

戏子无情 提交于 2019-12-09 08:25:28
问题 I have a JsFiddle here, and added Microsoft AJAX to be loaded through external JS/resource section. How can I tell whether or not my JS code is run after the AJAX file has finished loading? Seems that the AJAX does not load either. :( Here is the code in the JSFiddle: Type.registerNamespace("Tutorial.Chapter1"); Tutorial.Chapter1.Person = function(firstName, lastName) { this._firstName = firstName; this._lastName = lastName; }; Tutorial.Chapter1.Person.prototype = { set_firstName: function

jQuery vs MicrosoftAjax in ASP.NET MVC

99封情书 提交于 2019-12-09 05:27:45
问题 Under what circumstances would you use MicrosoftAjax over jQuery in an ASP.NET MVC application? According to Scott Cate in this podcast Object Oriented AJAX with Scott Cate MicrosoftAjax is good for sending and retrieving data to and from the server. And jQuery is good for manipulating your data via the DOM once it arrives at the client. Yet, with a simple form plugin for jQuery you can send and retrieve data with jQuery quite easily. Often with a single line of code. So I'm wondering what

Share aspx page between projects

孤街浪徒 提交于 2019-12-09 05:22:16
问题 We have a solution with multiple web projects, and there are some pages that should be present in several of them. So we'd need some sort of a shared project which contains aspx files, and which can be referenced by other web projects. Now there are a few implementations out there: One implementation described by ScottGu which involves building the shared project, and than copying the output aspx into the host project, and referencing the dll of the aspx. This method has the disadvantage that

Calling ASP.NET MVC Controller explicitly via AJAX

蓝咒 提交于 2019-12-09 04:32:28
I know that I can use following piece of code to refresh a div: <%=Ajax.ActionLink( "Update", "Administration", new AjaxOptions { UpdateTargetId = "grid", LoadingElementId = "grid-wait" } ) %> But this creates a link; user will have to click on it to get the view refreshed. How can I make it automatic, i.e., like say if I want the grid to be refreshed after every five seconds? Try this: <p id="CurrentDateTime"></p> <script src="../../Scripts/jquery-1.3.2.min.js" type="text/javascript"></script> <script type="text/javascript"> window.setInterval(updateDateTime, 5000); function updateDateTime()

What´s the difference between traditional:true option and false in Ajax call?

 ̄綄美尐妖づ 提交于 2019-12-08 17:41:52
问题 All of this is for discard a problem with a MVC controller. This is the code of the ajax: $.ajax({ //tipo de transferencia type: "POST", //dato a enviar dataType: 'Json', traditional:true, //enviar variable previamente formada contiene la estructura del modelo data:data, //liga previamente asignada esta liga contiene la ruta controlador-metodo url: url, Notice the traditional:true. 回答1: jQuery API documentation http://api.jquery.com/jQuery.Ajax/#jQuery-ajax-settings traditional Type: Boolean

Problems using UpdateProgress

别来无恙 提交于 2019-12-08 17:32:20
问题 I have a button on my ASP.NET page, which fetches some data from my database and displays it on a gridview. This process takes a while, so I thought I'll add an updateprogress AJAX control. Now when I click the button, the updateprogress image shows up and data is being fetched from my database successfully (I checked this from some logs that I have in my DB). But there are 2 issues: (1) The updateprogress image shows only for about 2 minutes. But my buttonclick event takes about 5 minutes to

Adsense in a ajax based application?

余生颓废 提交于 2019-12-08 17:10:05
问题 How do I add adsense or other ads in a asp.net ajax/ajax based application ? (ex. ra-ajax samples page) or GWT Is creating an iframe a viable solution? As stated below, placing adsense script is easy. But the google bot wont be able to scan my ajax based page, as all of the content is javascript. There wont be contextual ads. So wont be able to monetize. It would be great for static ads. Any idea/inputs? 回答1: It seems like what you want to do is load up AdSense and then dynamically refresh