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
Post a Comment