Web Developer Recruitment in Faraconesh Corporation

Faraconesh Logo

I hardly ever use my blog to publish unrelated subjects to programming. This is one of them.

Our company Faraconesh Corporation is bound to hire new talented and professional .NET developers. If you like working with me in person in a small-growing company which offer good salary, insurance, flexitime working beside experts which are pioneers in Iran in their skills and you meet the following needs

At least 3 years of relevant experiences.

Deep knowledge of .NET, C#, SQL Server and NHibernate

Also ability to work in team and using issue trackers, source controls and the rest of teamwork tools

Ability to work with WPF, WCF, WF and REST count as advantages

You can send your resume to jobs@faraconesh.com or to me at n.hajloo@gmail.com.

Faraconesh Corporation appreciates in advance your kind request to join and will arrange a meeting with you in next few days.

This is the Persian text for this advertisement.

کروکی آدرس شرکت فراکنش در نقشه تهران کتاب اول
من به ندرت در این وبلاگ مطالب غیرمرتبط با برنامه نویسی می‌نویسم. این مطلب یکی از آنهاست.شرکت ما، فراکنش قصد استخدام چند برنامه‌نویس بااستعداد و حرفه‌ای دات نت را دارد. اگر شما دوست دارید که با من از نزدیک در یک شرکت کوچک رو به رشد که حقوق کافی، بیمه، زمان کار آزاد و کار شانه به شانه با متخصصینی که در زمینه کاری خودشان از پیشروان هستند همکاری کنید و نیز درصورتی که شرایط زیر را دارید

حداقل سه سال سابقه کار مرتبط

درک و تسلط کافی و عمیق از ‫.NET, C#, SQL Server و  NHibernate

همچنین توانایی کار گروهی و استفاده از ابزارهای کار تیمی مانند ایشوترکر ها و سورس کنترها

توانایی کار با WPF, WCF, WF و REST مزیت به شمار می‌آید

را دارید

می‌توانید رزومه کاری خودتان را به آدرس jobs@faraconesh.com و یا برای من به آدرس n.hajloo@gmail.com ارسال نمایید.

شرکت فراکنش از درخواست همکاری محبت آمیز شما از قبل قدردانی کرده و در چند روز آینده یک قرار ملاقات با شما تنظیم خواهد کرد

How to Build your Solution with Visual Studio Command Prompt

Working with command prompt always been a nice job, it helps you to schedule your routines and gives you more understanding of what’s going on the background. You will give more and on-time information; you can check the result as they happen. You can create a batch fileto build your solutions one after another and many other advantages.Visual Studio command prompt gives you all of the simple windows command prompt abilities plus some tools to control build and publish your source codesand many other abilities which you can find here. You can run Visual Studio command prompt from

[source code=””xml””]
Start Menu \ Visual Studio [2005|2008|2010] \ Visual Studio Tools \ Visual Studio 2008 Command Prompt
[/source]

You can use other prompts like – Visual Studio 2008 x64 Cross Tools Command Prompt – for general x64 system. None of them are different; the only difference is that they are provided for different platforms. As it is hard to run Visual Studio Command Prompt from Windows Task manager, you have to call it from a simple Command Prompt; it means that you have to run the following command in your Command Prompt. After that Visual Studio tools will include into your simple command prompt.

[source code=””xml””]
call "C:\Program Files (x86) \ Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_amd64
[/source]

x86_amd64 will call x64 Cross Tools. To build your solutions you can use following commands

[source code=””xml””]
MSBuild YourSolution.sln /p:Configuration=Release
[/source]

Note that you can use a path like MSBuild D:\src\YourSolution.sln for your projects. As you all know .NET provide two different type of output for each project, Debug & Release. To specify the type of output you can use following code

[source code=””xml””]
MSBuild D:\src\YourSolution.sln /p:Configuration=Release
[/source]

How to publish Asp web sites with command prompt

I wanted to run a Continues Integration for my company and I set up Team City at first. It is a great application which works very nice and I configured it easily. Unfortunately our portal is one of the old asp.net website so that I couldn’t use Team City to publish my website because it work just with Web Application.

Then I try to use MSBuild for compiling and publishing my website and it wasn’t a good solution in order to the type of projects. Finally I had to use AspNetCompiler. It is a compiler to publish and build Asp.net website and you have to customize it to work with your project. Here are steps in which I did to publish my website via command line.

