locked
How to create Curved content box Custom control using CSS RRS feed

  • Question

  • User-1340349467 posted

    How to create Curved content box Custom control using CSS..

    Where i can chnage the curve style .. like curved , diagonal , sruare etc without using image ..

    It can be used  like

                     <ccb:ContentBox ID="ContentBox1" runat="server" >
                          <InnerContent>
                                  <asp:Label ID="label1" runat="server"></asp:Label>                        
                          </InnerContent>
                    </ccb:ContentBox>

    and in code behind

     label1.Text="testing";

     

     

     

    Friday, June 19, 2009 10:55 AM

Answers

  • User1828997928 posted

     Scott Mitchell wrote a blog post for a rounded corner server control here

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 19, 2009 12:02 PM
  • User-206222649 posted

    So you want to create a templated control. That is alot of work. Truely alot of work.

    http://msdn.microsoft.com/en-us/library/aa478964.aspx

    Thats a good starting link. As to the CSS it's all in how you generate the markup. There are enough resources to googl that I won't list them here.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 19, 2009 12:02 PM

All replies

  • User1828997928 posted

     Scott Mitchell wrote a blog post for a rounded corner server control here

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 19, 2009 12:02 PM
  • User-206222649 posted

    So you want to create a templated control. That is alot of work. Truely alot of work.

    http://msdn.microsoft.com/en-us/library/aa478964.aspx

    Thats a good starting link. As to the CSS it's all in how you generate the markup. There are enough resources to googl that I won't list them here.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 19, 2009 12:02 PM
  • User-206222649 posted

    Actually I was thinking about it and there is an easier way to do this.

    You would just create a control thast inherit from Panel, and override the RenderBeginTag and RenderEndTag methods to add your custom markup.

     

    public class RoundedCornersPanel : System.Web.UI.WebControls.Panel
    { 
       public override RenderBeginTag (HtmlTextWriter writer)  
       {      
    	   writer.Write("Your rounded corner opening markup");     
    	   base.RenderBeginTag(writer);  
       }  
       
       public override RenderEndTag (HtmlTextWriter writer)   
       {        
    	   base.RenderEndTag(writer);   
    	   writer.Write("Your rounded corner closing markup");    
       }
    }
     
    Friday, June 19, 2009 12:11 PM