Home : WebForms Web Viewing Controls : Use a WebResource Folder to Improve Performance of ASP.NET Web Controls
Q10400 - HOWTO: Use a WebResource Folder to Improve Performance of ASP.NET Web Controls

NOTE: This article refers to our "Classic" ASP.NET web controls (WebAnnotationViewer, WebImageViewer and/or WebThumbnailViewer) and not to our newer WebDocumentViewer/WebDocumentThumbnailer controls.


BACKGROUND:
Our Classic ASP.NET web controls: WebAnnotationViewer (WAV for short), WebImageViewer (WIV for short) and WebThumbnailViewer (WTV for short) have both server-side and client-side components. However, "out of the box" you don't manually add the various javascript and css files used in the controls...

Where are they?
They're stored inside the Atalasoft.dotImage.WebControls.dll reference that you add to your web project... and they're extracted and served up every time someone visits the page.

What are the pros and cons?
The thing is, this is very convenient for development - update your dlls (for instance, upgrading to a newer version of DotImage) and you've updated the server and client side components in one shot. The bad news is that this extraction takes time and prevents the JavaScript components used for the client-side of the controls from being cashed.

So, for development, you're best just "taking the hit" since it makes things easy to manage, but in production, you really will see an improvement in startup time and for subsequent requests if the files don't needt to be extracted every time.

INSTRUCTIONS:
1) in the root of your web project, add a new directory. You can call it what you like, but for this example we will call it "WebResources"

/WebResources/

2) Navigate to
C:\Program Files (x86)\Atalasoft\DotImage X.Y\bin\2.0\x86\WebResources\

(where x.y is the DotImage version such as 10.4 ... etc...)

Pleae note that the framework and x86/x64 do not matter for clientside so just use this directory - only changing the X.Y where needed

3) COPY the contents of that directory (but you can skip the WebCapture and WebDocViewer subdirectories) to your project's /WebResources/ directory that you created in step 1

4) Open your project's web.config file and locate the <appSettings> section
If you're using WAV/WIV/WTV, then you've already got an appSettings section something like this:

<appSettings>
   <add key="AtalasoftWebControls_Cache" value="AtalaCache/" />
   <add key="AtalasoftWebControls_CacheLifeTime" value="20" />
</appSettings>

In that section add the following key/value pair

   <add key="AtalasoftWebControls_ResourcePath" value="/WebResources/" />

So the whole section looks something like this:

<appSettings>
   <add key="AtalasoftWebControls_Cache" value="AtalaCache/" />
   <add key="AtalasoftWebControls_CacheLifeTime" value="20" />
   <add key="AtalasoftWebControls_ResourcePath" value="/WebResources/" />
</appSettings>


5) test it out - you can confirm you've got things working by deliberately changing that value from "WebResources" to some non-existent file... if you receive an exception/error when doing that and the error goes away when pointing back to the correct location, this confirms you're actually using the files.

NOTE::: Once you go this route, you MUST remember that any time you update your Atalasoft version to a new one, you MUST re-copy the files from steps 2&3 into your project (along with updating the project's references) as getting the version in that WebResources directory out of sync with the DLL version can have very serious negative consequences.

ALSO NOTE: Please do not be tempted to modify the files in WebResources in any way - any such modification outside the direct instructions of Atalasoft Support can result in extremely subtle/difficult to troubleshoot errors and is considered an unsupported modification.

 

Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.

Powered By InstantKB.NET v1.3
Copyright © 2002, 2017. InstantASP Ltd. All Rights Reserved