1 – Create a XML file with desire name next to your Portal Solution (portal.sln). I use this name “AutomateBuildConfiguration.xml”.

2 – Then you have to configure this XML file with this instruction. For me following configuration was enough:

[source code=”xml”]
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="PrecompileWeb">
<AspNetCompiler
VirtualPath="/Web"
PhysicalPath="F:\Build_Automation\trunk\src\Portal\Web\"
TargetPath="F:\Build_Automation\trunk\src\Portal\PrecompiledWeb\Web\"
Force="true"
Debug="true"
FixedNames="True" />
</Target>
</Project>
[/source]

3 – You have to open one of the visual studio command line from this path :

StartMenu > All Programs > Microsoft Visual Studio 2008 > Visual Studio Tools > Visual Studio 2008 x64 Cross Tools Command Prompt.exe

I used a x64 system and chose above command line, you are free to use your own.

4 – change your path up to your XML file

5 – Use below command to publish your website

MSBuild AutomateBuildConfiguration.xml /p:Configuration=Release

6 – Enjoy your coffee, and after a while, It’s finished you already publish your website.

List of Software Development related Podcasts

podcast
podcast

Podcast is one of the most interesting innovations on the web. Usually technology pioneers trying to share their knoweledge or products to gain more attention or to earn more money. Some ones creates podcast in order to teach something freely or to challenge a technology. Podcast is a good way to share something with a group of people.

I was looking for an Audio Book and I faced with a bunch of good references, so that I decided toshare these references with you. These are some weblogs or websites in which you can find programming related podcasts or audio books.

Please Share Persian Software Development Podcasts link withus,If you know one.

1 – http://www.hanselminutes.com , Scott Hanselman is one of the most famous ones in the web who spent his time on producing greate podcasts. I personally usually listen to his podcasts. I wish he keep doing goods.

2 – http://www.dotnetrocks.com , If you have to choose only one website to follow, I strongly recommand this one. Greatest .NET pioneers are the guest of podcasts.

3 – http://blog.stackoverflow.com/category/podcasts , Stackoverflow is growing everyday, Jeff Atwood and Joel Spolsky publish a weekly podcast that you will get familiar with the nowadays issues. For sure you will amazed that how they are challenging.

4 – http://channel9.msdn.com , Microsoft is one of the leaders in software industry, and try to broadcast it’s developing from the inside out. The project managers talk about their projects and show you what will release in near future. It is one of my favourites.

5 – http://www.se-radio.net , Software Engineering Radio is one of those who want to challenge the software engineering issues.

6 – http://thirstydeveloper.com , Dave Bost and Clark Sell, usually goes in deep and speak very technical, they are really serious about their job.

7 – http://elegantcode.com , You can find lots of different topics here.

8 – http://www.code-magazine.com/codecast , A good reference for .NET developer,

9 – http://www.pluralsight.com/community/blogs/pluralcast/default.aspx , I couldn’t underestand that they want to go in detail or just introduce something.

10 – http://www.pragprog.com/podcasts I really like the subjects and interviews.

11 – http://polymorphicpodcast.com , David Starr is one of those who create podcasts about his interests. His podcast are not too much and he produce podcast a few.

12 – http://altnetpodcast.com , I just can say delicious podcasts.

13 – http://www.sparklingclient.com , It could be one of the greatest websites which produce podcasts for Silverlight.

14 – http://www.webdevradio.com , A good resource for web development.

15 – http://agiletoolkit.libsyn.com , As it is obvious they works on Agile toolkit.

This Post at StackOverFlow will help you to find a categorized Podcast websites.

Please Share Persian Software Development Podcasts link withus,If you know one.

Downgrading Report schema version and Report Viewer Nightmare

Nightmare
Nightmare

In most cases upgrading applications is a good idea, but in this week we have to downgrade our Reports to an older version. The scenario is that We had some SSRS 2005 reports in the past and we upgrade those to SSRS 2008 reports, so we actually upgrade our Report definition schema from 2005 to 2008 which I wrote an article about it at the past. Currently we decide to convert our SSRS server reports to Visual Studio Client Reports which has some benefit for us, but unfortunately Visual Studio 2008 use Older version of report schema and the nightmare begun here.

—————————————————————-

GNU Logo
GNU Logo

