Another patch to add Design to AddToCartButton

3 views
Skip to first unread message

Chris Bond

unread,
Jan 24, 2007, 11:17:16 AM1/24/07
to open-shop...@googlegroups.com
New Class in Designers directory called AddToCartButtonDesigner.cs:

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.Design;

namespace Tios.ShoppingCart.Designers
{
    public class AddToCartButtonDesigner : ControlDesigner
    {
        private Web.UI.WebControls.AddToCartButton addToCart;

        public AddToCartButtonDesigner()
        {
        }

        public override void Initialize(System.ComponentModel.IComponent component)
        {
            addToCart = (Web.UI.WebControls.AddToCartButton )component;
            base.Initialize(component);
        }

        protected override string GetEmptyDesignTimeHtml()
        {
            StringWriter sw = new StringWriter();
            HtmlTextWriter tw = new HtmlTextWriter(sw);
            return base.GetEmptyDesignTimeHtml();
        }

    }

}


Then modify AddToCartButton.cs from:
[Designer(typeof(System.Web.UI.Design.WebControls.ButtonDesigner))]

to:
[Designer(typeof(Tios.ShoppingCart.Designers.AddToCartButtonDesigner))]

Seemed to work a dream for me, will try test Hyperlink and few others to see if I can get them working too.

Kind Regards,
Chris Bond

chrisbond

unread,
Jan 24, 2007, 11:24:38 AM1/24/07
to Open Shopping Cart
Erk Sorry left my namespace in - should say SerialCoder =)

Marc Chouteau

unread,
Jan 25, 2007, 7:10:21 AM1/25/07
to open-shop...@googlegroups.com
Hi,
 
Thanks , I commit this on repository soon.
 
Marc Chouteau

 

chou...@gmail.com

unread,
Jan 28, 2007, 8:02:07 AM1/28/07
to Open Shopping Cart
Hi,

It's commited

Marc Chouteau

On Jan 25, 1:10 pm, "Marc Chouteau" <chout...@gmail.com> wrote:
> Hi,
>
> Thanks , I commit this on repository soon.
>
> Marc Chouteau
>

> > Chris Bond- Hide quoted text -- Show quoted text -

Chris Bond

unread,
Jan 28, 2007, 8:04:18 AM1/28/07
to open-shop...@googlegroups.com
Nice one - just need to get the designer working for basket now and we're sorted, got a funny feeling its going to be a lot more complex than the simple controls.  I'll try have a look this week if I get a spare moment.
Reply all
Reply to author
Forward
0 new messages