space.lolo
12/24/2003 4:02:00 PM
I want to create a custom mobile control & add it to the VS toolbox
If i enable the line "public class Simple :
System.Web.UI.WebControls.WebControl", the toolbox is able to add my
control
If i enable the line "public class Simple :
System.Web.UI.MobileControls.MobileUserControl", the toolbox found no
control inside the dll and add nothing...
After, if i add [ToolboxItem(true)], the toolbox found a control, by
when i drag it to a mobile form, nothing happens...
More interesting :
- If i compile with "WebControl", and then add the control inside the
toolbox, it is working
- Then, i re-compile with "MobileUserControl" and keep the old control
inside the toolbox
- I re-add a new control inside a mobile form : it is working (and it
seems that the control added is a MobileUserControl derived...
Question : How to add mobile user control to the toolbox ???? And how
to have it working ?
Thanks
---------- THE CODE :
[ assembly:TagPrefix("SimpleControl", "simple") ]
namespace SimpleControl
{
[
ToolboxData("<{0}:Simple runat=server></{0}:Simple>")
]
//public class Simple : System.Web.UI.WebControls.WebControl
public class Simple : System.Web.UI.MobileControls.MobileUserControl
{
private string text;
[
Bindable(true),
Category("Misc"),
DefaultValue(""),
Description("Text to show1"),
]
public string Text
{
get { return text; }
set { text = value; }
}
protected override void Render(HtmlTextWriter output)
{
output.Write(Text);
}
}
}