English 中文(简体)
下述数据来源的任何危险
原标题:Any danger with the following override of DataSource
class MyListControl : DropDownList {
  public override object DataSource {
    get { return Helper.GetDictionary(); }
    set { }
  }
  public override string DataTextField {
    get { return "Key"; }
    set { }
  }
  public override string DataValueField {
    get { return "Value"; }
    set { }
  }
  public override void DataBind() {
    if (Helper.ConditionSatisfied) {
      base.DataBind();
    }
  }
}

ASP.NET是否需要使用这套装置? 是否提到何时获得“DataSource(DataSource)可能不止一次(在发件人可能无法重新打造的情况下进行收集)?

谢谢。

问题回答

I m not sure what you mean by does it ever use set_DataSource? Of course it does for example:

myDropDownBox.DataSource = MyBLLayer.GetSomeDataSet(SomeParams);

myDropDownBox.Data Bind();

在上述例子中,MyBLLayer只是一个静态的类别,它称之为一种回归某种数据集的方法。 例如,这种数据集可以是一份清单。

所需经费 数据制在基类中受到保护,因此不优先于这一财产。 不管怎样,你们都不想凌驾于这一财产,因为其价值完全是真实的或合法的。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签