ASP.NET binding time

xiaoxiao2021-03-06  60

The later binding is often used in the data processing of ASP.NET, and there are many articles to discuss the advantages and disadvantages of various binding methods. The topic discussed is speed problem, and common point is that DataBinder.eval (contact ") is slower, relatively, ((DataRowView) Container.DataItem) [" ID "] is much better . This is also mentioned in the ASP.NET Qucik Start.

But the speed is not the only problem, and the timeout of the binding is also important, look at the example below:

<% # ("title") ["title"]%>

Here, the other User Control is called, which is not available when the binding time of the (DATAROWVIEW) Container.DataItem method is too early, and this method will not pass the parameters, you will get one The object that is referenced does not exist. It is necessary to bind the second method, although slow (the binding time is late, the object has been generated), the program can run normally.

Everyone is interested, you can try it. In fact, the above example is the simplest method of nesting Repeater CONTROL, the efficiency is not the highest, but it is very simple and practical.

转载请注明原文地址:https://www.9cbs.com/read-118142.html

New Post(0)