private
void teste(ref ControlCollection controles){
}
when i use the void:teste(
ref this.Page.Controls);it returns the error to followError 14 A property or indexer may not be passed as an out or ref parameter
thanks!
private
void teste(ref ControlCollection controles){
}
when i use the void:teste(
ref this.Page.Controls);it returns the error to followKnow the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
AlanRank #669 · 3.6K reputationPosted Jul 24, 2007, 10:09 AM EDT
As a workaround, cache it in a variable first:
ControlCollection cc = this.Page.Controls;
teste(ref cc);
Thiago Prohaska5 reputationPosted Jul 24, 2007, 10:25 AM EDT
example:
Thiago Prohaska5 reputationPosted Jul 24, 2007, 10:55 AM EDT