Multiple Conditions for Server Control

Discussion in 'ASP .Net Building Controls' started by chris martin, Jan 3, 2006.

  1. chris martin

    chris martin Guest

    I have a server control that needs to be rendered upon meeting certain conditions
    that our HTML people can alter.

    This works fine if the multiple conditions do not rely on each other. But,
    there are some situations that require that some conditions rely on one another.
    An easy example should point out what I'm getting at.

    ex.

    [works just fine]
    if user has function "customer service"
    render.

    <company:Item runat="server" RequiredUserFunction="CustomerService" />

    [can't figure out a 'clean' way to do this]
    if user has function "customer service" AND (partner == 32 OR partner == 67)
    render.

    <company:Item runat="server" RequiredUserFunction="CustomerService" PartnersToShowItem="32,67"
    />

    The problem with the second example is that what if I need to change the
    'OR' to an 'AND' in the partners list? What what if I need to change the
    'AND' to an 'OR' between 'RequiredUserFunction' and 'PartnersToShowItem'
    properties?

    Does anyone have any ideas of how I can *cleanly* express such logic for
    a server control?

    Thank You,
    Chris Martin
     
    chris martin, Jan 3, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ginu
    Replies:
    2
    Views:
    423
    Richard Tobin
    Dec 14, 2004
  2. K Viltersten

    Using LINQ with multiple conditions (&&)

    K Viltersten, Jun 30, 2009, in forum: ASP .Net
    Replies:
    2
    Views:
    7,222
    K Viltersten
    Jul 2, 2009
  3. JB
    Replies:
    5
    Views:
    1,906
    Alexey Smirnov
    Apr 27, 2010
  4. Martin Robertson

    newbie stuck with multiple conditions

    Martin Robertson, Nov 12, 2007, in forum: Ruby
    Replies:
    3
    Views:
    96
    Jacob Basham
    Nov 12, 2007
  5. Katsuo Isono

    if statement with multiple conditions

    Katsuo Isono, Jan 11, 2008, in forum: Ruby
    Replies:
    3
    Views:
    132
    Katsuo Isono
    Jan 12, 2008
Loading...

Share This Page