惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

人人都是产品经理
人人都是产品经理
量子位
博客园 - 三生石上(FineUI控件)
博客园 - Franky
博客园_首页
罗磊的独立博客
酷 壳 – CoolShell
酷 壳 – CoolShell
G
Google Developers Blog
IT之家
IT之家
Google DeepMind News
Google DeepMind News
爱范儿
爱范儿
Last Week in AI
Last Week in AI
U
Unit 42
J
Java Code Geeks
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
MyScale Blog
MyScale Blog
H
Help Net Security
V
V2EX
S
SegmentFault 最新的问题
月光博客
月光博客
Martin Fowler
Martin Fowler
Vercel News
Vercel News
Y
Y Combinator Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - Maxer`s Blog

用C#生成随机中文汉字验证码(转) 序列化与反序列化 - Maxer`s Blog - 博客园 大家救命啊:系统表更新导致数据库崩溃,有没有办法还原? //以解决,谢谢大家关注 一些我收集的常用正则表达式 JS常用正则表达式 SQLServer和Access、Excel数据传输简单总结 动态SQL语句 转-javascript 问题集合 - Maxer`s Blog 使用Session常见问题集锦 TreeView控件问题汇总 ASP.NET 2.0学习笔记之$ ASP.NET 2.0学习笔记之Code Directory 网站恢复正常了,感谢Howej ! 推荐一个好用的PDF转TXT软件 测试从dasblog发文章到博客园 [导入]注册了StartNow.CN域名 [导入]新年钟声响了,现在是2006了 [导入]今天去签了新电信息科技 [导入]应届毕业生该怎样准备你的未来
ASP.NET 2.0学习笔记之Object Tag Syntax - Maxer`s Blog
Maxer`s Blog · 2006-03-27 · via 博客园 - Maxer`s Blog

Object Tag Syntax: <object runat="server" />

Object tags enable page developers to declare and create instances of variables using a declarative, tag-based syntax. The following example demonstrates how the object tag can be used to create an instance of an ArrayList class.

<object id="items" class="System.Collections.ArrayList" runat="server"/>

The object will be created automatically at run time and can then be accessed through the ID "items".

<html>

   <script language="C#" runat=server>

      void Page_Load(Object sender, EventArgs e) {

         ArrayItems.Add("One");
         ArrayItems.Add("Two");
         ArrayItems.Add("Three");

         MyList.DataSource = ArrayItems;
         MyList.DataBind();
      }

   </script>

   <body>
   
   <object id="ArrayItems" class="System.Collections.ArrayList" runat=server/>

      <asp:datalist id="MyList" runat=server>

         <ItemTemplate>

            Here is a value: <%# Container.DataItem %>

         </ItemTemplate>

      </asp:datalist>

   </body>

</html>