Welcome to Bangladesh Microsoft Technology Community Sign in | Join | Help

September 2006 - Posts

Atlas 7: Caching web service response on browser and save bandwidth significantly

Browser can cache images, javascripts, css files on users hard drive and it can also cache Xml Http calls if the call is a Http Get. The cache is based on Url. If it's the same Url and it's cached on the computer then the response is loaded from cache,

Atlas 6: When 'this' is not really 'this'

Atlas callbacks are not executed on the same context where they are called. For ex, if you are making a Page method call from a javascript class like this: function SampleClass() { this.id = 1; this.call = function() { PageMethods.DoSomething(

Atlas 4: Only 2 calls at a time and don't expect any order

Browsers make 2 concurrent AJAX calls at a time to a domain. If you make 5 AJAX calls, browser is going to make 2 calls first, then wait for any one of them to complete and then make another call until all remaining 4 calls are complete. Moreover, you

Atlas 5: Bad calls make good calls timeout

If 2 http calls somehow get stuck for too long, those two bad calls are going to make some good calls expire too which in the meantime got queued. Here's a nice example: function timeoutTest() { PageMethods.Timeout( { timeoutInterval : 3000, onMethodTimeout:

Atlas 3: Atlas batch calls are not always faster

Atlas provides you batch call feature which combines multiple web service calls into one call. It works transparently, you won't notice anything nor do you need not write any special code. Once you turn on the Batch feature, all web service calls made

Atlas 2: HTTP POST is slower and it's default in Atlas

Atlas by default makes HTTP POST for all AJAX calls. Http POST is more expensive than Http GET. It transmits more bytes over the wire, thus taking precious network time and it also makes ASP.NET do extra processing on the server end. So, you should use

Atlas 1: Try not to use page methods

One of the easiest thing in Atlas is to use the Page Method feature. If you use Atlas on your web page say Default.aspx, you can directly call public methods on Default.aspx from javascript. Just put a [WebMethod] attribute on a public method in Default.aspx

Beginning Atlas series: Why Atlas?

This is the first question everyone asks me when they see Pageflakes. Why not Protopage or Dojo library? Microsoft Atlas is a very promising AJAX library. They are putting a lot of effort on Atlas, making lots of reusable components that can really save

Do you have problems with users who cannot use Forgot Password option?

Here's a scenario. We use Email address as user name in ASP.NET 2.0 Membership provider. There were several places where we used to create user accounts using this: Membership.CreateUser( email, password ); We did not notice what it was doing. After

Large log file can bring SQL Server down when transaction log shipping runs

We were having very poor performance when we turned on transaction log shipping on our SQL Server. We are using SQL Server 2005. The transaction log file was around 30 GB because the database was in Full Recovery mode. The server became very slow, every

How to setup SQL Server 2005 Transaction Log Ship on large database that really works

I tried a lot of combinations in my life in order to find out an effective method for implementing Transaction Log Shipping between servers which are in a workgroup, not under domain. I realized the things you learn from article and books are for small

How to setup SQL Server 2005 Transaction Log shipping on large database

  I tried a lot of combinations in my life in order to find out an effective method for implementing Transaction Log Shipping between servers which are in a workgroup, not under domain. I realized the things you learn from article and books are

Careful when querying on aspnet_users, aspnet_membership and aspnet_profile tables used by ASP.NET 2.0 Membership and Profile provider

Such queries will happily run on your development environment: Select * from aspnet_users where UserName = 'blabla' Or you can get some user's profile without any problem using: Select * from aspnet_profile where userID = '…...' Even you can

Web Application performance optimization tips

Yesterday I took a class on website performance optimization. I would like to share what I did in the class.   I took the class in a company which has a local blog site. It has serious performance issue because of both hardware and software limitations.

100% CPU, 100% IO, a near death experience for SQL Server 2005 and us

For last two weeks we were having pretty hard time at Pageflakes. The database server was having 100% CPU, and 100% IO usage most of time. It was running hot, almost about to go to a coma. It's a 64 bit Dual Core Dual Xeon Dell server

How to use ASP.NET 2.0 Profile object from web service code

You have started to use ASP.NET 2.0 Profile Provider and you are very happy with it. All your .aspx pages are full of "Profile.Something". You also introduced a lot of new properties on the profile object via web.config. Then you added a new web service.

Forms authentication failed for the request. Reason: The ticket supplied was invalid. (Solution)

When you turn on web garden (multiple process per application pool) or go into multi server load balance deployment where servers are serving the same website, you will have Forms Authentication problem. Users will get automatically logged out or see

Calculate code block execution time using "using"

Here's an interesting way to calculate the execution time of a code block: private void SomeFunction() { using (new TimedLog(Profile.UserName, "Some Function")) { ... ... } } You get an output like

Cache-Control header cannot be set properly in ASP.NET 2.0 - A solution

Do you know that you cannot set Cache-Control: max-age header in ASP.NET 2.0? No matter how many combinations you try, you will always end up with "max-age=0" for sure. I found solution to the SetMaxAge problem in HttpCachePolicy. Here's the code of

Redirect Traffic from old to new server when you change hosting service

How do you redirect your users when you change hosting service? Currently your domain maps to the IP which is with the current hosting provider. When you change to a new hosting provider, you get a new IP range for your new servers. So, even if you change

How to fade background and show a dialog box

There's a nice trick we do at Pageflakes whenever we show a dialog box. We make the background faded so that user's attention is dragged to the dialog box and user does not get confused what to do. Here's how it looks: Here's how it works: First we

Cost effective, failsafe, 2 server load balanced web & DB servers

We were very poor when we first started Pageflakes so we needed a really cheap but fully reliable deployment configuration. The requirement was: Fail safe. If a server goes down, another one can take over without users noticing Database must be mirrored

Things you must do for ASP.NET 2.0 Membership Provider before going live

Some tweakings you should do on your web.config if you are using ASP.NET 2.0 Membership Provider before you go live on your production server: Add "applicationname" attribute in Profile Provider. IF you do not add a specific name here, Profile provider