Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I pass either control or null?
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01330372
Message ID:
01330699
Views:
15
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform