Server control development

Discussion in 'ASP .Net Building Controls' started by Sundararajan, Apr 7, 2005.

  1. Sundararajan

    Sundararajan Guest

    Dear Folks,

    I am developing a Header server control. as we know the header control
    is always going to be at the top of the web page. is there any means to
    achieve something like, when i drag and drop the Header server control into
    my Web Page,
    i. It gets itself aligned to the top
    ii. Sets its width to 100%

    How can i achieve that. Thanx in advance

    Regards,

    S.Sundararajan
     
    Sundararajan, Apr 7, 2005
    #1
    1. Advertisements

  2. Sundararajan

    JV Guest

    You could just emit CSS styles:
    style="top:0; width:100%;"

    Just modify your Style collection before rendering.
     
    JV, Apr 7, 2005
    #2
    1. Advertisements

  3. Hi Sundararajan,

    You can inherrit from a ControlDesigner class and override the
    OnBehaviorAttached method:
    protected override void OnBehaviorAttached()
    {
    Behavior.SetStyleAttribute ("width", true, "100%", true);
    .... // set positioning etc
    base.OnBehaviorAttached ();
    }
     
    Steve Goodyear, Apr 8, 2005
    #3
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.