在ASP.net中,是否有像JSP中的taglib或者JSTL之类的技术?怎么实现?小弟刚刚开始接触.net~~~大虾帮忙!!!!

解决方案 »

  1.   

    MVC其实和.NET中的分层架构的思想是有很多相似之处的,其实都是一个将表示,数据,逻辑分离的过程。
    刚刚接触.NET应该先从基础开始,再慢慢接触分层
      

  2.   

    http://www.baidu.com/s?wd=ASP.net+MVC&cl=3
      

  3.   

    我说的是自定义标记的问题啊~~~~不是Codebehind问题,在JSP中很容易使用EJB和taglib,在JSP2中更能非常简单的使用JSTL,可是在ASP.net中怎么实现啊??楼上的2位提供的全是Codebehind的~~~~~~~~~~~~~~~我以前一直在开发JSP,最近想看看ASP.net,可是似乎没觉得太好用啊~~~~~
      

  4.   

    asp.net 中的那么多控件就相当于taglib
      

  5.   

    顶!搞定!!!!!!!!!!!!
    ==========================================
    // aspcn.cs中的代码!
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;namespace aspcn
    {
        public class MenuTable : Control, INamingContainer
        {
            protected override void CreateChildControls()
            {
                this.Controls.Add(new LiteralControl("<table><tr><td>1</td></tr></table>"));
                //throw new System.Exception("The method or operation is not implemented.");
            }
        }
    }
    // 代码结束
    =============================================然后执行CSharpCompiler!!!命令行如下:
    =============================================
    csc /t:library /out:aspcn.dll /r:System.Web.dll CustomControls.cs
    =============================================将生成的aspcn.dll复制到“bin\”下
    在页面中加入代码:
    ==================================
    ...............
    <%@ Register TagPrefix="aspcn" Namespace="aspcn" Assembly="aspcn"%>
    ...............
    <aspcn:MenuTable id="testTag" runat="server"/>
    ...............
    ==================================测试成功!
      

  6.   

    呵呵,讲一讲对应关系
    实现            tag载体              页内混编             分离编码
    JSP             EJB(.class)           scriplet             JSTL
    ASP.net         UC(.dll)              code beside          Code behind