我的在页面代码中有这样一个需求。protected partial class MyFirstPage : Page
{ public void SetData<T>(IList<T> obj)
 {
   //该函数系统自动调用
 } public void GetData<T>(IList<T> obj)
 { } public void Button_Click(object sender, EventArg arg)
 {
    //GetData<T>  我想在button_click中调用GetData<T>(IList<T> obj)方法。
 }
}我想在button_click中调用GetData<T>(IList<T> obj)方法。如何能够实现??

解决方案 »

  1.   

     public void Button_Click(object sender, EventArg arg)
     {
         GetData<string>(list);   
     }
      

  2.   

    eg:
     GetData<int>(...)这样?
      

  3.   

    GetData<string>(IList<string> obj)
    GetData<class1>(IList<class1> obj)
      

  4.   

    GetData<string>(IList<string> obj)
    GetData<class1>(IList<class1> obj)
      

  5.   

            IList<string> list = new List<string>();
            list.Add("");
            GetData<string>(list);
      

  6.   

    GetData<你要的type>(IList<你要的type> obj)
      

  7.   

    请见:http://topic.csdn.net/u/20100902/15/2f3cbfce-a5cf-412b-bb47-cb55c0f2beb2.html?89325
      

  8.   

    .
    请见:http://topic.csdn.net/u/20100902/15/2f3cbfce-a5cf-412b-bb47-cb55c0f2beb2.html?89325
      

  9.   


    请见:http://topic.csdn.net/u/20100902/15/2f3cbfce-a5cf-412b-bb47-cb55c0f2beb2.html?89325