从asp迁移:更好的客户端或服务器端代码? [英] migration from asp: better client or server-side code?

查看:49
本文介绍了从asp迁移:更好的客户端或服务器端代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我在经典的asp中做了一个应用程序(预订书籍和视频的东西

给学生)并希望迁移到asp.net 。

用户必须选择一个日期,然后按下提交按钮。然后整天

以表格的单位显示。然后用户可以点击一个表示一天中的小时和一个对象(书籍..)的单元格,然后点击

提交按钮以插入在数据库中预订。


我的问题是:有很多javascript客户端代码。所有onclick

事件在客户端执行。

我有没有将其更改为服务器端代码或我仍然可以使用它

客户端代码?


asp.net的filosophy是真的:最大服务器端脚本和

最小客户端?如果是这样,服务器是否有过载的危险,

而不是在客户端和

服务器之间共享应用程序的执行?


感谢您的帮助

Ben

解决方案

这取决于您的客户端脚本正在做什么。

如果是buissnies逻辑那么它应该defenitly去服务器

代码。这有几个原因。例如:你不想要b $ b想要有人偷你的代码吗?并且javascript很棘手,因为

任何人都可以禁用它然后你的应用程序将无法工作。


Javascript应该用于客户端验证(必须有

它是服务器端的等价物)和用户界面。但永远不要用于buissnies逻辑!


你好,


b>我在经典的asp(预订书籍和视频

b> stuffs

b> for students)中提出了申请,并希望迁移到asp.net。

b>用户必须选择一个日期,然后按下提交按钮。

b>一整天

b>然后以表格的cels显示。然后用户可以点击

b> cel

b>表示一天中的一小时和一个物体(书籍......),最后是

b>点击

b>提交按钮将该预订插入数据库。

b>我的问题是:有很多javascript客户端代码。所有

b> onclick

b>事件在客户端执行。

b>我是否要将其更改为服务器端代码或我仍然可以使用它

b>客户端代码?


为什么这样做?目前的架构是正常的,不需要改变它


b> asp.net的filosophy是:最大服务器端

b>是真的吗?脚本和最小客户端?

这取决于您的脚本,功能以及与您需要的其他Web浏览器的兼容性。

如果一切顺利的话现在你不能为asp.net更改这个,除了

其中服务器端代码真的需要


b>如果是这样,是否有过载的危险

b>服务器,而不是共享应用程序的执行

b>在客户端和服务器之间?


是的,这是一个问题,因为VIEWSTATE很大(顺便说一下拉链很好)


- -

WBR,

Michael Nemtsev ::博客: http://spaces.msn.com/laflour


有时一个人仍忠于某一事业只是因为它的对手没有

不再是平淡的。 (c)Friedrich Nietzsche


感谢您的回复。

创建新应用程序时,您有何建议?使用

可能的服务器端代码或在cleint和服务器之间找到平衡点?

如何确定余额?

Ben

" Michael Nemtsev" <是ne ***** @ msn.com>在消息中写道

news:9c ************************** @ msnews.microsoft .com ... < blockquote class =post_quotes>你好,

b>我在经典的asp(预订书籍和视频b>东西b / gt;学生)中做了一个应用程序,并希望迁移到asp.net。
b>用户必须选择一个日期,然后按下提交按钮。
b>一整天
b>然后以表格的cels显示。然后用户可以点击
b> cel
b>代表一天中的一小时和一个物体(书......),最后是
b>点击
b>提交按钮将该预订插入数据库中。
b>我的问题是:有很多javascript客户端代码。所有
b> onclick
b>事件在客户端执行。
b>我是否要将其更改为服务器端代码或我仍然可以使用它
b>客户端代码?

为什么这样做?目前的架构是正常的,不需要改变它

b> asp.net的filosophy是:最大服务器端
b>是真的吗?脚本和最小客户端?

这取决于您的脚本,功能以及您需要与其他Web浏览器的兼容性

