Displaying different controls in repeater, depending on condition

Discussion in 'ASP .Net' started by Shari, Jul 13, 2004.

  1. Shari

    Shari Guest

    I am trying to use a repeater control in an ASP.NET application
    (codebehind is C#), to display a bunch of error messages after a
    validation has occurred.

    In the codebehind, I have access to the type of error (severe or
    warning). If the type of error is "warning", I want to display a
    checkbox along with the error message. The user can then check this
    box to override the error and continue. The checkbox should also be
    prefilled with a database value if the user has selected override
    before.

    If the error is a severe error, this checkbox is not available and it
    should only display a text value (something like "n/a").

    I'd very much appreciate thoughts for how to do this.
     
    Shari, Jul 13, 2004
    #1
    1. Advertising

  2. Shari

    Dale Guest

    You need to inherit your own repeater and implement the ITemplate interface.
    Here's a simple example of doing that. It is what I used as a starting
    point for the custom repeater in the project I am working on now.

    http://coltkwong.com/blogs/juliet/posts/467.aspx

    Dale

    "Shari" <> wrote in message
    news:...
    > I am trying to use a repeater control in an ASP.NET application
    > (codebehind is C#), to display a bunch of error messages after a
    > validation has occurred.
    >
    > In the codebehind, I have access to the type of error (severe or
    > warning). If the type of error is "warning", I want to display a
    > checkbox along with the error message. The user can then check this
    > box to override the error and continue. The checkbox should also be
    > prefilled with a database value if the user has selected override
    > before.
    >
    > If the error is a severe error, this checkbox is not available and it
    > should only display a text value (something like "n/a").
    >
    > I'd very much appreciate thoughts for how to do this.
     
    Dale, Jul 14, 2004
    #2
    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. Replies:
    1
    Views:
    300
  2. Theodor Ramisch

    if condition depending on DataBinder

    Theodor Ramisch, Jul 28, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    5,474
    Eliyahu Goldin
    Jul 28, 2004
  3. -
    Replies:
    12
    Views:
    709
    Remon van Vliet
    Jun 15, 2005
  4. Kit
    Replies:
    0
    Views:
    351
  5. Bill W.
    Replies:
    13
    Views:
    308
    Phillip Gawlowski
    May 9, 2011
Loading...

Share This Page