Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

CSS and images deployment in _wpresources

  Asked By: Deon Pacheco         Date: Sep 15, 2009      Category: Sharepoint      Views: 472
 

I am developing a webpart and I need to make use of custom CSS files
for webpart rendering. Now, when I deploy the resources of webpart to
an assembly subdirectory under _wpresources virtual directory, how do
I reference images in custom CSS file?

I do not want to hard code like below

.class_name
{
cursor:
url("/_wpresources/assembly_name/<version>__<publicKeyToken>/home.gif")
}

Please help on how to make the above url dynamic.

Tagged:            

 

1 Answer Found

 
Answer #1       Answered By: Mayur Mandal          Answered On: Sep 15, 2009       

string resourcePath =
SPWebPartManager.GetClassResourcePath(Microsoft.SharePoint.SPContext.Current.Web\
,this.GetType());

 
Didn't find what you were looking for? Find more on CSS and images deployment in _wpresources Or get search suggestion and latest updates.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].