使用ASP.net的WebForms或MVC咨询 [英] Advice on using ASP.net WebForms or MVC

查看:144
本文介绍了使用ASP.net的WebForms或MVC咨询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个面向公众的网站的嗜好,获取约3000独立访客,每天写在传统的ASP是在恶劣的需要改头换面的重新设计。我所面临认识到升级到ASP.net是去实施是太辛苦ASP为爱好者特性的最佳方式(消费RSS提要,身份验证和用户配置文件),但我渴望得到扎进一旦我得到过去的重新设计/升级。

I have a public facing hobby site that gets about 3000 unique visitors a day, written in classic ASP that is in bad need of a revamp and redesign. I've faced the realization that an upgrade to ASP.net is the best way to go to implement features that are just too hard in ASP for the hobbyist (consuming RSS feeds, authentication and user profiles) but which I'm keen to get stuck into once I get past the redesign/upgrade.

不过,我一直瘫痪的不确定性有关哪个方向走:Web窗体或MVC - 加的事实,有似乎总是一些新的版本,以启动这似乎是这将是值得坚持要求提高学习曲线。所以,我花时间阅读的WebForms然后阅读的东西,告诉我,我可能会更好想着MVC,然后阅读有关MVC和不知道它是否真的适合我想要做的。

But, I have been paralysed with uncertainty about which way to go: Web Forms or MVC - plus the fact that there always seems to be some new release about to launch that seems like it would be worth holding out for to improve the learning curve. So I spend hours reading about WebForms then read something that tells me I might be better off thinking about MVC, then read about MVC and wonder whether it actually suits what I'm trying to do.

教程人及起动机网站真正谈论什么行之有效的是传统的老静态信息网站的网站(非目录或用户内容驱动)。

None of the tutorials and starter sites really talk about what works well for sites that are traditional old static information sites (not catalogues or user-content-driven).

我的网站约75%的静态信息的页面很少变动。不过,ASP脚本是在所有这些网页的用户界面至关重要 - 动态随机或采摘的设计元素(如标题照片)或者基于随机一年或一天提供特定边栏

My site is about 75% static information pages that rarely change. However, the ASP scripting is essential in the user interface on all those pages - dynamically or randomly picking design elements (like a header photo) or providing a particular sidebar box based on the day of the year or at random.

那种脚本我有是东西就像一个脚本来随机挑选并显示30头图像的网页之一,以显示脚本文本和链接基础上,今年它是什么日子,一个脚本,让我声明特定的搜索关键词为是相关的特定页面的内容,具有pre装在搜索输入框中的文本页面加载时。

The kind of scripting I have is things like a script to randomly pick and display one of 30 header images for the page, a script to display text and links based on what day of the year it is, a script that allows me to declare a particular search keyword as being relevant to the content for a particular page and having that pre-loaded as the text in the search input box when the page loads.

对于大多数网页的休息,他们对显示数据。其中一些是小的记录(什么是对今年的这个特殊的日子显著年历类型信息),我保存它,并在页面本身的数组变量拉出。别人拉从很少改变,以至于我从来没有打扰实施CUD功能刊登在网站上的Access数据库中的信息(以及必要的角色和身份验证,以确保它),而只是使数据库脱机更新和上传发送实时更改

For most of the rest of the pages, they are about displaying data. Some of them are small recordsets (almanac type information about what is significant about this particular day of the year) and I save it and pull it from an Array variable in the page itself. Others pull information from an Access database that changes rarely enough that I've never bothered implementing CUD functionality live on the site (and the necessary roles and authentication to secure it), but just update the database offline and upload it to send the changes live.

通过ASP.net,我会被罚款移动到SQL Server和建设现场管理页面。我不需要坚持访问。

With ASP.net, I would be fine moving to SQL Server and building live administration pages. I don't need to stick with Access.

不过,我更习惯于编写原始的HTML和CSS和我发现的WebForms(特别是视图状态和事件/回发),以让我的头围绕在概念上是一个挑战。尽管它似乎更适合与静态页面与一些服务器端code文件系统,我已经习惯了。

But, I'm more used to writing raw HTML and CSS and I'm finding WebForms (especially Viewstate and events/postbacks) a challenge to get my head around conceptually. Even though it seems to fit more with the static page in a file system with some server-side code that I'm used to.

在另一方面,MVC似乎非常适合于手工精心codeD的设计,但这里的一切会从数据库中抽取。

On the other hand, MVC seems to be well suited to lovingly hand-coded design, but where everything gets pulled from a database.

你会怎么推荐?我应该把所有的静态页面到数据库,并通过MVC的文章的看法?

What would you recommend? Should I pull all the static pages into a database and serve them through an "article" view in MVC?

我不是一个专业开发人员 - 所以它不是什么看起来最好在我的简历。我只是在寻找什么都会(一)有最少的学习曲线有人从VBScript内联前pressions进来传统的ASP和(b)什么最适合我的是什么网站没有和(c)让我有一定的控制在标记和CSS。

I'm not a professional developer - so it's not about what will look best on my resume. I'm just looking for what will (a) have the least learning curve for someone coming from VBScript inline expressions in classic ASP and (b) what best suits what my site does and (c) lets me have some control over the mark-up and CSS.

推荐答案

肯定去MVC,特别是如果你更舒适的一个HTML / CSS的家伙。回发没有特殊优势的网站,主要是静态的,这将需要几个月的时间,为您解决页面生命周期你的头(我还没有遇到一个开发谁是生命周期的主人6个月它的编码后。 )

Definitely go MVC, especially if you're more comfortable as an HTML/CSS guy. Postbacks offer no advantage for a site that is largely static, and it will take months for you to get your head around the page lifecycle (I have yet to meet a developer who was a master of the lifecycle after 6 months of coding in it.)

转换一个ASP经典站点MVC将主要涉及移动你的HTML和ASP标记为视图,和您现有的URL使用路由机制进行复制。你需要升级你的脚本中使用一些更现代的功能,但是这应该是相当简单我会想象。

Converting an ASP classic site to MVC will basically involve moving your HTML and ASP tags into Views, and replicating your existing URL's using the routing mechanisms. You'll need to upgrade your scripts to use some more modern functionality, but that should be fairly straightforward I would imagine.

我的想法,在MVC一切都是从数据库中抽取不同意。我在MVC框架codeD 100%的静态网站和喜欢它:)

I do disagree with the idea that in MVC everything is pulled from the database - that's a bit irrelevant to the architecture. I've coded 100% static sites in MVC frameworks and loved it :)

我的经验法则是趋势朝着这个:MVC的网站,为的WebForms企业Web应用程序 - 也许

My rule of thumb is trending towards this: "MVC for websites, WebForms for enterprise web applications - maybe."

这篇关于使用ASP.net的WebForms或MVC咨询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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