Posts

Showing posts with the label visualforce page access static resource

Access Static Resource in Visualforce Page

           Accessing salesforce static resource depends on the whether you want access standalone single file or you can access file with in archive such as .zip           1. You want access stand alone single file means use $Resource . filename. here filename indicate which file you want to import in visualforce page. We want to use   $Resource.filename with this {!}. other wise it throw the error the example is given below,             <apex:image url="{!$Resource.CoffeeImage}" /> or we can access using URLFOR to access the static resource             <script type="text/javascript" src="{!URLFOR($Resource.Mainjs)}"/>          2. Access static resource from the archive means use URLFOR function. this first parameter used to point out the archive name and second parameter used to indicate the file name which are ...