简体   繁体   English

在IIS上部署后,我可以更改网站的内容

[英]Can I change the Contents of the website after it gets deployed on IIS

I have a website in asp.net which contains a User Input form page where user can enter various details like Name, Id, Contact No, Address etc. Now as per my requirement I have to make this webpage generic such that in future if the Client wants to change the Name with Employee Name, Id to wwid, Contact No to Mobile No etc. it should be changed. 我在asp.net中有一个网站,其中包含一个用户输入表格页面,用户可以输入各种详细信息,如姓名,身份证号码,联系号码,地址等。现在根据我的要求,我必须使这个网页通用,以便将来如果客户希望更改名称为员工姓名,Id为wwid,联系号码为移动号码等,应更改。 Now I have two points in my mind to try this. 现在我有两点要想试试这个。

  1. First one will be to make the Content Management system (CMS) and store, retrieve from there. 首先是制作内容管理系统(CMS)并从那里进行存储和检索。

  2. Now my doubt and question. 现在我怀疑和质疑。 Can I replace the Contents of the webpage after deployment on Button Click to avoid storing and retrieving from database. 我可以在部署按钮后替换网页的内容单击以避免存储和从数据库检索。

You could put all your human-readable strings in a standard .resx file. 您可以将所有人类可读的字符串放在标准的.resx文件中。 You can develop your C# code and ASPX/ASCX controls to read strings from there. 您可以开发C#代码和ASPX / ASCX控件来从那里读取字符串。 The client can edit the .resx file if he wants to. 如果他愿意,客户端可以编辑.resx文件。 Just make sure that if you deploy a new version, you don't overwrite his changes. 只需确保如果部署新版本,则不会覆盖其更改。 Guides: http://msdn.microsoft.com/en-us/library/ms227427.aspx 指南: http//msdn.microsoft.com/en-us/library/ms227427.aspx

You can achieve this by storing strings which should be changed in future in database (no matter which) and when loading page read them. 您可以通过存储将来应该在数据库中更改的字符串(无论哪个)以及加载页面时读取它们来实现此目的。

Second alternative is in fejesjoco post. 第二种选择是fejesjoco帖子。

You can render your pages and use the client-side (Javascript/jquery) to modify the structure of the page. 您可以渲染页面并使用客户端(Javascript / jquery)来修改页面结构。 Maybe you can use ajax posts to wait only for parts of the page instead of waiting for the whole page to appear, depends on your situation. 也许您可以使用ajax帖子等待页面的某些部分,而不是等待整个页面出现,具体取决于您的情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM