error when passing a reference to a derived object in a method

前端 未结 3 614
我寻月下人不归
我寻月下人不归 2020-12-07 02:59

In c# I am trying to implement a method which I can use to bind data to any control I pass to it (provided of course the control is derived from a databoundcontrol object)

3条回答
  •  生来不讨喜
    2020-12-07 03:32

    Andrew Hare answered very well.

    Your object must need something inside to use REF or OUT. For example: could be null.

    DropDownList lister = new DropDownList();
    lister = null;   
    CTLBindData(ref lister);
    

提交回复
热议问题