Thank you, Remote Desktop!

As I switch between 7 different servers located at 3 different location accross the country, it makes me realize how easy much of my work has been because of Remote Desktop. Some of the things I have been able to accomplished over the past 10 years were only possible because of Remote Desktop.

When I am at home, I am logged onto my desktop at work all the time, working as if I am sitting in my office. Sometimes I am logging into the servers from iPhone, and carry out emergency tasks!

Because of Remote Desktop, I only have to keep all my projects in one place, and no matter where I am, I can carry on my work as long there is a PC with an Internet connection. Last year I travelled for 2 months and visited 3 different countries, all the while keeping a connection to my workstation back in the office, and making sure everything is running smoothly.

So Thank you! Remote Desktop.

And thanks to all the people who are behind it.

Posted on November 15, 2011 08:27 by Haider

HtmlTemplateBase<> For the RazorEngine on CodePlex

The RazorEngine project on CodePlex is a powerful Templating library that utilizes the Razor Syntax. If you are trying to use this library and wondering where is the HtmlTemplateBase<> as it is shown on the project's page, it does not really exist! That code snippet on RazorEngine's home page is an example of what you could possibly do with that library.

There is a thread on the project's discussion board where this is being discussed. Apparently no one had time to put it together.

So I wrote a version of my own HtmlTemplateBase<> that supports the Html Helper and ViewBag. You should be able to add Ajax Helper if you need it. I won't go into much details, as the code should be self explanatory. I am not saying this is the best way to do it, but it works.

HtmlTemplateBase<>

Using the HtmlTemplateBase<>

Make sure this class is part of your Web/MVC Project. It will work in the context of a WebPages (MVC) only, unless you tweak it a little to work on WebForms. It's fairly simple to use this as the Template base class. Before parsing any Template, use this single line of code:

Notes

  1. This will add support for Html.EditorFor<>(), Html.EditorForModel<>() etc. within your Template.
  2. The Html Helper in your template will use the Model and Model Type that you use for the Template, not the Model Type of the Webpage it is being parsed in. Of course they can be the same. Much like the Html.Partial() helper method.
  3. The ViewBag will have all items added at the Page level prior to parsing the Template. You can set ViewBag items within your Template and they will be available at the Page level once you parse/execute the Template. However, if you set an item using ViewData["..."] = Value within your Template, it will not be available with ViewBag.ItemKey, within your Template, or outside the Template.

Hopefully this code will be enough to get you started on this.

Posted on September 29, 2011 03:33 by Haider

Australia's Dojo Directory: dojos.com.au - An ASP.NET 4, Ajax Website

Looking for a production site that utilizes ASP.NET Ajax and Ajax browser history feature? Checkout the paging functionality of dojos.com.au. This is a Dojo Directory featuring Martial Arts Schools in Australia. There is also Martial Arts Style statistics for various cities in Australia.

The Website uses ASP.Net Ajax features in various places, including the paging, review submission etc.

dojos.com.au allows Martial Arts School owners, instructors and associates to register and update school information, free of cost. If you are associated with a Martial Arts School in Australia, make sure your school is listed with dojos.com.au. You will be a part of a global network of Martial Arts Schools featuring about 24,000 Schools.

dojos.com.au also features pages for each city and State in Australia, featuring Martial Arts Schools and Martial Arts Styles in those locations. Checkout the page for Sydney, Australia.

Posted on September 25, 2011 04:24 by Haider

Where is Bing Maps Heading?

Bing Maps API has a  Control (Javascript Plugin, not to be confused with .Net or ActiveX Controls) that you can embed in Websites. About a year ago they released version 7.x of this api/control which supposedly is upto 300% faster than the previous version, and way cooler.

So for a recent project that uses Maps, I decided to look into the new version. After working with it for a couple of days, I realized that it is practically useless! First, many of the features have disappeared. Some of these features were the main reasons to choose Bing Maps over Google Maps. In addition, that illusive 300% increase in speed, I couldn't see it! Maps appear to load slower than before.

But thats not it, now you have to register each of your Website/Domain and get a Key to make the Maps work. If you didn't know, Google Maps DOES NOT require an API Key with its latest version. While Microsoft is trying to be like Google in this aspect, Google has already moved on from it.

Meanwhile, the Google Maps API version 3.x starting to look much nicer, loading fast, not requiring an API key, and enough flexible in terms of programmability.

Whoever is responsible for the changes in Bing Maps API, did not make smart decisions. I say that not just as my opinion. I have looked around and found enough discussions on these topics to know this is the general feeling of the developers.

So after wasting two days of work, I am back with the older version of the API, and if I am to upgrade to anything in the future, it will most likely be Google Maps.

May be someone will take note, and change the directions?

Knowing Microsoft, I don't think so.

Posted on September 23, 2011 03:52 by Haider

Canada's Dojo Directoy: www.dojos.ca

There is this Website recently launched as a part of dojolocator.com's global initiative. It is intended to be the Dojo Directory for Canada. The Website address is www.dojos.ca

The .ca authority allows second level domains, unline the .uk authority, therefore it was possible to acquire dojos.ca, short and sweet!

This Website currently features about 1,600 Martial Arts Schools, and provides Martial Arts Style Statistics in various Cities and Provinces of Canada.

The Website is built with ASP.NET 4.0 and C#. It uses SQL Server 2008 R2 for database. The site is hosted on a 64bit Windows 2008 Web server.

Martial Arts School owners in Canada can list their schools with dojos.ca, absolute free of cost. The dojolocator.com network attracts well over 100,000 visitors every month, and serves as a valuable resource to the Martial Arts community.

Posted on September 13, 2011 06:08 by Haider