Geeks With Blogs
Amit's Blog Sharing Thoughts and Learning Tips/Tricks
Compress Asp.net Ajax Web Service Response - Save Bandwidth
In this post, I will show you how to compress the Asp.net Ajax Web Service response, To understand the benefits of compression let us start with a simple example, Consider you have an web service which returns a large data like the following:[WebMethod()] public string GetLargeData() { using (StreamReader sr = File.OpenText(Server.MapPat... { return sr.ReadToEnd(); } } The web method reads an large text file (around 100KB) and returns it contents. Once we call this method from a ......

Posted On Saturday, September 15, 2007 6:09 AM

Showing Modal Progress Dialog in all Ajax Operation
If you ever like to show a Modal Progress dialog like the above for any ajax operation no matter which Update Panel or Web Service call is responsible for it, the following code will do the same.<%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml... <script runat="server"> [System.Web.Services.WebMet... public static string GetDate() { //Doing a fake delay for 3 seconds System.Threading.Thread.Sle... ......

Posted On Friday, August 24, 2007 7:13 PM

Loading UserControl Dynamically in UpdatePanel
In this post, I will show you how to load different user control in UpdatePanel from different menu item click. I have found a lot of request in Asp.net Ajax Forum and some of them are having misconception about this. Once you complete reading this post you will be able to load controls dynamically and learn how to employ different helper controls like UpdateProgress, ModalPopupExtender while the UserControl is loading. First let us create plain page without the ajax support: Markup: <%@ Page ......

Posted On Saturday, August 11, 2007 8:48 PM

Asp.net Ajax UpdatePanel Simultaneous Update - A Remedy
If you ever try to do more than one simultaneous partial update with Asp.net Ajax Update Panel, I guess you already found that Asp.net Ajax Framework cancel the current update request and starts the new one. You think I am kidding? Okay lets try the following code: <%@ Page Language="C#"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml... <script runat="server"> protected void Page_Load(object sender, EventArgs ......

Posted On Wednesday, August 8, 2007 6:29 AM

Create An Ajax Style File Upload
If you visit Asp.net Ajax Forum, you will find hundreds of request on File Upload Control that it does not give Ajax version of the page when it is placed in an UpdatePanel. Certainly, it is not possible, as the XMLHTTPRequest object that is used internally to post the form does not support file upload. In this post I will show you how to create Ajax like version of the file upload. The trick is very simple, I will use an Iframe to upload the file so the whole page does not get refreshed and when ......

Posted On Wednesday, August 1, 2007 3:36 AM

Implement Yahoo's YSlow in your Asp.net pages
I have got quite a bit of comments and feedbacks on my previous post where I shown how to combine multiple JS and CSS Files into one. So I decided to enhance it a bit more. Now it Supports: GZip or Deflate Compression based upon the browser header. Can be turned on/off from web.config Minifier for both JS and CSS files. Although it is recommended to keep separate version of these files for both development and production instead of minifying it runtime. There are plenty of online and offline tool ......

Posted On Sunday, July 29, 2007 5:14 AM

Combine Multiple JavaScript and CSS Files and Remove Overheads
When developing a large web application especially if it is Ajax enabled, we often ended up with a larger number of JavaScript and Cascading Stylesheet files and it is quite common that more than one JavaScript file is involved for a single functionality. For example, if you are using DataTable widget of Yahoo User Interface you have to add yahoo-dom-event.js, connection-min.js, dragdrop-min.js, json.js, datasource-beta-min.js, datatable-beta-min.js (as per the example). When a browser encounters ......

Posted On Wednesday, July 25, 2007 3:57 PM

Cancel a Web Service Call in Asp.net Ajax
In this post I will show you how to cancel a web Service call after it is invoked, I will also provide you some interesting findings (Maybe a Bug) in Asp.net Ajax Network Layer. There are plenty of examples available on how to abort an UpdatePanel AsyncPostback but none for the WebService. The following will show you how to do it. Since we are going to cancel a call we need a web method which wait for a long time to complete: The Web Method:[WebMethod()] public string LongOperation(int miliseconds) ......

Posted On Saturday, July 14, 2007 5:30 AM

SJAX Call
While visiting Asp.net forum, I found an interesting request, A forum member is trying to implement some validator controls where the member wants to call a Web Service method, since the nature of Asp.net Ajax is asynchronous the call does not return instantly. In the reply, another member from Microsoft provides some code which uses XMLHttpRequest to make a Synchronous call to web service. Certainly it does the Job but there is no flavor of Asp.net Ajax Framework. I am not sure the MS guy really ......

Posted On Wednesday, July 4, 2007 6:57 PM

Check User Name in Ajax way
While visiting the Asp.net Ajax forum I found quite a few post on the User Name Checking when creating an User. This is very common request and it is available in many Websites, So I decided to create a small sample. The following shows the full code listing:<%@ Page Language="C#"%> <%@ Import Namespace="System.Web.Servi... %> <%@ Import Namespace="System.Web.Secur... %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml... ......

Posted On Saturday, June 30, 2007 8:32 PM

Copyright © Kazi Manzur Rashid | Powered by: GeeksWithBlogs.net | Join free