‪Title : Downgrading Report schema version and Report Viewer Nightmare

‪Publish Date : 09/05/2010

‪Version : 1.0

‪Author : Nasser Hadjloo

‪Author Mail : n.hajloo@gmail.com

‪Copyright (c) 2010 Nasser Hadjloo.

‪Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation;

‪with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.

—————————————————————-

SQL Server Reporting Services (all editions) and Visual Studio Reporting use ReportViewer control to display Reports, but it’s not the end, it’s just the beginning of a nightmare.

SSRS 2005 and Visual Studio 2008 & 2005 using 2005 Schema to create reports which is an older version of schema so that it missed some newer items which it’s obvious.

SSRS 2008 RDL reports use 2008 schema to create reports (in this schema we have some new features to create reports like Tablix or etc)

Visual Studio 2010 using Schema 2008 to create RDLC reports.

Report Viewer 2005 (& RV SP1) only understands 2005 schema and older versions.

Report Viewer 2008 understands 2005 schema and older versions. And there is no noticeable option which included in this version.

Report Viewer 2008 Service Pack 1, resolved some issues (installation and etc) and also apply some patches for some performance issues.

Report Viewer 2010, has a few limitation (won’t install in XP SP2 – only XP SP3 accept installation) but resolved all issues and works fine with Schema 2008. This version work very well with Asp.net Ajax and Ajax functionality like AsynchPostback and etc.

With these background, just imagine you have a SSRS 2008 report which implemented by schema 2008, and you want to convert it to VS 2008 Client Report which use older schema (2005). Following options may help to resolve the issue.

1 – Don’t Convert SSRS 2008 reports to VS 2005 or VS 2008 client report! Go and drink a cup of coffee.

2 – Convert SSRS 2008 reports to VS 2005 or 2008 reports and get rid of reports which may face with issues. (For example don’t convert reports which contain tablix or newer 2008 schema items).

3 – Create client reports from the scratch for those which face with issue.

4 – Upgrading VS 2008 reporting schema which I don’t find a solution for it. (take a look at here)

5 – Using Report Viewer 2010 with Visual Studio 2008, this scenario may resolve your common issues but in my case it wasn’t enough.

6 – Convert SSRS 2008 reports to Visual Studio 2010 client reports. (I think in most cases it would be the best option). It will work fine because VS2010 use schema 2008 for reporting system. But unfortunately this will force you to buy a VS2010 edition!

So what’s the best approach to convert SSRS 2008 report to Client reports?

First approach – to get rid of some reports and create them from the scratch with schema 2005

Second Approach – To use Report Viewer 2010 inside Visual Studio 2008

Third approach – to upgrade VS 2008 to VS 2010 and enjoy conversion, but you have to upgrade your host framework too.

In my case second approach was good enough to resolve issue, but I used third approach. In your case it may be a little difference and you have to make a decision.

I was also looking for a solution which let me upgrade VS 2008 schema version from 2005 to 2008, (see here) but there were no solution.

How To Convert RDL files to RDLC files

.Net use RDLC files for reporting and SQL Server (Reporting Services) use RDL files for reports files. In this Article we will take a look at RDL and RDLC files and also a way to convert RDL files to RDLC files.

—————————————————————-

GNU Logo
GNU Logo

‪Title : How To Convert RDL files to RDLC files

‪Publish Date : 06/05/2010

‪Version : 1.0

‪Author : Nasser Hadjloo

‪Author Mail :  n.hajloo@gmail.com

‪Copyright (c) 2010 Nasser Hadjloo.

‪Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation;

‪with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.

—————————————————————-

Comparison

1 – Both of them use a same XML schema called RDL (Report Definition Language). SQL Server Books Online documented this schema completely.

2 – “The ReportViewer control, which processes .rdlc files, ignores the <Query> element of RDL. If a report definition contains a query, the control will not process it. So A client report definition (.rdlc) file will only contain a query if it originated as a .rdl file.” MSDN said.

3 – DataSet and Data Source which used in RDLC and RDL files are totally different. RDLC (Client reports) use DataSet which actually is a DataTable and RDL (SQL Server Report) use DataSource which consist of a Data Source (actually connection String). Some Credential Information which used to access Database mentioned in Data Source and finally a SQL Command (StoreProcedure – Function …) or a Query which retrieve data from Database.

