Tuesday, 14 July 2009

Microsoft® Silverlight™ 3 Tools for Visual Studio 2008 SP1

Last Friday was the official day that Silverlight 3 released. I was about to go home on Friday and don't know why something came to my mind that it's time to check Silverlight's website. Boom! SL 3 is released.


Microsoft® Silverlight™ 3 Tools for Visual Studio 2008 SP1

Saturday, 11 July 2009

Using Output Caching to Enhance Web Site Performance

There are 2types of caching for ASP.NET

1. Configuring Page-Level Caching
copy the code below to aspx html source page

<%@ OutputCache Duration="15" VaryByParam="none" %>

Duration means the duration of the cache. In this case, it will cache for 15 seconds.











the name "AppCache1" will be used to the pages that you want to have cache. You can have different kinds of cache options by just adding another profiles like the code below




what we have to do in each of our page is add the code below

<%@ OutputCache CacheProfile="AppCache1" VaryByParam="none" %>

Note: the name of the CacheProfile is the name you set in outputCacheProfiles in web.config.


The attribute VaryByParam is used for caching parameters (eg. querystring) of a page.
example:

<%@ OutputCache Location="Server" Duration="60" VaryByParam="Color" %>


Here we have a param called "Color". (http://mysite/mypage.aspx?Color=red)
When user goes to the page wtih Color=red, it caches the page with param Color=red for specific duration according to our setting.

If we specify the VaryByParam parameter, any new value will be cached. For cached value, it loads data from cache.


Here's the detail explanation of VaryByParam from Microsoft MSDN
==================================
The @ OutputCache directive requires you to set the VaryByParam attribute, which until you now you have set to "none". The VaryByParam attribute enables you to configure caching so that ASP.NET stores different versions of a page depending on parameters such as query strings, form post values, request headers, and so on.

For example, you can use cache parameters in a page that displays weather conditions for select cities, where the weather data is refreshed only every three hours. In this scenario, you want to cache a separate version of the page for each city. You can do so by setting the cache parameter to vary by a query string parameter.
==================================


If you wish to study all the details on your own see here

PDF Split and Merge



PDF Split and Merge is an open source software that allows us to split PDF files into multiple files.

When you installed the program and you see missing javaw.exe, please download Java Virtual Machine

Friday, 10 July 2009

Silverlight 3 Element to Element Binding




We don't have to create tons of events for updating values, texts to different controls.

The code below does it all. No additional coding inside cs file.
{Binding Value, Mode=OneWay, ElementName="MyControlxName"}

It's like the old binding style except that we have ElementName to tell the compiler that we want to bind the property to the element MyControlxName's Value property.


Thursday, 9 July 2009

ASP.NET Dynamic Compilation

Unlike ASP, ASP.NET doesn't have to compile each and every time it is requested. An ASP.NET page is compiled only once when an application is modified. If it is not modified, the Framework will look for the directory


\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files


to load the compiled dll.


However, if a site contains thousands of pages. Having Framework to precompile everything and store in the temp folder isn't a good choice. Here the way to chose if you want the compiler to precompile or not.
Adding CompilationMode attribute inside the <%@ Page Language="C#" %> tag at html source code view.
The attribute has Always, Auto, and Never. I believe the default is Auto :)



Wednesday, 8 July 2009