Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

CSS and images deployment in _wpresources

  Asked By: Deon    Date: Sep 15    Category: Sharepoint    Views: 1364

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.

Share: 

 

1 Answer Found

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

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.




Tagged: