c# - Benefits Gained by Passing WebControls By Ref -


are there performance benefits gained passing objects webcontrols ref? i'm thinking of such things validation methods modify control's & feel (background-color, cssclass etc.) ...

nope. benefit of passing reference type variable reference if want able change value of caller's variable, i.e. change object refers to. example:

// creates new label if necessary, , sets text stuff public void foo(ref label label) {     if (label == null)     {         label = new label();     }     label.text = "stuff"; } 

personally try avoid ref possible: tends indicate method doing much.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -