Results 1 to 4 of 4

Thread: [2008] Placing an inherited control on page

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Question [2008] Placing an inherited control on page

    I have a control that inherits from a RegularExpressionValidator and I need an instance of it on a page, but from what I can tell you can't add this without creating it in a separate library and adding the library to your toolbox and dropping an instance on your page.

    I could add it through the code-behind but there are problems with the ControlToValidate property of Validators.

    I know it's fairly straightforward to create a separate library to house the control but I can't justify that just for one control.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2008] Placing an inherited control on page

    You can make it a class in your existing solution and that control should then be available to you when you reference your own assembly. I assume you'll be adding a reference to it in your web.config?

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Re: [2008] Placing an inherited control on page

    Quote Originally Posted by mendhak
    You can make it a class in your existing solution and that control should then be available to you when you reference your own assembly. I assume you'll be adding a reference to it in your web.config?
    I can't reference the assembly of the web project to itself because there is no dll output. If there is a way, I don't know of one.

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2008] Placing an inherited control on page

    Then either convert your project to a web application project rather than a website project, or (if you can't justify the creation of another class library), make a web user control.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width