Advertisements
Home > CRM > Different ways of referencing web resources – CRM

Different ways of referencing web resources – CRM

If you have a HTML file added as a Web resource in CRM and it need to refer below web resources

  • new_jquery
  • new_dummy

Below are 2 ways to achieve the same

Standard Way

One way is to follow below convention to refer the web resource files in your HTML file

<script src=”../webresources/{webresourcename}”></script>

Referencing by folders

Assume you maintain files in folder structure, in your Visual studio solution which looks as below

  • Jscript
    • Util
      • jquery.js
      • helper.js
    • Account
      • account_form.js
      • account_ribbon.js
  • CSS
    • dummy.css

Below is a more readable way to refer CRM web resources in HTML file.

Below are steps to achieve same.

Step 1

Add web resources with name as “solution prefix_/{webresourcename}”, as below.

  • new_/Jscript/Util/jquery
  • new_/CSS/dummy
Web resource with folder naming

Web resource with folder naming

Step 2 

When you follow above naming convention, web resources can be referenced like how we do it in Asp.net projects, as below

<script src=”Jscript/Util/jquery” type=”text/javascript”></script>

Refer MSDN Link

Advertisements
Categories: CRM Tags: , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: