Browse by Tags

All Tags » c# (RSS)

How to Allow Generic Controls in ASP.NET Pages

Did you ever want to have a Repeater<Customer> control on your page? And its events were all strongly typed to recognize that each row was bound to a Customer object? Well, I came up with a way of doing it using some lesser known features of ASP...
Posted by Eilon | 18 comment(s)
Filed under: , ,

Using C# 3.0 Anonymous Types as Dictionaries

During a design meeting for a new feature in ASP.NET we had a requirement that a new method accept a dictionary of name/values pairs. An obvious solution is to have the method accept a parameter of type IDictionary (or its generic cousin): public static...
Posted by Eilon | 54 comment(s)
Filed under:

Changing the request culture for globalization and localization

In ASP.NET 2.0 we added several new features to make globalizing and localizing an application easier than ever before. One of the coolest features is the ability to declaratively localize entire controls as well as individual properties of controls....
Posted by Eilon | 4 comment(s)

Testing your ASP.NET control (part 1 of hopefully many): ViewState

A typical ASP.NET server control will store at least some of its properties in ViewState. For example, the Label control saves the value of its Text property in ViewState so that on following postbacks the value does not need to be explicitly set again...
Posted by Eilon | 3 comment(s)
Filed under: , ,

Using ObjectDataSource to do the dirty work for your custom data source

Since ASP.NET 2.0 was released in 2005 many of you have taken advantage of the new data source control controls . Drop a GridView on the page. Bind it to a data source. Check a few checkboxes. Run the page. Go home early! However, some of you want to...
Posted by Eilon | 12 comment(s)
Filed under: , ,

Attributes to consider applying when writing a custom control

Almost every custom control has at least one additional public property, and that public property as well as the control itself should probably have at least a few attributes applied to them. Attributes tell the designer host (Visual Studio) or the parser...
Posted by Eilon | 3 comment(s)
Filed under: ,

From the Suggestion Box: Reusing object instances with ObjectDataSource

From the suggestion box Marc Brooks asks: "More about the needed fixes for ObjectDataSource (e.g. allowing it to acquire the object instead of creating exnilo)." In fact, the ObjectDataSource already supports this functionality through its ObjectCreating...
Posted by Eilon | 4 comment(s)
Filed under: , ,
More Posts