编辑服务器上的.aspx页面的最佳方法是什么? [英] What is the best way to edit .aspx page which is on server.

查看:110
本文介绍了编辑服务器上的.aspx页面的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我有一个在asp.net上的网站。我的要求是我的客户希望他需要权限来编辑.aspx页面。喜欢如果他想添加新图片或删除一些内容。

所以请指导我最好的方法。我尝试了一件事。我已经在数据库中保存了页面的HTML内容,这是sql server。包含HTML的列我在.aspx页面中显示。哪个工作正常,除了一些设计问题。如果有更好的方法,请告诉我。



提前致谢

Neetesh Agarwal

Hello All,

I have a website which is on asp.net. My requirement is that my client wants that he need authority to edit .aspx page on his end. Like If he want to add new image or remove some content.
So please guide me what is best way to do this. I have tried one thing. I have saved HTML content of page in database which is sql server. The Column which contains HTML I am displaying in .aspx page. which is working fine except some design issue. Please let me know if there is any better way to do it.

Thanks in Advance
Neetesh Agarwal

推荐答案

哇 - 有很多方法,很少有好方法。



如果客户愿意支付CMS(内容管理)那么这是最好的方法。虽然设置需要很多资源。



如果要求是设计更改,只要它是一个网站而不是一个Web应用程序,那就没关系(在大多数情况下)。您可以更改标记,但不能更改代码隐藏。



如果它是一个Web应用程序或只是一些文本或图像更改而不是整个页面或设计,那么您可以将它们存储在数据库中并在运行时加载它们。您必须为客户端提供一些门户,以便能够编辑和更新这些项目。这描述了一个非常愚蠢的CMS



与任何开发者一样,你必须告诉客户,根据具体情况,有几种选择。这里的不同之处在于成本范围从几个小时到整个CMS和CMS-dev时间(许多1000英镑)
Wow - so many ways, so few good ones.

If the client is willing to pay for a CMS (Content Management System) then that's the best way. It takes a lot of resources to set up though.

If the requirement is design changes, as long as it is a website and not a web application then that's fine (for the most part). You can change the markup but not the code-behind.

If it's a web application or just some text or image changes and not the whole page or design, then you can store these in a db and load them at run time. You will have to give the client some portal to be able to edit and update these items. This describes a very dumbed down CMS

As with any dev, you will have to tell you client that there are several options depending on the situation. What's different here is the span of cost ranges from a few hours to a whole CMS and CMS-dev time (many £1000's)


这正是为什么内容管理系统 [ ^ ]被介绍了。您可以为应用程序创建系统,以便在GUI模式下为您的客户提供功能。他们甚至不需要改变任何东西,他们可以应用模板,更改内容,更新甚至删除内容。允许用户或客户编辑HTML文件或ASP.NET HTML文件(例如aspx,cshtml,vbhtml等),不仅因为它们是在构建解决方案时为用户请求生成动态HTML文件而编译的(请参阅谢谢谢谢谢谢的解决方案3 ,但主要的是客户端可能会搞乱界面,HTML元素,语法等等。为此,CMS为您提供了一种创建维护模板但仍允许客户端完全使用该应用程序的系统的好方法。



CMS为客户提供编辑网页(aspx页面)的功能,他们可以使用WYSIWYG编辑器(如CKEditor或其他人)编写内容,添加图像或其他多媒体。然后保存内容将其保存为HTML内容,可以由CMS本身全部呈现。我建议您阅读有关这些系统的更多信息,ASP.NET也可以与CMS一起使用,您可以搜索一些CMS, Umbraco [< a href =http://umbraco.com/target =_ blanktitle =新窗口> ^ ]就是其中之一,甚至官方的ASP.NET网站都使用Umbraco。



对于一个工作示例,看看Wordpress(这是一个CMS,不仅仅是一个博客网站),或者一个简单的例子是CodeProject文章编辑器,你不需要为此编写HTML,你可以用纯文本编写它!
That is exactly why Content management systems[^] were introduced. You can create a system for your applications so that your clients are provided with features, in a GUI mode. They don't even have to change anything, they can apply templates, change the content, update or even delete the content. Allowing the users or clients to edit the HTML files, or ASP.NET HTML files (e.g. aspx, cshtml, vbhtml etc.), not only because they are compiled when you build the solution to generate dynamic HTML files for users' requests (see Solution 3 by Sergey for more on this) but the main thing is that client might mess up with the interface, HTML elements, syntax and much more. For this, CMS provides you with a great way to create a system that maintains the template but still allows the client to fully use the application.

CMSs provide clients with features to edit the web pages (which are the aspx pages), they can use WYSIWYG editors such as CKEditor or others to write the content, add images or other multimedia. Then saving the content would save it as HTML content, which can be rendered all by the CMS itself. I would recommend that you read more about these systems, ASP.NET also can be used with CMS, you can search for some CMS, Umbraco[^] is one of them, even official ASP.NET website uses Umbraco.

For a working example, have a look at Wordpress (that is a CMS, more than a blogging website), or a simple example is the CodeProject article editor, you don't need to write the HTML for that, you can write it in plain-text!


在服务器上编辑网页很困难,也很危险。

这很难,因为您需要知道用户在编辑页面时可能正在使用页面,因此任何更改都需要作为一个完整的集合应用,以避免与用户体验并发。



在现场机器上编辑它们很危险,如果你犯了一个微不足道的错误,那就是获得乐趣和游戏的客户 - 取决于网站的内容正在做,而且错误有多糟糕,这可能会花费很多钱!

你应该总是对开发数据库进行离线编辑,以确保它在更新生产之前就像它一样好系统。



允许在线编辑也很危险,因为它留下了很容易被利用的大量安全漏洞 - 然后您的网站可能被接管竞争对手,心怀不满的员工或其他受到损害的人。



说真的:说服你的客户这不是一个好主意,并为他提供修改,测试和发布的工具他的页面。 FTP和本地IIS是一个良好的开端。
Editing web pages on a server is difficult, and very dangerous.
It's difficult, because you need to be aware that users could be using the page(s) while you are editing them, so any changes need to be applied as a complete set to avoid "complications" with the user experience.

And it's dangerous to edit them on the live machine, if you make even a trivial mistake, it's the customers who get the fun and games - depending on what the website is doing, and how bad the mistake is, this could cost serious money!
You should always edit off line, against a development Database to ensure it is as good as it can be before you update the production system.

It's also dangerous to allow on-line editing, because it leaves massive security holes that are very easy to exploit - and then your site could be taken over by a competitor, disgruntled employee, or otherwise compromised.

Seriously: persuade your client that it's not a good idea, and provide him with tools to modify, test, and publish his page. FTP and a local IIS is a good start.


这篇关于编辑服务器上的.aspx页面的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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