请大家一起来总结一下html控件与web控件的区别。
小问题:
    1.何时用html控件,何时用web控件,有讲究吗?
    2.web控件的功能真的比html控件强大吗?(例如:文本框响应回车以自动完成一些操作,用html的Text Field很容易实现,而web的TextBox就不知该如何做)小弟刚开始学asp.net,请大伙多多捧场!

解决方案 »

  1.   

    我的理解都差不多,一个是在客户端一个是在服务器,我想肯定是客户端HTML快吧
      

  2.   

    大多数情况下,都是web控件的,因为对于Web控件,编程的时候直接可以对其进行操作。而HTML控件,在不设为服务器控件运行的情况下,只能用客户端脚本进行访问。而ASP.NET主要是在服务器执行代码,因此用Web是正确的选择。附两个链接,
    关于Web控件的说明和使用
    ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.2052/vbcon/html/vboriWebUserControls.htmHTML控件
    ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.2052/vbcon/html/vboriSimpleHTMLControls.htm
      

  3.   

    Use HTML server controls if:
    !  You prefer an HTML-like object model. HTML server controls have almost
    the same HTML as the basic HTML controls. HTML server controls also
    have server-side functionality just like Web server controls.
    !  You are working with existing HTML pages and you want to quickly add
    Web Form functionality. Because HTML server controls map exactly to
    HTML elements, you do not need to replace controls and risk substitution
    errors or page formatting problems.
    !  The control needs to run both client-side and server-side script. You can
    write a client-side script and target a regular HTML control because the
    controls are visible in the client. At the same time, you can have server-side
    code because it is also a sever control.
    !  Bandwidth is limited and you need to do a large amount of client side
    processing to reduce bandwidth usage.
    Use Web server controls if:
    !  You prefer a Visual Basic-like programming model. You will be able to use
    object-oriented programming, identify controls by their ID attribute, and
    easily separate the page logic from the UI. With Web server controls, you
    can also create applications with nested controls and catch events at the
    container level.
    !  You are creating a Web page that might be viewed by a variety of browsers.
    Because the logic inside the Web server controls is able to create HTML
    that is tailored to the features that are available in the client’s browser, you
    can write for the latest browsers without worrying about browser errors
    keeping your less up-to-date users from accessing all of the Web page
    functions.
    !  You need specific functionality, such as a calendar or advertisement, or ad
    rotator, that is available only as a Web server control.
    !  Your bandwidth is not limited and the request-response cycles of Web
    server controls will not cause bandwidth problems.
      

  4.   

    To: skytear(将进酒) 这么说,在某些情况下,HTML控件要比WEB控件灵活的多了
      

  5.   

    星星们呢?应用中采用大量的WEB控件(如一个页面有近百个TextBox)是否会影响WEB服务器的性能
      

  6.   

    能用 html 就尽量用html,因为速度快嘛
      

  7.   

    以上各位说的都没错总之,各有各的好,hehe