HighTechTalks DotNet Forums  

Possible to set a UserControl's bitwise Enum value in aspx file ?

ASP.net Web Controls microsoft.public.dotnet.framework.aspnet.webcontrols


Discuss Possible to set a UserControl's bitwise Enum value in aspx file ? in the ASP.net Web Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Moe Sisko
 
Posts: n/a

Default Possible to set a UserControl's bitwise Enum value in aspx file ? - 01-02-2008 , 10:32 PM






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 ?


Thanks.




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.