473,387 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Setting bit flag enum value in aspx file ?

Using dotnet 2.0. Say I have a user control like the following :

public partial class Controls_MyControl : System.Web.UI.UserControl
{
[Flags]
public enum SomeBitFlag
{
OptionA = 0x01,
OptionB = 0x02,
OptionC = 0x04,
}

public SomeBitFlag AllowedOptions { get, set. etc .. }
....
}

Now, on an aspx page, I place an instance of the control, and want to set
"AllowedOptions" :

<uc:MyControl runat="server" ID="ucMyControl" AllowedOptions="OptionA |
OptionC" />

This doesn't work because the aspx page doesn't like the string : "OptionA |
OptionC".
It's easy enough to set the bitflag value in the aspx.cs file, but is there
a way to make this work in the aspx file ?

I realise I can define combo bitflags like :
OptionsA_And_C = OptionA | OptionC in the SomeBitFlag enum def, but I'd
rather not have to do this, as there may be many combinations.

Is what I am trying to do supported in asp.net ?

Thanks.

Jan 2 '08 #1
0 1360

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Danko Greiner | last post by:
Thanx Willy, this was very helpful. But i also need (and want to know) how to do this from code. Can you plase give me right topic in MSDN? is there good example? Thanx p.s. this is...
1
by: Maziar Aflatoun | last post by:
Hi, I have the lKey object that can be used to enable different operation systems such Windows 2000 Linux FreeBSD etc. Now I want to read a database table that contains key/values and if...
4
by: Earl Teigrob | last post by:
I have a property set in my templated custom control as follows public System.Drawing.Color tableColor; public System.Drawing.Color TableColor { set { tableColor = value; } get
1
by: Craig Buchanan | last post by:
I am using flag as the identifier for various security settings. For instance: Public Enum SecurityEnum Read=0 Write=1 Delete=2 ... End Enum
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
12
by: Cmtk Software | last post by:
I'm trying to define an enum which will be used from unmanaged c++, C++/CLI managed c++ and from C#. I defined the following enum in a VS dll project set to be compiled with the /clr switch: ...
4
by: Nikos Hatzigiannakis | last post by:
The following code does not display the number 10 in hex format. The hex flag doesn't seem to work. Any ideas? Compiler is DEV C++ 4.9.9.2 http://www.bloodshed.net/
6
by: DippyDog | last post by:
This is an old old post that I'm referencing regarding what happens when you set an integer variable to Nothing. It gets set to zero, not "Nothing." ...
5
by: Sin Jeong-hun | last post by:
Hello. This question may be stupid. enum MyValues { Value1, Value2, Value3, Value4, Value5 } ....in the code...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.