Welcome to Bilal Haidar [MVP, MCT] Official Blog Sign in | Join | Help

March 2006 - Posts

DateTime Formatting in ASP.NET 2.0

This is a nice summarized sample code on how to format DateTime instances: // This code example demonstrates the String.Format() method. // Formatting for this example uses the "en-US" culture. using System; class Sample { enum Color {Yellow = 1, Blue,

MVP Open Days - UK 2006

I have been in UK for 3 days. I arrived to London on Saturday March 25th, spent lovely two days in the streets of London, and today we started our first day in the MVP Open Days in Cambridge City, Microsoft Research Labs. I will be posting a looot of

Protect Configuration Sections in Web.Config

As you know, mostly developersdo place the connection string inside the web.config file. Sometimes, we need to use a username/pwd in the connection string and not only use Trusted Connection. It is always recommended to protected those areas inside your

CurrentCulture & CurrentUICulture

There has been always a popular question on the ASP.NET forums about the difference between CurrentCulture and CurrentUICulture. I wanted to distinguish things in this post and make it clear once and for all. CurrentCulture and CurrentUICulture are both

Top X Records with XMLDataSource

I had a question from a friend of mine at work, he's using the DataList with the XmlDataSource. He wanted to get the Top X records fro the XML file to show them in the DataList, so here is a simple way of doing so I found after doing some search online:

MasterPages and Browser Detection

A very nice feature of MasterPages in ASP.NET 2.0 is the ability of the ASPX page to detect the browser and render a specific MasterPage for the specific browser. How is that done? As follows: <%@ Page Language="C#" Mozilla:MasterPageFile ="MozillaMasterPage.master"

MVP'd Again

I knew today that I have been MVP'd again as an MVP in ASP/ASP.NET for the second consecutive year. Thank you for putting your trust in me for the second time, Regards

Server.MapPath Analysis

While working with the HttpContext.Current.Server.MapPath(), I discovered something which is that, the MapPath method starts seeking a path Starting from the current directory you are in and not directly from the root directory. Hope this hint helps,

How to use "NOT" in SQL Queries

While wokring with C# or VB.NET, we sometimes implement a switcher-statement. For example, in a certain if statement, we need to flip the state of a certain boolean value as: bool isValid; if (State == 2) { isValid = ! isValid; } This way, we will flip

HttpHandlers, HttpModules, and the FormsAuthentication

I have been working on a G lobal E rror L ogging & H andling solution for a web application that is part of a huge system we have been developing in my company. I used an HttpModule to get attached to the Application_Error event, where I instantiate

Using Method inside a DataGrid or GridView TemplateField

Sometimes there is a need to do some action on a field returned from the database and displayed inside a TemplateField inside the DataGrid or GridView columns. For example, you might have an email address inside your database and you want to set the HREF

AddMessageModule in DotNetNuke

I was developing a Custom Registration Module in DotNetNuke. I followed the same technique used in the default registration module that comes with DotNetNuke, however, I had to do my own cutomizations and using my own tables and objects. I noticed the
Posted by BilalHaidar [MVP] | 2 Comments
Filed under:

Difference between NULL and DBNull

I have always misunderstood the difference between NULL and DBNULL until recently while I was working on ASP.NET web application, and was talking to a Webservice and I found an exception coming from one of the web methods inside the Webservice which is

ASP.NET and DNN Website deploy

When you developer an ASP.NET web application or a DotNetNuke application, you will be having all types of file extensions: .csproj .cs .vb .su .sln etc ... So, imagine you are developing a huge web application or even a DotNetNuke website and now it

Debug a DotNetNuke Modules

While developing Custom Modules in DotNetNuke, there comes a time where you need to debug your modules, or specific user controls. You can download the dnndebug.aspx page from the following link: DNNDebug.aspx All you need to do is place this aspx page
Posted by BilalHaidar [MVP] | 0 Comments
Filed under:

I am back . . .

Hello: You might be asking where I have been all this time. Well, I have been away a bit from posting, first for getting some sickness which I am over it by now and second, I was working on a community website for Microsoft in the area of Middle East.
Posted by BilalHaidar [MVP] | 0 Comments
Filed under: