如何创建自定义网站? [英] How to create Customize Website?

查看:109
本文介绍了如何创建自定义网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何创建自定义Web应用程序。用户可以根据自己的选择自定义整个网站..

How to create customize web application. User can customize whole website according to own choice..

推荐答案

有趣的想法,但我不确定它是否实用。那么,为什么不呢?



我可以在最简单的自定义方面解释这个想法,自定义CSS样式。首先,您允许用户在某个示例页面上使用样式。您可以在客户端使用的一件事是jQuery CSS功能。请参阅:

http://api.jquery.com/category/css/ [ ^ ]。



您可以创建一些基本的CSS类,每个类只控制一个表示方面。例如,一个控制背景颜色,另一个控制前景,其他人处理边距/填充等。用户可以将这些类逐个添加到某些元素并更改颜色,尺寸等参数。当用户进行最终操作时选择,您将最终组合课程中的所有偏好结合起来。根据您要为每个要实现的CSS功能开发的CSS数据的开发,您应该根据您的数据模型创建一些正式数据。然后将所有这些数据存储在数据库的服务器端。所有表都应具有用户外键,并按用户进行组织。您需要使用Ajax根据所选样式提交数据:

http:// api。 jquery.com/category/ajax/ [ ^ ]。



当用户开始使用此方的其余部分时,您应该查看当前会话中的用户记录,并在生成每个页面时检索此样式数据。有关ASP.NET身份验证的信息,请从这里开始:

http://msdn.microsoft.com/en-us/library/aa291347%28v=vs.71%29.aspx [ ^ ]。



您可以使用外部CSS文件以通常的方式在HTML中使用CSS,但不是使用存储在服务器上的静态文件,而是需要使用每用户样式数据动态生成CSS内容从数据库中检索。您需要为每个ASP.NET URI生成整个CSS内容,使用类 System.Web.HttpResponse

http://msdn.microsoft.com/en-us/library/system.web.httpresponse.aspx [ ^ ]。



查看上面引用的文章末尾的代码示例。它演示了使用 Response.ContentType image / jpeg创建图像内容,但是你需要一个不同的类型,text / css:

http://tools.ietf.org/html/rfc2318 [ ^ ]。



对于其他标准内容类型,请参阅IANA标准: http://www.iana.org/assignments/media-types [< a href =http://www.iana.org/assignments/media-typestarget =_ blanktitle =New Window> ^ ]。



使用这个想法,你可以发明定制的许多不同方面。



-SA
Interesting idea, but I'm not sure if it is practical or not. So, why not?

I can explain the idea on the simplest aspect of customization, custom CSS styles. First, you allow the user to play with styles on some sample page. One thing you can use for this on client side, would be jQuery CSS feature. Please see:
http://api.jquery.com/category/css/[^].

You could create a number of some elementary CSS classes, each controlling only one aspect of presentation. For example, one would control background color, another a foreground, others deal with margins/padding, etc. The user could add those classes one by one to some elements and change parameters like colors, dimensions, etc. When a user makes the final choice, you combine all those preferences in final combined classes. This should be just some formal data according your data model you can develop for presentation of CSS data, per each CSS feature you want to implement. Then you store all this data on the server side in your database. All tables should have a user foreign key and be organized per-user. You would need to use Ajax to submit data based on the chosen styles:
http://api.jquery.com/category/ajax/[^].

When a user starts using the rest of this side, you should look at the user record in a current session and retrieve this style data while generating each page. For the information on ASP.NET authentication, please start here:
http://msdn.microsoft.com/en-us/library/aa291347%28v=vs.71%29.aspx[^].

You can use CSS in HTML in a usual way, using the external CSS files, but instead of static files stored on server, you would need to generate CSS content dynamically, on the fly, using per-user style data retrieved from the database. You would need to generate the whole CSS content for each ASP.NET URI, using the class System.Web.HttpResponse:
http://msdn.microsoft.com/en-us/library/system.web.httpresponse.aspx[^].

Look at the code sample at the end of the article referenced above. It demonstrate creation of the image content with the Response.ContentType "image/jpeg", but you will need a different type, "text/css":
http://tools.ietf.org/html/rfc2318[^].

For other standard content types, please see the IANA standard: http://www.iana.org/assignments/media-types[^].

Using this idea, you can invent many different aspects of customization.

—SA

这篇关于如何创建自定义网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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