RDLC Report
RDLC Report

How To Convert RDL Files To RDLC Files

1 – As I mentioned before, both of these files are using RDL schema for representing items in a XML document, so in XML conversion there is no change. All the things you have to do, is to change RDL postfix to RDLC, commonly by Command Prompt.

2 – After that you need to Add this Report as an existing item to your Web project. (commonly in a report folder like “~/SystemName/Reports”)

3 – Next step is to create a dataset for this report, so create a DataSet File and put equivalent columns on it.

4 – At this time you need a method to retrieve data from Database and fill data on your DataSet.

5 – As you know, there is a Report Viewer control (actually an ActiveX) which get a Report and display itto user. So you need to create a page and use Report Viewer control on it. After including Report Viewer Control in the page, you need to assign your Report (RDLC file) to Report property of Report Viewer control. And also to assign your Dataset to DataSource property of ReportViewer.

6 – At the end you have to build project and check the results.

I wish this help you to convert RDL to RDLC files as easy as possible.

‪Hidden Features of C#

framework logo

Today I was surfing StackOverFlow froum and I faced with an excellent wiki. So I decided to mentioned that in this post. Note that following features are not introduced by me, those are introduced by whom which came after the keyword.

You can also add a new hidden feature to this list, if you missed it, in this list. and it is better to use these feature to improve our programming skills.

You can find the original post here.

—————————————————————-

GNU Logo
GNU Logo

‪Title : ‪Hidden Features of C#

‪Publish Date : 02/05/2010

‪Version : 2.0

Original ‪Author : [StackOverFlow]

‪Author : Nasser Hadjloo

‪Author Mail : n.hajloo@gmail.com

‪Copyright (c) 2010 Nasser Hadjloo.

‪Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation;

‪with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.

—————————————————————-

Here are the revealed features so far:

 

Keywords

yield by Michael Stum
var by Michael Stum
using() statement by kokos
readonly by kokos
as by Mike Stone
as / is by Ed Swangren
as / is (improved) by Rocketpants
default by deathofrats
global:: by pzycoman
using() blocks by AlexCuse
volatile by Jakub Šturc
extern alias by Jakub Šturc

Attributes

DefaultValueAttribute by Michael Stum
ObsoleteAttribute by DannySmurf
DebuggerDisplayAttribute by Stu
DebuggerBrowsable and DebuggerStepThrough by bdukes
ThreadStaticAttribute by marxidad
FlagsAttribute by Martin Clarke
ConditionalAttribute by AndrewBurns

Syntax

?? operator by kokos
number flaggings by Nick Berardi
where T:new by Lars Mæhlum
implicit generics by Keith
one-parameter lambdas by Keith
auto properties by Keith
namespace aliases by Keith
verbatim string literals with @ by Patrick
enum values by lfoust
@variablenames by marxidad
event operators by marxidad
format string brackets by Portman
property accessor accessibility modifiers by xanadont
ternary operator (?:) by JasonS
checked and unchecked operators by Binoj Antony
implicit and explicit operators by Flory

Language Features

Nullable types by Brad Barker
Currying by Brian Leahy
anonymous types by Keith
__makeref __reftype __refvalue by Judah Himango
object initializers by lomaxx
format strings by David in Dakota
Extension Methods by marxidad
partial methods by Jon Erickson
preprocessor directives by John Asbeck
DEBUG pre-processor directive by Robert Durgin
operator overloading by SefBkn
type inferrence by chakrit
boolean operators taken to next level by Rob Gough
pass value-type variable as interface without boxing by Roman Boiko
programmatically determine declared variable type by Roman Boiko
Static Constructors by Chris
Easier-on-the-eyes / condensed ORM-mapping using LINQ by roosteronacid

Visual Studio Features

select block of text in editor by Himadri
snippets by DannySmurf

Framework

TransactionScope by KiwiBastard
DependantTransaction by KiwiBastard
Nullable<T> by IainMH
Mutex by Diago
System.IO.Path by ageektrapped
WeakReference by Juan Manuel

Methods and Properties

String.IsNullOrEmpty() method by KiwiBastard
List.ForEach() method by KiwiBastard
BeginInvoke(), EndInvoke() methods by Will Dean
Nullable<T>.HasValue and Nullable<T>.Value properties by Rismo
GetValueOrDefault method by John Sheehan

