控制v HTML [英] Controls v HTML

查看:52
本文介绍了控制v HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我来自经典的asp背景,但12个月前开始使用ASP.NET关于

,但我仍然不确定使用的优缺点

控制v代码中的HTML吐出,就像在经典的asp中一样。我还使用System.Web.UI.ICallbackEventHandler将数据发送到服务器

并返回而不使用控件。


我想知道的是各自的优点和缺点。对我来说,你从来没有使用控件的自由,因为你操纵html并将其吐出来,

但是使用控件可以更快地完成更简单的工作。


性能问题是什么?


使用asp.net时,其他经典asp用户最好用什么?

I come from a classic asp background, but have started using ASP.NET about
12 months ago, but I''m still not sure about the pros and cons of using
controls v HTML spat out from code as you would in classic asp. I have also
been using System.Web.UI.ICallbackEventHandler to send data to the server
and back without using controls.

What I want to know is the pros and cons of each. To me you never have quite
the freedom using a control as you do manipulating html and spitting it out,
but it can be quicker using a control for more simple jobs.

what are the performance issues?

What have other classic asp users found to be best when using asp.net?

推荐答案

>我来自经典的asp背景,但已开始使用ASP.NET约
>I come from a classic asp background, but have started using ASP.NET about

> 12个月前,但我仍然不确定使用
控件的优缺点v从代码中吐出HTML,就像在经典的asp中一样。我还一直在使用System.Web.UI.ICallbackEventHandler将数据发送到服务器并返回而不使用控件。
>12 months ago, but I''m still not sure about the pros and cons of using
controls v HTML spat out from code as you would in classic asp. I have also
been using System.Web.UI.ICallbackEventHandler to send data to the server
and back without using controls.



DataGrid之类的控件之类的优势在于它只需更快/更容易从后端获取数据到你的前端。


中继器之类的控件之类的优点是你可以获得

理想的分离前端(.aspx)后端有逻辑

后端(.vb / cs文件)


内置Web控件的缺点......特别是在1.1中,HTML,大部分都是糟糕的。这不是很语义,而且往往是无效的。


所以,我养成了使用很多经典ASP编剧的习惯。 />

我现在正试图打破自己的习惯,因为我进入2.0; o)

The advantages of controls like DataGrid and the like is that it''s simply
faster/easier to get data from your back end onto your front end.

The advantages of controls like repeaters and the like is that you can get
that ''ideal'' separation of presentation on the front (.aspx) end with logic
on the back end (.vb/cs files)

The disadvantages of the built in web controls...ESPECIALLY in 1.1, was that
the HTML, for the most part, sucked. It wasn''t very semantic and often
invalid.

So, I got in the habit of using a lot of stringwriters ala classic ASP.

I''m now trying ot break myself of that habit as I move into 2.0 ;o)


我想要什么知道每个人的利弊。对我来说,你永远不会有使用控件的自由,因为你操纵html和随地吐痰

它,但它可以更快地使用控件来完成更简单的工作。
What I want to know is the pros and cons of each. To me you never have
quite the freedom using a control as you do manipulating html and spitting
it out, but it can be quicker using a control for more simple jobs.



几乎就是这样。


即使2.0控件也有些限制。即,数据网格很容易设置为允许从一个表中查看和编辑内容。但是一旦你开始通过连接和

之类的方式来操作数据,那么数据网格变得相当复杂。

that''s pretty much it.

Even the 2.0 controls are somewhat limited. Ie, a datagrid is really easy to
set up to allow the viewing and editing of content from one table. But once
you start getting into manipulating data across tables via joins and the
like, then the datagrid becomes rather complex to deal with.


使用asp.net时,其他经典asp用户发现什么是最好的?
What have other classic asp users found to be best when using asp.net?



恕我直言,如果你愿意接受整个OOP开发的概念,那么就可以实现它,然后再去ASP.net。如果您更喜欢ASP''生活方式''那么

考虑迁移到PHP,因为它更接近于methedology。


-Darrel

IMHO, if you are willing to embrace the entire concept of OOP development,
then do it, and go with ASP.net. If you prefer the ASP ''lifestyle'' then
consider migrating to PHP, as that is closer in methedology.

-Darrel


我怀疑是否存在任何真正的性能问题,无论如何,无论你是否手动执行此操作,所有内容都会泄露给响应输出流。或者让一个

控件通过从Page类响应其Render方法来实现它。


