質問

I have multiple multi-select DropDown controls (user controls) on a page. Even though it is not a good practice to load thousands of items in a DropDown, but I can't change the existing project requirements.

Two DropDown controls are populated with around thousand items in the list. Since I am populating all the DropDown controls on Page Load, it is taking lot of time to load the page.

I want to use a different thread to populate these two controls. Is it possible to use different thread for controls on the same page?

役に立ちましたか?

解決

In ASP.NET multi threads makes no sense actually

In ASP.NET even if you use thread, your response will be sent as one one big chunk after all those threads are completed. So creating a new Thread will only slow your already slow app (with all thread management over head)

Instead what you need is Parallel, AJAX and Caching

Parallel Progamming: What this dose will use all cores in your servre and will fill the items soon.

AJAX: What you can do is load the page and after the page is loaded do a AJAX request to load the items in background through AJAX calls.

Caching: This will let you cache parts of pages, Even your user control only can be chached, This will save lot of time in your case

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top