Tips & Tricks

nice method for event handlers by Andreas H.R. Nilsson
uppercase comparisons by John
access anonymous types without reflection by dp
a quick way to lazily instantiate collection properties by Will
JavaScript-like anonymous inline-functions by roosteronacid

Other

netmodules by kokos
LINQBridge by Duncan Smart
Parallel Extensions by Joel Coehoorn

Visual Studio 2010 and .Net Framework 4.0 Download Links

Visual Studio Logo
Visual Studio Logo

This is not so far which Microsoft released VS 2010 and .Net Framework4.0. In the past post, I’d mentioned some of new VS IDE feature  and since release date I’d gathered a list from available online VS 2010. Here is the download list. Note that each link contain .Net framework 4.0 inside. 

—————————————————————-

GNU Logo
GNU Logo

‪Title : Visual Studio 2010 and .Net Framework 4.0 Download Links

‪Publish Date : 15/04/2010

‪Version : 1.0

‪Author : Nasser Hadjloo

‪Author Mail :  n.hajloo@gmail.com

‪Copyright (c) 2010 Nasser Hadjloo.

‪Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation;

‪with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.

—————————————————————-

File Type: EXE                                                             File Size: 48.1 MB 

Visual Studio 2010 Express Edition (Free) – This includes windows phone, C++, VB, C# and Web Developer 

File Type: ISO                                                              File Size: 693 MB 

VS 2010 Box
VS 2010 Box

Visual Studio Professional 2010 (Trial) 

File Type: ISO                                                              File Size: 2.19 GB 

Visual Studio Premium 2010 (Trial) 

File Type: ISO                                                              File Size: 2.27 GB 

Visual Studio Ultimate 2010 (Trial)

File Type: ISO                                                              File Size: 2.28 GB 

Visual Studio Test Professional 2010 (Trial) 

File Type: ISO                                                              File Size: 408 MB 

Visual Studio Team Foundation Server 2010 (Trial) 

File Type: ISO                                                              File Size: 1.56 GB 

If you are living on the countries which are under US government sanction, and also you don’t respect to human rights, you can easily install these trial version as a complete version! Vahid Nasiri is a Persian (.net) professional (actually a freelancer) who mentioned a way to install a complete version with trial setup files. You can read his article in Persian here, he used photo on the article which made this way as easy as possible.

Which Items an inhouse-Framework should have

There are dozens of frameworks on the world which many companies use them. In addition most of software developing companies have a in-house framework which designed to reduce costs (includes time with increasing a procedure, or other similar items) and increase development speed.

—————————————————————-

GNU Logo
GNU Logo

‪Title : Which Items an inhouse-Framework should have

‪Publish Date : 11/04/2010

‪Version : 1.0

‪Author : Nasser Hadjloo

‪Author Mail : n.hajloo@gmail.com

‪Copyright (c) 2010 Nasser Hadjloo.

‪Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation;

‪with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.

—————————————————————-

I don’t want to describe about a framework, but I tell a bit about it. And actually I will describe the necessary items which we have to put on our in-house framework.

What is an in-house framework? A framework which a company developed for a or the rest of his software’s, to increase functionality and share common procedures in all of his software’s. Note that a company may have a bunch of frameworks which provided for different kinds of applications.

framework logo

Which Items a Framework should have? This question has not a simple answer and in most cases we have to put on our in-house needs on it, but in most cases this framework should have some items which I’ll mention below. Note that you have to notice to your in-house needs to create an in-house framework and these items are not the only common items which your framework should have, these are only some of musts.

     1- Each framework should contain system base classes which our applications should use. Note that these are most common base classes and each base class which uses in just a class shouldn’t be here.

     2- Each framework should contain indeed Helpers which your company needs to use. For instance most of Iranian companies need a DateHelper which should convert Georgian calendar dates to Jalali dates.

     3- Each framework should have some classes to provide access to database. For example these classes should give an entity and save/update/delete/etc it from/to database. Something which ORM’s do nowadays but for your in-house framework it’s not bad to have some similar class if you do not use an ORM.

     4- Each framework should contain some Interface, abstract and other indeed enumerators which is common for all subsystems.

     5- A framework may have some common exceptions classes which may use in your business classes. Note that an exception which will use once on the system shouldn’t be here.

     6- Each framework should have a specific meaning, for example a developer should understand what your framework exactly can do?

