简体   繁体   中英

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. 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. 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.

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. you should check viewstate of the page and try to lower it. 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. 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.
  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
  4. Consider things such as dynamic compilation - for example, you may generate source for your forms and compile them instead of on-demand generation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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