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

August 2007 - Posts

Update on Website Menu + web.sitemap: A smart combination

I have updated the code I presented yesterday in: Website Menu + web.sitemap: A smart combination to handle pages that are not listed in the web.sitemap. Here is the updated code in bold: private static string GetSubRootNode() { // Get the current code

A new starter-kit on the way ...

I have been working for 2 weeks on a new community starter kit. I am almost done with the major functionalities! Still having few stuff and clean up to do and testing. I am still not sure where I will announce it, but for sure I will be sharing it with

Website Menu + web.sitemap: A smart combination

I am working on a website that contains a main menu on top. In addition, I am making use of the SiteMapPath to show a breadcrumb that helps the user while browsing the website. I might have the following heirarchy in the website: Default.aspx Articles.aspx

LINQ To SQL and Allow Null in SQL Server 2005

I figured out tonight something new in LINQ To SQL related to updating records in the database and here it is: Suppose you have a table in SQL Server 2005, that stores data related to Article. Each article has the ArticleID, Body, Abstract, title, etc
Posted by BilalHaidar [MVP] | 0 Comments
Filed under: ,

ASP.NET 2.0 AJAX Shorthand Syntax

A very nice blog post by Joe Stagner on the existing ASP.NET 2.0 AJAX Shortcuts can be reached here: http://joeon.net/archive/2007/08/16/ASP.NET-AJAX-Shorthand-Syntax.aspx It is a must-read post!! Regards
Posted by BilalHaidar [MVP] | 0 Comments
Filed under:

Extension Methods in C# 3.0 and ASP.NET Code-Inline

I was customizing a ListView today to show a small key gif beside each article listed to indicate that the article requires a login to be viewed based on whether the user is authenticated or not. So I decided to use inline checking to see if the current
Posted by BilalHaidar [MVP] | 0 Comments
Filed under: ,

Deferred Loading in DLinq - Orcas Beta 2

In a previous post of mine (Deferred Loading in DLinq - http://bhaidar.net/cs/archive/2007/07/26/deferred-loading-in-dlinq.aspx ), I explained to you how deferred loading works in DLinq. There have been some changes to the object used to enable/disable
Posted by BilalHaidar [MVP] | 1 Comments
Filed under: ,

Extend System.Web.HttpResponse with a WriteLine method

While working with Console applications, you always use Console.WriteLine. I always got bothered why the HttpResponse has only Write or WriteFile. Why can't we have WriteLine? Many times you need to print something on a web page and also print a break
Posted by BilalHaidar [MVP] | 0 Comments
Filed under:

How to Load XML using System.Xml.Linq

I have been blogging for a while on C# 3.0, DLinq, and now it is time to blog about XLinq. In this post, I will show you how to load an XML file using the new XML namespace: System.Xml.Linq. This sample loads an XML for a menu on a website (under development),
Posted by BilalHaidar [MVP] | 0 Comments
Filed under:

Intellisense in VB.NET vs. C#

I have been watching few videos on LINQ nowadays and most of the demo code in those videos is written in VB.NET. I noticed that there is a big intellisense support for VB.NET LINQ Query Expressions. For instance, when you write: var query = from c in

ASP.NET ListView

Have a look at this nice video by Dan Wahlin on the new ASP.NET control included in the Orcas release: ASP.NET ListView, which combines the features of the GridView and Repeater in addition to having paging, update, etc ... http://blogs.interfacett.com/dan-wahlins-blog/2007/8/2/video-using-the-new-aspnet-listview-control.html

Windows Forms inside Windows Service

In a windows service that I was creating, I needed to show a Windows Form at some point and that was not working since the Windows Service operates on a background thread other than the one handling the desktop applications. So the way to go in order

LEFT OUTER JOIN in LINQ To SQL

I was practicing a little bit on using Linq to Sql, and had this scenario: Customers and Orders tables in Northwind Database. I added a new customer with no records, I wanted to apply a left outer join to get customers whose CustomerID starts with letter
Posted by BilalHaidar [MVP] | 4 Comments
Filed under: , ,