Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can I pass either control or null?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01330372
Message ID:
01330699
Vues:
14
I meant I wanted to pass a control from the page. But I re-thought and later handled this problem differently with two methods.

>>Hi everybody,
>>
>>I want to create a method that would receive a special control as a parameter or would not receive anything (should receive null). How can I define this control parameter?
>>
>>Thanks in advance.
>
>What do you mean by control (or control parameter)?
>As long as it is not a value type you can set it to null
>
>public void MyMethod(MyClass myClass)
>{
>//do something
>}
>
>to call MyMethod you can use
>MyMethod(new MyClass);
>or
>MyMethod(null);
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform