cvboucher
Posts: 191
|
Posted: 04/18/2013, 2:32 PM |
|
This is a work around to setting the FileFolder property on the FileUpload component at runtime. It is specific to .Net InMotion and was done in CCS5.
I wanted to set the FileFolder property at runtime from an AppSettings value. The problem was setting it in the BeforeShow event of the control was too late in the page rendering process and I would get an error that the file couldn't be found when I edited a record. I also tried getting a reference to the control from a number of other page and record events but for some reason I could never get one back. As a work around I created a .dll in Visual Studio to grab the app setting value and put it in the bin folder of the website. Then, in the FileFolder property in CCS5 I entered the following:<%# DRSLib.AppSettings.ExamFilesFolder %> DRSLib is my .dll, AppSettings is my custom AppSettings class, and ExamFilesFolder is a shared/static read only property that returns the app setting value.
The reason I had to use a custom dll instead of just using the .Net AppSettings class is that using double quotes in this property causes problems.
HTH,
Craig
|