在一个用户查询页面有三个查询分别查询全部用户,按名称模糊查询用户和按照角色查询用户。这三个功能需要调用业务端三个不同的函数,它们的返回值一样,都是数据对象集合SESGMemberShipUserCollection
使用GridView1来显示查询结果,ObjectDataSource1是数据源。问题是如何能够在程序的运行时设置让ObjectDataSource1动态调用业务端的三个方法。

解决方法,在ObjectDataSource的Selecting事件里,可以修改输入参数
    protected void ObjdataDataSource_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
    {
        e.InputParameters["searchMethod"] = this.searchMethod;
        e.InputParameters["args"] = this.searchArgs;
    }

相关文章:

  • 2021-12-03
  • 2022-12-23
  • 2021-11-29
  • 2021-06-09
  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-11
  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
  • 2022-12-23
相关资源
相似解决方案