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

Browse by Tags

All Tags » ASP.NET 1.x   (RSS)

Server Variables

I always find a difficulty in remembering all the server variables and how they can help me, here is a list of all the server variables I ran in a testing application. You will see the server variables with a sample data coming from the testing application:

Concurrency in ADO.NET

During my reading to the Microsoft ADO.NET Core Reference by David Sceppa I am getting to learn so many things, among which ways to handle concurrency Options: 1- Include only the Primary Key Columns This way, when User A and User B both read the same
Posted by BilalHaidar [MVP] | 0 Comments
Filed under:

HttpSessionState and ASP.NET Exception

A nice trick I read in the ASP.NET 2.0 Core Reference is that, when an exception occurs at the end of the request, that is the GetLastError of the Server object returns an exception, the Session data is lost, however, in your handler of the Exception,

Store C# Collection in XML

While developing a multi-threaded Web Application, I had the need to store my collections generated in multiple thread somewhere. I tried the CACHE in .NET, however, threads do block the whole CACHE and notonly an item in the CACHE, so as usual, the solution
Posted by BilalHaidar [MVP] | 0 Comments
Filed under:

Filter Collection of Objects

I have been developing an API for an application of mine at work. The API returns a set of objects in the form of Collections. I needed a way to filter the collection based on some values I provide. I have passed by this blog post: http://codebetter.com/blogs/brendan.tompkins/archive/2004/09/02/24116.aspx

Session_End and HttpRuntime

I had a need few days ago to delete some files in the Session_End. As you know, Session_End will be fired, even if the client's session ends, because the Session is based on the Server and therefore, after the Session times-out the Session_End on the

Looping Through Page Controls

A very common question on the ASP.NET forums, is how to loop through the page controls, and find dynamically my control! Here is the solution, its R E C U R S I O N !! A very simple example, that loops through the page controls, and once it finds a Panel,

String Enumeration in C#

I have always had the need to use String Enumerations. What do I mean by that? Suppose we have this Enum Type: public enum StringNames { Bilal, Wessam, Elsa, Samer, Tarek, Farah, Firas, Mohammad } In my code, I would like to have something as: string

Modal Dialog Window Caching Problem

Hello: Suppose you open a Modal Dialog window inside your ASP.NET page. In that dialog window, you have a GridView, DataGrid, or whatever control. Do some changes on that control, you will see that the data has changed right? Ok, then close the dialog

Define Custom Events in UserControls

A very common question on the ASP.NET forums is: How to define an event in a UserControl, and process this event in the Page holding this UserControl? The answer is simple, follow this post, and you will be able to define your own events very easily.

Define a Custom Event inside UserControls

If you are working with either a new custom server control or a normal web user control, this is the proper way of adding an event that can be handled by the parent control of the child control you are develping: Add the following to the control (Server

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,

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

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,

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
More Posts Next page »