Detecting if a there is a license file

  •  09-17-2009, 7:01 AM

    Detecting if a there is a license file

    Hi,
    I have copied the license file AjaxUploader.lic in a sub-folder "AjaxUploader" of my web application, and written the following key in the web.config:
    <add key="AjaxUploaderLicense" value="AjaxUploader/AjaxUploader.lic" />
    and it works well.
     
    Now, if I delete the license file, I get an unhandled javascript exception after selecting the files and clicking "Open" in the browse dialog :
    " Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500"
     
    Is there a way to detect from code behind (C#) if there is a valid license file?
    So that, in the case of the license file is not present, or if it has expired, then I can display a proper error message or use an alternate control.
     
    Thanks in advanced.
    Filed under:
View Complete Thread