摘要:
解决办法:
你放在onitemdatabound中处理,并且判断itemtype为edit的时候才做就可以实现你的目标了
原因:
在edit这个事件中,edititemtemplate里的控件其实还没建立
他的前提条件是要数据绑定以后,并且要通过oneditcommand事件才后才能被建立,这也就是为什么update事件又可以如常操作的原因了
类似的代码如这样
priv......
摘要:
引言:
微软的.net平台堪称为新一代的互联网平台。对于技术开发人员来说,.net平台的两大特性是非常卓越的,首先是其所提供的公共语言运行时,也就是公用语言运行平台,另一方面就是庞大而全面的统一编程类。
c#语言是微软公司针对.net平台才推出来的一门新语言,作为.net平台的第一语言,它几乎集中了所有关于软件开发和软件工程研究的最新成果。其不但继承了c++、java等......
DisplayingListViewitems-withclass!
i dont know about you, but im very fond of the listview control - its a very useful control to have around. microsofts .net framework provides much of the functionality you need to display data in a listview. however, youre still left will some work to do. loading the listview and getting the data can be an arduous task. in fact, your code can get pretty messy unless you think things through a bit. in order to display complex class data, you should consider a way to associate your class data with each listitem in the listview.
for example, consider the following class, which represents data you might want to relate to a particular listview control: class person { public string name; public string rank; public string serialnumber; public person (string n, string r, string sn) { &nb...
下一页 摘要:
代码示例1:
dlist = new system.web.ui.webcontrols.dropdownlist()
dlist.items.clear()
dlist.id = "d" & rs2.fields("zdm").value
do while not rs3.eof
dlist.items.add(rs3.fields(......