本帖最后由 jiangsheng 于 2010-04-07 07:40:04 编辑

解决方案 »

  1.   

    第一个是数据绑定
    第二个是执行代码用的(相当于runat="server" language="C#/vb/....")
    第三个是Respose.Write的简写
    第四个是注册程序集,控件吧
    第五个是注释不知道对不对....坐等高人
      

  2.   

    < %=...%>< %#... %>< % %>< %@ %>
    < %#... %>: 是在绑定控件DataBind()方法执行时被执行,用于数据绑定 
    如: < %# Container.DataItem("tit") %>< %= %>: 在程序执行时被调用,可以显示后台变量值如: *.aspx中: < %= aaa %>*.cs中: protected string aaa="姓名";< % %>: 内联代码块里面可以在页面文件*.aspx或*.ascx文件里面嵌入后台代码如:< % for(int i=0;i<100;i++){Reaponse.Write(i.ToString());}%>
    < %@ %>是在*.aspx页面前台代码导入命名空间,
    如: 
    < %@ Import namespace="System.Data"%>
    <%-----------%>前台注释
      

  3.   

    第一个是数据绑定
    第二个是在前台写动态代码的
    第三个是Respose.Write的简写
    第四个是头文件标签
    第五个是注释
      

  4.   

    <!-- -->  这个才是注释吧.
      

  5.   

    在C#中这个<%-- --%>也是
      

  6.   

    http://topic.csdn.net/u/20091014/16/e08dc4e4-8a9f-49b6-b93b-5b2f16a5a244.html
      

  7.   

    绑定的属性必须是public
    绑定到简单属性:<%#UserName%>
    绑定到表达式:<%#(class1.property1.ToString() + "," + class1.property2.ToString())%>
    绑定到方法返回值:<%# GetSafestring(str) %>
        
    绑定到DataView,DataTable,DataSet:
    <%#((DataRowView)Container.DataItem)["字段名"]%>或
    <%#((DataRowView)Container.DataItem).Rows[0]["字段名"]%>
    <%#string.Format("格式",((DataRowView)Container.DataItem)["字段名"])%>
    <%#DataBinder.Eval(Container.DataItem,"字段名","格式")%>