Saturday, April 25, 2015

PDF417 Test Url

Wednesday, January 30, 2013

Calling Javascript from Content Page

Is it really easy with play with JavaScript? for instance, If you have a content page within or referencing a master page. your content page has a drop down box and a text field.

You want to show or hide the text field based on the drop down box contents.

Let's say the drop down contain a list of airports for the user to choose from. only if the user chooses the value other in this drop down, you want to show the text field.

It may not be as simple as

if (dfcDropDown.Text == "Other") dfsTextBox.Visible = True; else dfsTextBox.Visible = False;

It will be little more involved than that.

First you need to write a function in Java script. This funtion you can not just put it anywhere in the aspx. you have to put it under the asp:Content tag. which might look like this

<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">

Second you need to make a java script block and write your function using GetElementById. When calling getElementById, the Id of the control will be little tricker. you can not as a matter of fact put the Id of the control directly. you must use a syntax like this &lt;%=dfcDropDown.ClientID%&gt; to get the name of the control at run time. Here is a sample Javascript method that will hide the text box based on the drop down box value

<script type="text/javascript">
           function ShowHideTextBox() {
           if (document.getElementById('<%=dfcDropDownBoxt.ClientID%>').value == "Other")
               document.getElementById('<%=dfsTextBox.ClientID%>').style.display = 'none'; //hide textbox
               document.getElementById('<%=dfsTextBox.ClientID%>').style.display = 'block'; //show textbox

Now, we have a code that will do what we need and we need to trigger this code when the use changes the value of the drop down box. well, we can not hook this code directly to the drop down box from within the aspx. we have to use the code behind to do that. it turns out that the onChange event is not available from within the aspx page. We must hook the onChange event using c# like this

 dfcdropDown.Attributes.Add("onChange", "ShowHideTextBox();");

and we must do this in the code behind.

Not that simple haaa;

Wednesday, March 14, 2012

Reactive Extensions Gems

As I am learning about reactive extensions I want to post some code that I think is useful. Before using the code here you may want to download Reactive Extensions for your .Net Framework version. It is located at

What it does: it will call a method called DoSomething that acceptes one parameter of type long.
What can you do with it: You can use this line to call the DoSomething every second and send emails for example. before this line you can retrieve the list of customers to send emails to, and every second grab one customer and send email to him/her

What it does: Call a method every second after waiting for three seconds initially.
What you can do with it: You can send emails to customers after waiting a specific perdiod of time.

Wednesday, February 08, 2012

Silverlight Gems


System.Windows.Browser.HtmlPage.Window.Navigate(new Uri("")); //You can use "_blank" as a second paramter to popup the in a new window


Monday, February 28, 2011

Tips for Pilgrimage to Mecca

I already wrote my experience in the Hajj of 2010 which was in Arabic and can be found here, I still have some more tricks and tips that can make your trip a lot easier. Those tricks has to do with making phone calls, transportation etc...

You should take with you

1- Odorless Soap, so you can wash after going to the toilet. You will not have time for shopping and may not find what you need.

2- Hair cutter, when you need to cut your hair you will find everyone busy and expensive. Imagine millions are looking for barbershops.

3- Towel, Some of the temporary hotels you will stay in will not provide towels. Also in the tents you are on your own.

4- Container for Zamzam water. If you buy containers from there, you will have to walk to find a store and it will be expensive.

5- Your laptop. Usually hotels will have Wifi and you can call your family using any VOIP

6- Bring your VOIP telephone (Or Magic Jack), you can connect it to the hotel internet and call your family.

7- Bring your cell phone (some people says don't because you will lose it, I'd say bring it but don't take it outside the hotel). You can get STC SIM card for 40 Rial (Pre loaded with 50 Rial)and call 902 they will give you daily internet on you SIM card. 10 Rial for one hour or 24 Rial for the whole day. They will send you a message if you click the link on it, it will setup your tel. Make sure your tel support arabic otherwise ask them to send you the message in English.

8- More than one Ihram cloth. you will need one more and washing them is the same as buying new ones. I would say bring three total.

What to do

1- When finishing tawaf try to get out gradually. if you find yourself on the 7th round and close to Kaaba try to exit the tawaf gradually and not one time.

2- After your done with Jamarat continue walking and you will find yourself out

3- in your telephone always bookmark the important locations in the map. with your GPS you can go back. Places like your tent will be ex termly important when you get lost. bookmark the location of el 7aram so you can go back to it if you get lost.

4- Go to Tan3eem to make another Omra (you can make Omra any number of times) Tan3eem bus is two Rial each way.

5- Best times for Omra (7aram will be kinda empty) 9-10 AM , 1-3 AM, 1-3 PM

6- If you are with a group, then hold hands during tawaf. you will support each other and will not fall.

7- Be vigilant they will ask women to sit in a separate area close to prayer times. If you sit beside your wife and hoping you will pray beside each other, it may not happen. They will ask women to leave their space and go somewhere else. If you are looking for a place for prayer and you see some women sitting there you can wait and take their place when they ask them to leave.

8- In Medina, best times to pray in Rawda 1:30 AM. stand b Seddek Door, they will open at 2:00 AM

9- Do not take Taxi's just wave to any car, it will stop and you can negotiate the price to go anywhere.

10-If you will take the bus from Azizia to Mena, and the bus will make two trips. get in the second trip not the first. The first trip the guide may get lost, so do not go in the first trip unless you enjoy getting lost.

11- If you can have a motor cycle for the last day of Hajj or bicycle, you will be a king in transportation.

Here is a summary for Hajj days.

Day 8 Thu Hejja (Tarwiya): sleep in Menna, wakeup at 5:00 am. Fajr prayer then bus to Arafat.

Day 9 Thu Hejja (Arafa): stay in arafat untill Maghrib, then bus to Muzdalafa, sleep in Mozdalafa in sleeping bag

Day 10 Thu Hejja (El nahr or Eid): Bus to Mena, then walk (3 Km) to Jamarat, throw first Jamara and Tahallom from Ihram.

Day 11 Thu Hejja (Tashreek Awal): Throw three Jamarat.

Day 12 Thu Hejja (Tashreek Thani): Throw three Jamarat. Tawaf Wada3, Ifada, Sa3i and leave to Airport if you are Mota3agel.

Friday, February 18, 2011

VSS2005 to TFS2008 Migration steps

Migration for VSS to TFS is covered in may articles on the internet like this favorite post. However most of the tutorials does not come with a lot of screen shots. Here in this post I am posting screen shots to help you along the way.
If you create a specific folder for the migration then it would look like the following. and you may create a folder for your project which will contain your usermap.xml

Then you should open your VSS database that you want to migrate using VSS2005. your database in VSS should look something like this.

Then in your project folder, create the AnalysisSettings.xml and MigrationSettings.xml and should probably call them from a batch file. Your folder should look something like this


Then you should be able to run your analyze.bat. The analysis will begin and will ask for administrator password as follows

it will then start the scanning and produce usermap.xml

You can then run the Migrate.bat after modifying your usermap.xml. Migration will start

and then complete as follows.

Thursday, February 03, 2011

RFID operation

It is very interesting to know how RFID's work. Those Id's you hold in your hand and they can be read remotely from a near distance. For sometime I was not really excited about their operation but became super excited to learn that they transmit the information. Home come they transmit anything if they do not have batteries. Then comes the next part, they do not have batteries but they receive power from the reader which is another fascinating idea. Here is the full details of how the RFId work. RFID's are now used in many applications (ex. Passports, Credit Cards, Security Cards, Transponders, etc....)