August 2006 - Posts

The easiest way to rewrite Url without using HttpHandlers is to use Application_BeginRequest in global.asax file. You can write it in few lines of code.
protected void Application_BeginRequest(object sender, EventArgs e) {
        String currentPath;
        String customPath;
       
currentPath= Request.Path;
        //if the URL contains this folder name then handle the request
        if (
currentPath.IndexOf("Vendors/Microsoft") > -1) {
           
customPath= "ShowVendors.aspx?VendorId=" + Path.GetFileNameWithoutExtension(currentPath);
            // rewrite the URL
            Context.RewritePath(
customPath);
        }
    }

Posted by Ludmal De Silva | with no comments
Dialog has officially launched its 3G service today. You can get a free 3G sim for the same number you have. Im worried coz my phone doesnt support 3G(Motorola Razor). Anyway I will be getting a new 3G phone sooon.
You can easily parse string value to enum value. below is the code.

public enum Mode {
    Insert, Update, Delete
}

Mode mode = (Mode)Enum.Parse(typeof(Mode), "Insert", true);

Posted by Ludmal De Silva | with no comments