Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 3rd, 2008, 09:12 AM
Authorized User
Join Date: Sep 2005
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default Default values when setting up an object data sour

There are times when I need to set a default value when configuring an object data source. I would prefer to use a symbolic constant instead of hardcodeing a value in the default value textbox.

For instance, with the object data source that I am currently working with I need to set a default value of "WHSE". Rather then hardcoding "WHSE" I would prefer to set the default value to something like: Globals.TypeCodes.Warehouse which is defined as:

public static class Globals
   public struct TypeCodes
       public const string Warehouse = "WHSE";

Is there a way that I can use Globals.TypeCodes.Warehouse instead of harding "WHSE" or is hardcoding an acceptable practice in the case?


ps. I am aware that I can do this in the Selecting event of the object data source. I am hoping there is a way to do this by configuring the object data source.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting default value in drop down. rupen Classic ASP Basics 4 July 3rd, 2014 02:00 AM
Setting Default values of DataGrid in C#2005 saxitalis C# 2005 0 August 15th, 2007 03:33 PM
setting default values prithvi28 XSLT 1 October 3rd, 2006 01:38 PM
How To Populate ListBox from a Secondary Data Sour luca ASP.NET 1.0 and 1.1 Basics 4 December 1st, 2004 05:24 PM
setting default month jtyson ASP.NET 1.0 and 1.1 Basics 1 June 30th, 2003 12:44 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.