如果一切正常,那么您现在还没有要为asp.net改变这个,
除非服务器端代码真的需要,否则b / gt;如果是这样,是否有过载的危险
b>服务器,而不是共享应用程序的执行
b>在客户端和服务器之间?

是的,这是一个问题,因为VIEWSTATE很大(顺便说一句,拉链很漂亮

---
WBR,< Michael Nemtsev ::博客: http://spaces.msn.com/laflour

有时一个人仍然忠于某一事业,只因为它的对手做了b $ b不会不再平淡无奇。 (c)Friedrich Nietzsche



Hi,

I made an application in classic asp (reservation of books and video stuffs
for students) and want to migrate to asp.net.
The user has to chose a date, then pushung on a submit button. The whole day
is then displayed in cels of a table. The user has then to click in a cel
representing a hour of the day and an object (book ..), and finally click on
the submit button to insert that reservation in the database.

My problem is: there is a lot of javascript client-side code. All onclick
events are executed on client-side.
Have i to change this into server-side code or i can still use that
client-side code?

Is it true that the filosophy of asp.net is: maximum server-side script and
minimum client-side? If so, is there no danger to overload the server,
instead of sharing the execution of the application between client and
server?

Thanks for help
Ben

解决方案

That depends on what your client side scripts are doing.
If it is buissnies logic then it should defenitly go to the server
code. And there are several reasons for that. For example: you don''t
want someone to steal your code do you? And javascript is tricky as
anyone can disable it and then your application will not work.

Javascript should be used for client side validation (which must have
it''s server-side equivalent) and for UI. But never for buissnies logic!


Hello ben,

b> I made an application in classic asp (reservation of books and video
b> stuffs
b> for students) and want to migrate to asp.net.
b> The user has to chose a date, then pushung on a submit button. The
b> whole day
b> is then displayed in cels of a table. The user has then to click in a
b> cel
b> representing a hour of the day and an object (book ..), and finally
b> click on
b> the submit button to insert that reservation in the database.
b> My problem is: there is a lot of javascript client-side code. All
b> onclick
b> events are executed on client-side.
b> Have i to change this into server-side code or i can still use that
b> client-side code?

Why for doing this? The current schema is normal, needn''t to change it

b> Is it true that the filosophy of asp.net is: maximum server-side
b> script and minimum client-side?

It depends on your scripts, functionality and how much compatibility with
other web browsers do you need.
If everything works good now you haven''t to change this for asp.net, except
where server-side code is really need

b> If so, is there no danger to overload
b> the server, instead of sharing the execution of the application
b> between client and server?

yes, it''s a problem due to big VIEWSTATE (btw that is zipped pretty well)

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche


Thanks for replying.
When creating an new application, what do you suggest? Using as much as
possible server-side code or finding a balance between cleint and server?
And how to determine that balance?
Ben
"Michael Nemtsev" <ne*****@msn.com> wrote in message
news:9c**************************@msnews.microsoft .com...

Hello ben,

b> I made an application in classic asp (reservation of books and video
b> stuffs
b> for students) and want to migrate to asp.net.
b> The user has to chose a date, then pushung on a submit button. The
b> whole day
b> is then displayed in cels of a table. The user has then to click in a
b> cel
b> representing a hour of the day and an object (book ..), and finally
b> click on
b> the submit button to insert that reservation in the database.
b> My problem is: there is a lot of javascript client-side code. All
b> onclick
b> events are executed on client-side.
b> Have i to change this into server-side code or i can still use that
b> client-side code?

Why for doing this? The current schema is normal, needn''t to change it

b> Is it true that the filosophy of asp.net is: maximum server-side
b> script and minimum client-side?

It depends on your scripts, functionality and how much compatibility with other web browsers do you need.
If everything works good now you haven''t to change this for asp.net, except where server-side code is really need

b> If so, is there no danger to overload
b> the server, instead of sharing the execution of the application
b> between client and server?

yes, it''s a problem due to big VIEWSTATE (btw that is zipped pretty well)
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not cease to be insipid." (c) Friedrich Nietzsche



这篇关于从asp迁移:更好的客户端或服务器端代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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