The Best Web Hosting Company in Bangladesh gets a new Website!

Alpha Net, the company with best Web Hosting Infrastructure available in Bangladesh, has just launched a new Website: alpha.net.bd. This new Website features a clean layout with separate sections dedicated to the company's Hosting, Domain Registration and VPS services. It also offers online ordering of Hosting & Domain Registration in Bangladesh. Something that was not possible in the previous version of their Website.

Among other things, the Website features .bd whois lookup. In case you are interested in registering a .bd Domain, you can order it through Alpha Net.

Alpha Net recently upgraded most of it's hosting infrastructure, now offering Gigabit up-link and VPS with up-to 16 Processor Cores and 16GB DDR3 RAM. The newest server is based on Windows 2012 and features 32 Xeon E5 processor cores, 128 GB ECC Registered RAM @ 1600Mhz, and 12 Tera Bytes of Enterprise storage.

Many corporations in Bangladesh are now choosing VPS over shared hosting. Specially with recent row of hacking and security concerns.

Alpha Net's Managed VPS services allow corporations to afford a full featured dedicated Web Server without the expertise of server configuration/management.

 

Posted on February 4, 2013 10:49 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.

Some people commented that it does not work in Winform. This is not intended for Winform context. I do not need it in Winform at the moment and haven't looked into an implementation that would work outside of HttpContext/WebPageContext. Sorry!

HtmlTemplateBase<>

/*** HtmlTemplateBase<> ***/
/*** Author: Abu Haider 
/*** September, 2011
/*** To be used as the Template base with the RazorEngine on CodePlex
/*** http://razorengine.codeplex.com
/*** Copyright 2011, Abu Haider, www.haiders.net
/*** Use at your own risk
/***/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using RazorEngine;
using RazorEngine.Templating;
using System.Web.Mvc;
using System.Web.WebPages;

namespace System.Web.Mvc
{
    [RequireNamespaces("System.Web.Mvc.Html")]
    public class HtmlTemplateBase:TemplateBase, IViewDataContainer
    {
        private HtmlHelper helper = null;
        private ViewDataDictionary viewdata = null;
        private System.Dynamic.DynamicObject viewbag = null;
        
        public dynamic ViewBag
        {
            get
            {
                return (WebPageContext.Current.Page as WebViewPage).ViewBag;
            }
        }

        public HtmlHelper Html
        {
            get
            {
                if (helper == null) 
                {
                    var p = WebPageContext.Current;
                    var wvp = p.Page as WebViewPage;
                    var context = wvp != null ? wvp.ViewContext : null;
    
                    helper = new HtmlHelper(context, this);
                }
                return helper;
            }
        }

        public ViewDataDictionary ViewData
        {
            get
            {
                if (viewbag == null)
                {
                    var p = WebPageContext.Current;
                    var viewcontainer = p.Page as IViewDataContainer;
                    viewdata = new ViewDataDictionary(viewcontainer.ViewData);

                    if (this.Model != null)
                    {
                        viewdata.Model = Model;
                    }

                }

                return viewdata;
            }
            set
            {
                viewdata = value;
            }
        }
    }

}

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:

    RazorEngine.Razor.SetTemplateBase(typeof(HtmlTemplateBase<>));

Notes

  1. This will not work in Winform context, because it uses the current WebPageContext for some of the functionality.
  2. This will add support for Html.EditorFor<>(), Html.EditorForModel<>() etc. within your Template.
  3. 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.
  4. 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

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

ASP.NET RAZOR Hosting in Bangladesh

The new RAZOR view engine available along with ASP.NET MVC3 marks the beginning of a new era of ASP.NET. A decade ago, ASP.NET 1.0 was released along with .Net framework 1.0, and for over 10 years, ASP.NET Web Forms (Now being called as Web Forms View Engine) was the only option for Web Development with ASP.NET. While the RAZOR view engine on the surface may look like just a simpler and easier set of syntax for dynamic pages, it actually makes fundamental changes to how web development has been with Web Forms so far.

If you are located in Bangladesh and developing with the RAZOR view engine and MVC 3 framework, you are going to need a reliable Web Host offering these features, preferably on Windows Server 2008 and IIS 7.x (not Windows Server 2003 and IIS 6.x). Take a look at Alpha Net's offerings of ASP.NET hosting in Bangladesh. Alpha Net has been offering Windows based hosting in Bangladesh since 2001, and their infrastructure is constantly upgraded to keep up with the latest in technology. Their ASP.NET hosting is on a 64bit Windows 2008 R2 platform along with SQL 2008 R2 64bit Databases. Another unique feature is that they give you a VPN tool to securely connect to the database server and work as if it is on your local development machine. They also offer Windows VPS in Bangladesh.

This is Alpha Net's 10th year in service and innovation. They are running some interesting promotions to celebrate their 10th year in business. Contact them to find out more.

Hope it helps.

Posted on August 24, 2011 05:56 by Haider