Last Tuesday, Scott Guthrie announced in his blog the new Microsoft AJAX content delivery network (CDN), this is great news to all of us using AJAX in our commercial and non-commercial applications.
What is it?
First of all, a CDN is a Content Delivery Network which is composed of multiple servers strategically placed across the globe. In the case of the Microsoft AJAX CDN servers, the jQuery and ASP.NET AJAX libraries are cached across multiple web-sites around the world and they are available to you now. If your website loads these AJAX libraries from the Microsoft AJAX CDN servers, your AJAX enabled pages will load faster than when loaded from your own server.
What are the benefits?
Think about it, right now you might have several websites (or one) that utilizes the jQuery or ASP.NET AJAX libraries, every time a user opens your AJAX enabled page, this library or libraries need to be loaded from your own server. In some cases depending on where the website user is located geographically, these files will have to travel through the wire from a few hundred miles to thousands of miles (if you have people from across the pond looking at your website) making your page slower to load. The new Microsoft AJAX CDN will help you improve the performance of your website by serving the requests for these files directly from a nearby “edge cache” server.
Also, these files can be cached across multiple websites, meaning that users accessing your website won’t need to re-download these files if they have visited another ASP.NET AJAX enabled website that uses the CDN, and you know that speed is king when loading websites.
How do you use it?
One of the main benefits I see with this (other than my web pages loading quicker) is that you can implement this to new and existing AJAX enabled websites very easily. Below is an example on how to use jQuery from the Microsoft AJAX CDN, you just need to add a script tag to your page using the URL below:
When your page opens, the browser will request the script file from one of the closest CDN servers to the end-user loading your page quicker and saving bandwidth since the Microsoft AJAX CDN server pays the bandwidth cost.
Also, in ASP.NET 4.0 the ScriptManager includes a new property (EnableCdn). If you want to use the Microsoft AJAX CDN all you have to do is set this property to “true”, see example below:
By setting the EnableCdn property to true, your application will retrieve all the JavaScript files from the CDN instead of downloading them from your server, which in many cases will probably take longer and you are also paying for the bandwidth, and remember that this service is free of charge, for commercial and non-commercial applications, sounds like a good idea to me :).
How do you use the ASP.NET AJAX Preview 5 with CDN?
It looks like the AJAX team at Microsoft has been busy this month, in addition to the Microsoft AJAX CDN, the team also released the ASP.NET AJAX Preview 5 a few days ago. This is available in CodePlex now.
Or, you can also use the CDN to load files from ASP.NET AJAX Preview 5 by using the following scripts:
Note the directories in the URL “beta/0909” which specifies that you are requesting the files from the beta version released on 9/2009 – ASP.NET AJAX Preview 5.
I believe this is a great solution and there is no reason not to start using it now, of course I recommend you do all the testing required to make sure everything works the way you like. I have been using jQuery a lot more than the ASP.NET AJAX libraries lately, I am so interested in this jQuery library because of all the power it has in such a compact package, and the fact that Microsoft is supporting it is yet another reason for me to continue using it. I already started changing some of my scripts to use the CDN and will be doing some testing to see how much faster my pages load – I am sure any speed gain will be enough reason for me to use it.
Earn $300 per month by clicking the website links given at the
end andviewing or surfing ads for 20-35 seconds each, after
creating your account in the website or websites you want to
work in. You are paid 1-5 CENTS per ad you view for 20-35
seconds. Moreover, this is absolutely FREE. These earning sites are paying your earnings via alertpay or paypal which are online bank accounts. First of all, you can open your accounts at alertpay and paypal for free at https://www.alertpay.com/?qTxj80LOVWjd1j6%2bCoHNbQ%3d%3d and http://www.paypal.com respectively. You can request a check from these banks or get the money by bank transfer after your earnings are transferred to them. All the work you have to do is click the website links given below and after entering the website, click on "Join" or “Register” button to create your account. After creating your account, log into your account pressing the "Login" button and click on “Surf Ads” or “View Ads” button, to find all the ads given one below the other. Click on the ad link one by one and wait for 20- 35 seconds to get credited. Normally, there is a green tick mark at the top once you are credited or it is witten that you are credited. In some of the websites, after viewing an ad for 20-35 seconds, four numbers are shown and you have to click the number told to get credited for seeing that ad. All the ads should be viewed only once per day. This can be repeated every day. You can check your earnings by clicking on "My Stats" button. Once you reach the minimum payout for the website, click on “cashout” button to get your payment. Please write down the addresses of the websites given below which you want to join somewhere so that you can work in them every day. The number of websites given below, you want to join is up to you but the more websites you join, the more you earn.
There are two types of state management - server side and client side. In this post I'm going to introduce the client side state management and explain when to choose client side or server side state management.
Client Side State Management Techniques
Client side state management include the following techniques:
ViewState - ASP.NET track the state of the controls on the pages through the ViewState. Also, ViewState is used to store small custom values. Don't hold big custom data object because it will affect the performance of your web page.
Hidden fields - hidden fields are html input control with a type of hidden - . They are used to store data in the html without presenting the data in the browser. The data of hidden field is available when the form is processed or when using javascript. The ViewState use hidden field to save its data. You can use the View Source operation (if enabled) to scan the web page's source and to look for hidden fields.
Query strings - query string state is stored in the URL that is sent to the browser. Unlike ViewState and hidden fields, the user can see the values without using special operations like View Source. The parameters are passed in the URL separated by the & symbol. For example, in the following URL the query string is built out of two data parameters, a and b, which hold the values 1 and 2 - http://www.srl.co.il?a=1;b=2.
Cookies - the cookies store their values in the user's browser and the browser send them back to the server every time a request is performed. Cookies are maintained during the session of a user in the web site and therefore can be used in multiple web pages of the site.
Control state - when building custom controls you should use the control state to save your state if EnableViewState property is set to false. This is the only reason to use this technique.
How do you know when to choose the client side or server side state management?
When to Choose Client Side State Management
Choose client side for better scalability and support multiple servers. The client side helps to get better scalability by storing state data in the user's browser instead of using the web server's memory. The client side support multiple servers because all the state is located in the browser. This way when you are redirected to another server you don't need to worry about your state.
The thing I wrote doesn't means that you can't use server side state management for the supporting of multiple server. To enable server side state management to be able to support multiple servers you'll have to use centralized state management (state server or store state in database) or you'll have to use techniques like sticky connection for load balancing.
When to Choose Server Side State Management
Choose server side for better security and to reduce bandwidth and web page's size. Server side state management is more secure. The state is saved on the server and therefore isn't delivered to the client. Confidential state data shouldn't be used with client side state management. Server side reduce the traffic to and from the client because data isn't sent to the browser and it's saved on the server. You should always remember that using client side state management sends data to the user's browser and that data is sent back to the server every time. This situation increases bandwidth usage and therefore your application will be less responsive and you'll suffer from performance issues.
In the next post I'll drill down into the client side techniques and explain how to use them.
There are some hidden functions in SQL server through which we can encrypt any string and store the same in the table. This will be very helpful in encrypting the user password and other sensitive user data. Encryption supported by SQL server is one way hash. One way hash is nothing but the string encrypted cannot be decrypted. The only way is to compare values with encrypted string.
In the above example @EncryptedPIN will store the cipher Text. The data in this string is not the encrypted string instead it will return the hash code of the supplied plain string.
ROWLOCK : Use row-level locks when reading or modifying data. PAGLOCK : Use page-level locks when reading or modifying data.
TABLOCK : Use a table lock when reading or modifying data.
DBLOCK : Use a database lock when reading or modifying data.
UPDLOCK : UPDLOCK reads data without blocking other readers, and update it later with the assurance that the data has not changed since last read.
XLOCK : Use exclusive locks instead of shared locks while reading a table, and use hold locks until the end of the statement or transaction.
HOLDLOCK : Use a hold lock to hold a lock until completion of the transaction, instead of releasing the lock as soon as the required table, row, or data page is no longer required.
NOLOCK : This does not lock any object. This is the default for SELECT operations. It does not apply to INSERT, UPDATE, and DELETE statements.