DCSIMG
ASP.NET - Wortzel's blog

Wortzel's blog

.Net (2.0, 3.0, 3.5), C#, Asp.net, Com+, GIS(ESRI Software), Management, Analysis & Design, Life, Trips, And more...

Browse by Tags

All Tags » ASP.NET (RSS)
Bind an Enum
It's very useful to take an enum and bind it into bind-able controls (like drop down list, check box, grid view and etc). For example, if we have an enum which represents bug statuses and you want to bind it into a drop down list. public enum Bug { Opened = 1, Closed = 2, Rejected = 3, Resolved = 4, InProgress = 5 } In addition, usually in a UI we want to separate between the enum words (for example to change the "InProgress" to "In Progress"). I search over the net and I...

Posted Monday, August 25, 2008 4:19 PM by Avi Wortzel | 7 comment(s)

How to add a custom configuration section
It's a best practice to work with strong types instead of typing the name of the class/properties by our own hands. One of the common places that we are usually typing a string is when we're retrieving data from configuration file. In this post I will show you how to declare a custom configuration section with a strongly typed class. 1. Declare the configuration section in configuration file: < configSections > < section name = " serviceSettings " type = " ServiceSettingsHandler...

Posted Tuesday, October 23, 2007 8:34 AM by Avi Wortzel | 6 comment(s)

How to declare a javascript file as an embedded resource in assembly
There are many scenarios it is recommended to use an embedded resource which is part of the assembly. One of the common cases is having a custom control with custom script file and wanting to ship them in a close assembly to other projects. Thanks to deployments reasons we prefer to ship only the assembly without the other resource files. There is a simple approach to do it in .Net 2.0. Ok, what do we have to do in order to accomplish this task? Assumptions: - We have a custom control which is called...

Posted Wednesday, June 13, 2007 8:34 PM by Avi Wortzel | 4 comment(s)

תגים:, ,