简体   繁体   English

asp.net中的可自定义UI

[英]Customizable UI in asp.net

I am working on a product, which works on table driven forms with asp.net, we declare the sections for a page and controls which will appear in that section. 我正在开发一种产品,该产品可与asp.net一起用于表驱动的表单,我们声明页面的各个部分以及将在该部分中显示的控件。 The possible values which can go into a particular control is also database driven. 可以进入特定控件的可能值也是由数据库驱动的。 The basic idea is to customize the ui and the flow of application as per each client's requirement.But this approach lacks in performance. 基本思想是根据每个客户端的需求自定义ui和应用程序流,但是这种方法缺乏性能。 It is very slow in rendering pages on client side. 在客户端渲染页面非常慢。 Please suggest alternatives to this approach. 请提出这种方法的替代方案。

Personally, I would rather first try to find why and where it is slow. 就个人而言,我宁愿先尝试找出速度缓慢的原因位置

Usually, running a quick performance profiler session (eg with Red Gate's ANTS Performance Profiler ) gives you ideas why it is slow. 通常,运行一个快速的性能分析器会话(例如,使用Red Gate的ANTS Performance Profiler )可以使您理解为什么它运行缓慢。

After you found out why it is slow, you could decide whether you 在找出缓慢的原因之后,您可以决定是否

  • Optimize your current algorithm -or- 优化您当前的算法-或者-
  • Switch to a new algorithm. 切换到新算法。

if you think there is no problem with server side, selecting data from db, or some other codebehind stuff. 如果您认为服务器端没有问题,请从db或其他代码隐藏对象中选择数据。 you should check viewstate of the page and try to lower it. 您应该检查页面的viewstate并尝试将其降低。 are you sure you dont have any problems on server side? 您确定服务器端没有任何问题吗?

The flaw would be mainly in details ie actual implementation of your data-driven UI. 缺陷主要在于细节,即数据驱动的UI的实际实现。 You must profile your application to find out what is making your application slow. 您必须对应用程序进行概要分析,以找出导致应用程序运行缓慢的原因。 There can be many facets to this exercise. 此练习可能有很多方面。 For example, 例如,

  1. Slow at server side processing - you can use simple means as logging/tracing (or a profiler application) to find out where you are loosing the time. 服务器端处理速度很慢-您可以使用简单的方式进行日志记录/跟踪(或探查器应用程序)来找出浪费的时间。
  2. Slow over network - you can be issuing to many resource requests for one page, large page size (due to view-state and/or in-lining of scripts and styles) etc. Use tools such fiddler/firebug/browser->View Source to determine such issues. 网络速度慢-您可能会发出一页的大量资源请求,页面大(由于视图状态和/或脚本和样式的内联)等。使用诸如Fiddler / firebug / Browser-> View Source之类的工具确定此类问题。
  3. Slow in browser (client side) - use of in-efficient markup and script is making your site sluggish. 浏览器(客户端)运行缓慢-使用效率低下的标记和脚本会使您的网站运行缓慢。

You can try out various things for improving performance - 您可以尝试各种方法来提高性能-

  1. Try to cache things - you can cache meta-data (definitions for your forms), you can cache the user data, you can cache "processing" ie results of some involved processing. 尝试缓存事物-您可以缓存元数据(表单的定义),可以缓存用户数据,可以缓存“处理”,即某些涉及处理的结果。 For example, you can cache the markup of your rendered blank form and serve it when user requests a blank form. 例如,您可以缓存呈现的空白表单的标记,并在用户请求空白表单时提供它。
  2. Compress your responses, minifies your scripts, externalize styles & scripts 压缩您的响应,最小化脚本,外部化样式和脚本
  3. Use ajax for better user experience 使用ajax以获得更好的用户体验
  4. Consider things such as dynamic compilation - for example, you may generate source for your forms and compile them instead of on-demand generation 考虑诸如动态编译之类的事情-例如,您可以为表单生成源并进行编译,而不是按需生成

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

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