For Programmers: Free Programming Magazines  


Home > Archive > ASP .NET > April 2007 > ASP.NET ControlDesigner & smart tags









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author ASP.NET ControlDesigner & smart tags
cruster

2007-04-28, 10:08 pm

Hey folks.
I'm developing an ASP.NET custom control and have assciated a custom
ControlDesigner with it. I'm using smart tags in design time like this:

public override DesignerActionItemCollection
GetSortedActionItems()
{
if (_actions == null)
{
_actions = new DesignerActionItemCollection();
_actions.Add(new DesignerActionMethodItem(this,
"EditValues", "Edit values", true));
}

return _actions;
}

public void EditValues()
{
((MyComponent)this.Component).Foo = "bar";
// I guess I need to call something here
}

When I click "Edit values" smart tag, the property Foo will get a
value "bar", it's nicely shown in the Properties window, but when I go
to the HTML Source of the ASP.NET page, property Foo is not set in the
code:
<cc:MyComponent runat="server" ID="myc1" />
When I go back to design view, Foo is empty.
So i guess after setting Foo to "bar" I need to call something, that
will refresh the HTML to something like:
<cc:MyComponent runat="server" ID="myc1" Foo="bar" />

Please, help me out of this. Thanks.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com