html控件 vs. web控件

xwsn007 2004-12-24 10:59:27
请大家一起来总结一下html控件与web控件的区别。
小问题:
1.何时用html控件,何时用web控件,有讲究吗?
2.web控件的功能真的比html控件强大吗?(例如:文本框响应回车以自动完成一些操作,用html的Text Field很容易实现,而web的TextBox就不知该如何做)

小弟刚开始学asp.net,请大伙多多捧场!
...全文
246 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
xwsn007 2004-12-27
  • 打赏
  • 举报
回复
自己顶一下
baddot 2004-12-24
  • 打赏
  • 举报
回复
大多数情况下,都是web控件的,因为对于Web控件,编程的时候直接可以对其进行操作。而HTML控件,在不设为服务器控件运行的情况下,只能用客户端脚本进行访问。而ASP.NET主要是在服务器执行代码,因此用Web是正确的选择。

附两个链接,
关于Web控件的说明和使用
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.2052/vbcon/html/vboriWebUserControls.htm

HTML控件
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.2052/vbcon/html/vboriSimpleHTMLControls.htm
Truly 2004-12-24
  • 打赏
  • 举报
回复
jf
leihome 2004-12-24
  • 打赏
  • 举报
回复
我的理解都差不多,一个是在客户端一个是在服务器,我想肯定是客户端HTML快吧
xwsn007 2004-12-24
  • 打赏
  • 举报
回复
up
tengjian1981 2004-12-24
  • 打赏
  • 举报
回复
结合使用
赳赳老陈 2004-12-24
  • 打赏
  • 举报
回复
以上各位说的都没错总之,各有各的好,hehe
posemanboy 2004-12-24
  • 打赏
  • 举报
回复
能用 html 就尽量用html,因为速度快嘛
xwsn007 2004-12-24
  • 打赏
  • 举报
回复
星星们呢?

应用中采用大量的WEB控件(如一个页面有近百个TextBox)是否会影响WEB服务器的性能
xwsn007 2004-12-24
  • 打赏
  • 举报
回复
To: skytear(将进酒)

这么说,在某些情况下,HTML控件要比WEB控件灵活的多了
  • 打赏
  • 举报
回复
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.
liulxmooo 2004-12-24
  • 打赏
  • 举报
回复
up

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