我见过开发人员来自经典ASP(和我也是这样的环境

谁只是拒绝接受进步并以旧方式做所有事情。我想

建议你改变你对ASP.NET控件概念的看法 - 甚至

考虑在整个过程中编写一些自己的CustomControls。


如果遇到一种情况,你绝对无法弄清楚如何使工具箱上的ASP.NET控件做你需要的工作,你可以随时

回退到使用StringBuilder构建HTML字符串并将

输出HTML附加到占位符或HtmlGeneric(div)控件'的InnerHTML

财产。


彼得

-

递归:见递归

网站:< a rel =nofollowhref =http://www.eggheadcafe.comtarget =_ blank> http://www.eggheadcafe.com

unBlog: http://petesbloggerama.blogspot.com

BlogMetaFinder: http:// www .blogmetafinder.com


" ThatsIT.net.au"写道:
I doubt there are any real performance issues, everything gets spit out to
the response output stream anyway, whether you do it "manually" or let a
control do it by responding to its Render method from the Page class.

I''ve seen developers coming from a classic ASP (and so did I) environment
who just refuse to accept progress and do everything the "old way". I would
suggest you change your mindset to the concept of ASP.NET controls - and even
consider writing some of your own CustomControls along the way.

If you run into a situation where you just absolutely cannot figure out how
to make the ASP.NET Controls on the Toolbox do what you need, you can always
fall back to building strings of HTML with a StringBuilder and attaching the
output HTML to a placeholder or HtmlGeneric("div") control''s InnerHTML
property.

Peter
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"ThatsIT.net.au" wrote:

我来自经典的asp背景,但12个月前开始使用ASP.NET关于

,但我''我仍然不确定使用

的优点和缺点控制v代码中的HTML吐出,就像在经典的asp中一样。我还使用System.Web.UI.ICallbackEventHandler将数据发送到服务器

并返回而不使用控件。


我想知道的是各自的优点和缺点。对我来说,你从来没有使用控件的自由,因为你操纵html并将其吐出来,

但是使用控件可以更快地完成更简单的工作。


性能问题是什么?


使用asp.net时,其他经典asp用户最好用什么?

I come from a classic asp background, but have started using ASP.NET about
12 months ago, but I''m still not sure about the pros and cons of using
controls v HTML spat out from code as you would in classic asp. I have also
been using System.Web.UI.ICallbackEventHandler to send data to the server
and back without using controls.

What I want to know is the pros and cons of each. To me you never have quite
the freedom using a control as you do manipulating html and spitting it out,
but it can be quicker using a control for more simple jobs.

what are the performance issues?

What have other classic asp users found to be best when using asp.net?


答案真正取决于你的职业生涯。如果你是一名专业的b $ b开发人员,并计划保持一个,拥抱并掌握面向对象的b
编程,学习如何利用OOP的强大功能和良好的面向对象

设计和架构模式和实践,并期望很长一段时间这么好。

。从长远来看,你会好得多,写一些功能强大,安全,易于维护和扩展的软件,并且可以获得更多的功能。更少的时间。


如果另一方面,你是一个业余爱好者,那完全取决于你是否想要解决所有麻烦。


-

HTH,


Kevin Spencer

Microsoft MVP


DSI PrintManager,Miradyne组件库:
http: //www.miradyne.net


" ThatsIT.net.au" < me @ thatsitwrote in message

news:6A ******************************** ** @ microsof t.com ...
The answer really depends on what your career is. If you are a professional
developer, and plan to remain one, embrace and master object-oriented
programming, learn how to employ the power of OOP and good object-oriented
design and architecture patterns and practices, and expect to take a good
long time doing so. In the long run, you''ll be much better off, write
software that is powerful, secure, easy to maintain and extend, and get much
more done in much less time.

If on the other hand, you are a hobbyist, it is entirely up to you whether
you want to go to all that trouble.

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"ThatsIT.net.au" <me@thatsitwrote in message
news:6A**********************************@microsof t.com...

>我来自经典的asp背景,但已经开始使用ASP.NET了关于
12个月以前,但我仍然不确定使用
控件的优缺点v从代码中吐出HTML,就像在经典的asp中一样。我还一直在使用System.Web.UI.ICallbackEventHandler将数据发送到服务器
并返回而不使用控件。


我想知道的是各自的利弊。对我来说,你永远不会有使用控件的自由,因为你操纵html和随地吐痰

它,但它可以更快地使用控件来完成更简单的工作。


性能问题是什么?


使用asp.net时,其他经典asp用户最好用什么?

>I come from a classic asp background, but have started using ASP.NET about
12 months ago, but I''m still not sure about the pros and cons of using
controls v HTML spat out from code as you would in classic asp. I have also
been using System.Web.UI.ICallbackEventHandler to send data to the server
and back without using controls.

What I want to know is the pros and cons of each. To me you never have
quite the freedom using a control as you do manipulating html and spitting
it out, but it can be quicker using a control for more simple jobs.

what are the performance issues?

What have other classic asp users found to be best when using asp.net?



这篇关于控制v HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