How do i use a static class' property at design time

Discussion in 'ASP .Net' started by TS, Jul 2, 2007.

  1. TS

    TS Guest

    i want to store my regular expressions in a static class with public
    constants. I want to be able to pass a regular expression's id in a property
    of a custom textbox so that in aspx page i could just set the expressionId
    property and be done with it. i am trying to write as little code in code
    behind as possible.

    if this scenario, since i can't just use a singleproperty
    "ClassName.PropertyName" since c# doesnt' have a stand alone Eval statement,
    i could also have a property: regExClass that would default to a particular
    one, which would be used to instantiate the class and then use the
    expressionID property to access the correct property to set the reg ex.

    does anyone have a better solution.

    thanks
     
    TS, Jul 2, 2007
    #1
    1. Advertising

  2. TS

    bruce barker Guest

    in your textbox make a enum property that sets the resource id. then the
    designer will support it.

    -- bruce (sqlwork.com)

    TS wrote:
    > i want to store my regular expressions in a static class with public
    > constants. I want to be able to pass a regular expression's id in a property
    > of a custom textbox so that in aspx page i could just set the expressionId
    > property and be done with it. i am trying to write as little code in code
    > behind as possible.
    >
    > if this scenario, since i can't just use a singleproperty
    > "ClassName.PropertyName" since c# doesnt' have a stand alone Eval statement,
    > i could also have a property: regExClass that would default to a particular
    > one, which would be used to instantiate the class and then use the
    > expressionID property to access the correct property to set the reg ex.
    >
    > does anyone have a better solution.
    >
    > thanks
    >
    >
     
    bruce barker, Jul 3, 2007
    #2
    1. Advertising

  3. Hi TS,

    As bruce suggested, if you're using an enum, the designer should support it
    and you can easily choose one from the all available enum values; later you
    can use the enum value to determine which regular expression to use.

    Please feel free to let us know if there's anything unclear or we've
    misunderstood anything.


    Regards,
    Walter Wang (, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Walter Wang [MSFT], Jul 3, 2007
    #3
  4. TS

    TS Guest

    i have created an enum as a property; of the textbox but I don't have
    designer support for it.

    also, what do you mean "sets the resource id"

    "bruce barker" <> wrote in message
    news:%...
    > in your textbox make a enum property that sets the resource id. then the
    > designer will support it.
    >
    > -- bruce (sqlwork.com)
    >
    > TS wrote:
    > > i want to store my regular expressions in a static class with public
    > > constants. I want to be able to pass a regular expression's id in a

    property
    > > of a custom textbox so that in aspx page i could just set the

    expressionId
    > > property and be done with it. i am trying to write as little code in

    code
    > > behind as possible.
    > >
    > > if this scenario, since i can't just use a singleproperty
    > > "ClassName.PropertyName" since c# doesnt' have a stand alone Eval

    statement,
    > > i could also have a property: regExClass that would default to a

    particular
    > > one, which would be used to instantiate the class and then use the
    > > expressionID property to access the correct property to set the reg ex.
    > >
    > > does anyone have a better solution.
    > >
    > > thanks
    > >
    > >
     
    TS, Jul 3, 2007
    #4
  5. TS

    TS Guest

    OK, it works now, maybe it just needed to be run once

    "TS" <> wrote in message
    news:%...
    > i have created an enum as a property; of the textbox but I don't have
    > designer support for it.
    >
    > also, what do you mean "sets the resource id"
    >
    > "bruce barker" <> wrote in message
    > news:%...
    > > in your textbox make a enum property that sets the resource id. then the
    > > designer will support it.
    > >
    > > -- bruce (sqlwork.com)
    > >
    > > TS wrote:
    > > > i want to store my regular expressions in a static class with public
    > > > constants. I want to be able to pass a regular expression's id in a

    > property
    > > > of a custom textbox so that in aspx page i could just set the

    > expressionId
    > > > property and be done with it. i am trying to write as little code in

    > code
    > > > behind as possible.
    > > >
    > > > if this scenario, since i can't just use a singleproperty
    > > > "ClassName.PropertyName" since c# doesnt' have a stand alone Eval

    > statement,
    > > > i could also have a property: regExClass that would default to a

    > particular
    > > > one, which would be used to instantiate the class and then use the
    > > > expressionID property to access the correct property to set the reg

    ex.
    > > >
    > > > does anyone have a better solution.
    > > >
    > > > thanks
    > > >
    > > >

    >
    >
     
    TS, Jul 3, 2007
    #5
    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. SaravanaKumar
    Replies:
    6
    Views:
    9,493
    Tony Morris
    Oct 19, 2004
  2. bugbear
    Replies:
    4
    Views:
    458
    bugbear
    Aug 23, 2006
  3. flamesrock
    Replies:
    8
    Views:
    519
    Hendrik van Rooyen
    Nov 24, 2006
  4. Ryan Taylor

    using the Items property in the design time property window

    Ryan Taylor, Feb 8, 2005, in forum: ASP .Net Building Controls
    Replies:
    4
    Views:
    550
    Paul Louth
    Feb 18, 2005
  5. Stefan Ram
    Replies:
    4
    Views:
    268
    Eric Sosman
    Jul 3, 2013
Loading...

Share This Page