Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TypeConverter for object reference assignment
Message
De
04/05/2012 00:29:12
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
TypeConverter for object reference assignment
Versions des environnements
Environment:
C# 3.0
OS:
Windows Server 2008
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01543165
Message ID:
01543165
Vues:
62
Hi
I have write a simple webcontrol, which contains properties as below
public class MyClass : WebControl
{
    public Button myButton { get { } set { } }
}
I would like to add design-time support for this control to ease my developer. Once myClass is dropped on web form, I want developer to able to go to property designer, navigate to "myButton" property row, click the drop down and select one of the button exist in current web form.

As now, the aspx code generated is
<cc1: myClass ID="xxx" runat="server" myButton = "OneOfmyButton1"/>
When run the app, I will hit error. I would like to ask for sample how to generate code in designer.cs so that I can have
this.xxx.myButton = this.OneOfmyButton1;
I search from web, but only found expandableObject, InstanceDescriptor ... which I am not sure it is useful for my case.

Please advice. thank you
I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...
Répondre
Fil
Voir

Click here to load this message in the networking platform