Results 1 to 6 of 6

Thread: ContentPlaceHolder control behaviour

  1. #1
    Join Date
    Jan 2006
    Location
    Cambridge, UK
    Posts
    1,340

    Default ContentPlaceHolder control behaviour

    Is there any reason, why the ContentPlaceHolder's base class changed from Control to WebControl?

    I'm using the ContentPlaceHolder for setting the <head><title> in the master-page. But a WebControl renders a <span>-tag around it's content by default. Doesn't look good in the Browser's titlebar ;-)

    I currently solved this by deriving my own MyContentPlaceHolder from ContentPlaceHolder and overriding the RenderBeginTag/RenderEndTag methods.

    My question: Is this expected behaviour or will this Control behave in the upcoming release as it has done in the 1.1 Preview 2 build?

    br,
    oaky

  2. #2
    Join Date
    Sep 2004
    Location
    Belgrade, Serbia
    Posts
    613

    Default

    I was wondering why that <span> started showing up all of the sudden...

    I will change both Content and ContentPlaceHolder to inherit from the Control, as they used to.

    Thanks,

    Aleks

  3. #3
    Join Date
    Oct 2005
    Location
    Toulouse, France
    Posts
    1,407

    Default

    Aleks,

    if needed, u can keep base class WebControl overriding RenderBeginTag and RenderEndTag methods to remove the span tag generated.

    something like that :
    Code:
    public override void RenderBeginTag&#40;HtmlTextWriter text&#41;
    &#123;&#125;
    
    public override void RenderEndTag&#40;HtmlTextWriter text&#41;
    &#123;&#125;
    Bruno
    My english is as poor as my taylor is rich

  4. #4
    Join Date
    Sep 2004
    Location
    Belgrade, Serbia
    Posts
    613

    Default

    I already changed it back to Control -- I don't think there is any real need to inherit from WebControl, but someone once mentioned that it gives you design-time support out of the box, so I changed it.

    Now that we have appropriate design-time attributes on the class anyway, there is no need whatsoever to inherit from WebControl.

    - Aleks

  5. #5
    Join Date
    Mar 2006
    Posts
    7

    Default

    Hi,

    I'm also facing this problem. But what's the best way to solve this issue?

  6. #6
    Join Date
    Sep 2004
    Location
    Belgrade, Serbia
    Posts
    613

    Default

    It's already been solved, you just need to use one of the latest nightly builds instead of 1.1 P2 release. You can download nightlies from our website.

    - Aleks

Similar Threads

  1. User control in a repeater itemtemplate
    By CheekyTinker in forum Web
    Replies: 9
    Last Post: 08-30-2006, 07:22 AM
  2. Replies: 2
    Last Post: 02-03-2006, 02:14 AM
  3. Replies: 1
    Last Post: 12-03-2005, 11:23 PM
  4. Control global dependency injection
    By lahma in forum Web
    Replies: 13
    Last Post: 10-28-2005, 12:30 AM
  5. Replies: 1
    Last Post: 05-15-2005, 04:42 PM

Posting Permissions

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