The question which you may ask is that so where we should put our other classes which are not common? This is obvious; you have to put those in their application framework. The key point is that a framework will use in all of your subsystems and each application should have their own framework, so you have to put only common classes in the in-house framework and other indeed classes to their own application framework.

You can also add some other classes to your in-house application but note that they should be usable for the rest of your applications not only for a special application.

How to Change Asp.net Applications Theme programmatically

I’m interested to Localization and globalization and one of the important issues in localization is designing scalable UIs. in this Article I’ll show you a simple way to create a scalable Asp.net UI.

—————————————————————-

GNU Logo
GNU Logo

‪Title : ‪How to Change Asp.net Applications Theme programmatically

‪Publish Date : 30/12/2009

‪Version : 1.0

‪Author : Nasser Hajloo

‪Author Mail : n.hajloo@gmail.com

‪Copyright (c) 2009 Nasser Hajloo.

‪Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation;

‪with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.

—————————————————————-

in ASP.net2.0 microsoft present SKIN and Themes for Asp.net, in a short introduction, skin is a CssClass replacement and with skin you can specify some attribute that one of them are CssClass, and these other attribute goes in a *.skin file in App_Theme folder.

this will shorten back-end asp codes and makes it more readable and reliable and vice versa. in the other hand, Theme is a multi UI approach for asp.net application, with Theme you can create some different UI for you asp.net Application (Control) and the designer or back-end users select his/her desier UI from provided theme. in a theme you can create multi css classes or some skin files and in each skin file you can create many skins for a single control.

so with this short introduction, you (a a designer) can create different theme for a single application. and also can create some RTL and some LTR UI for your application (I always recommand to change HTML Directionality inside your css classes in html class like ).

[sourcecode language=”css”]
html
{
directionality: ltr; /* or rtl – base on page direction */
}
[/sourcecode]

usually creating an impressive UI is not a simple job and Ido not want to speak about that. Ithink you have created some Theme and now you want to let users select their theme by ownselves.

by default each theme should represent to each page to apply, this is possible inside <%@ Page %> decleration. you can represent your custom theme with Theme=”” attribute of page decleration. this apply your theme only for this page. and this let you apply different themes for different pages.

note that you can not use this approach in Master Pages.

you can change the theme for a single page programmatically, just note that theme (and skins) apply on page PreInit event. this will be a nightmare if you have more than 20 pages (just think about 300 Pages). so it is recommanded to use a Base class that it derived from System.Web.UI.Page and other pages derive from this class, so your base class should look like this

[sourcecode language=”css”]
namespace Hajloo.Web.UI
{
public class PageBase : System.Web.UI.Page
{
void Page_PreInit(object sender, System.EventArgs e)
{
if (Session["Theme"] != null && Session["Theme"].ToString().Length > 0)
this.Page.Theme = Session["Theme"].ToString(); // user selected theme
else
this.Page.Theme = "Hajloo_RTL"; // default theme
}
}
}
[/sourcecode]

the above code will apply a theme to the inherited pages, so now you should inherit your pages from this class. and all of your pages should look like this

[sourcecode language=”css”]
namespace Hajloo.Portal.Pages
{
public partial class Default : Hajloo.Web.UI.PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
[/sourcecode]

ok this will let you to provide a section for you user to select your provided theme from a list or by clicking on an image (below you can see some diffent method witchall of them change the current theme), and only in one page you need to put this code (usually in master pages or user profile)

[sourcecode language=”css”]
protected void drpThemes_SelectedIndexChanged(object sender, EventArgs e)
{
if (this.drpThemes.SelectedIndex > 0)
{
Session["Theme"] = this.drpThemes.SelectedItem.Value; // dropdownlist Items Value should fill with theme names
Response.Redirect(Request.Url.AbsoluteUri);
}
}
protected void imbPersian_Click(object sender, ImageClickEventArgs e)
{
Session["Theme"] = "Hajloo_RTL"; // theme name
Response.Redirect(Request.Url.AbsoluteUri);
}
protected void imbEnglish_Click(object sender, ImageClickEventArgs e)
{
Session["Theme"] = "Hajloo_LTR"; // theme name
Response.Redirect(Request.Url.AbsoluteUri);
}
[/sourcecode]

now you can check it out and enjoy from your multi UI application.