.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

how to apply css to custom web part?

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :SharePoint
I've created a custom web part in visual studio 2005. i want to apply style sheet to this web part? how do i do this? where should i add reference for css in custom code?

View Complete Post

More Related Resource Links

Windows XP: Escape from DLL Hell with Custom Debugging and Instrumentation Tools and Utilities, Part


Building on his article published in the June issue, which demonstrated several ways to get process and DLL-related information from APIs such as PSAPI, NTDLL, and TOOLHELP32, the author presents some unusual ways to get system-oriented info that you can easily integrate in your own toolkit. There are three tools included as samples: LoadLibrarySpy, which monitors an application and detects which DLLs are really loaded; WindowDump, which retrieves the content and a detailed description of any window; and FileUsage, which redirects console-mode applications to tell you which process is using any opened file.

Christophe Nasarre

MSDN Magazine August 2002

Apply custom.master to "Site Settings" page?


I'm using a custom.master page, which is applied to almost all pages available to READ users.

However, I'd like to apply it to the Search, Site Settings, and View All Site Content pages.

I'm not sure where this would be applied.

Guidance much appreciated. Thanks!

Need Suggestions for my Custom Web part


Hi All,

This may be a little longwinded to give you all the details so please bare with me. I'm hoping someone has some creative suggestions regarding how to approach a problem I'm having.

I've created a web part which reads list items from an announcement list. I then display the "title" field as a link on the web part for the most recent 5 items. When the title link is clicked, it uses jQuery UI to pop open a window and display the body. Currently, when a list item is displayed, I programmatically give that table row a class name.

Example: If there are 3 list items, item 1 would have a class name class="item1", item 2 is class="item2" etc.. Currently I have a hard stop at 5 items. This is because the jQuery looks for the class names in order to know which body to display. So in my js file I have those class names hard coded up to 5 items.

Finally! The problem I'm having is that I can't have multiple instances of this custom web part on the page due to the class names. If I have 2 instances of this web part on the same page and I click the first item from one of the web parts, the body of the first item on both web parts opens. Because both have the class name "item1". I am looking for suggestions regarding how I can implement this in a way that will allow the class names to be auto generated (proba

Overriding web.config in sharepoint webpart/using custom membership in web part

I'm developing a web part for MOSS 2007. The web part is being deployed to a web application which utilizes forms-based authentication, and role/membership providers to control users. The membership table has been edited to include addition user info (I am aware, that this isn't the best way to handle additional user, i.e. profiles etc., however, this is a requirement from another department). Since my web part needs to access this information, I was thinking of implementing a custom membership provider. So far I've followed: http://msdn.microsoft.com/en-us/library/6tc47t75.aspx and I've got my custom membership class, and a very stripped down membershipprovider-class. But how do I enable/use this membership provider in my web part? I've tried creating a simple web.config in the "WebPartCode" folder of my solution, next to my webpart code file, with connection string and membership provider tags. But I don't even really know how to build/reference/use the membership provider itself, so I don't know what else I need to do. I've built a C# class library project with the two classes (membershipprovider and custom membershipuser) and compiled it and installed it in the global assembly cache - is this correct? and how do I access them from here? Hope someone can help

remove web part from custom site defintion

Hi,    I need to remove a web part from a custom site defintion. The links web part needs to be removed from the site defintion.  I have recreated the site definition from sts . I found this good article (http://blogs.msdn.com/b/sharepoint/archive/2007/03/22/customizing-moss-2007-my-sites-within-the-enterprise.aspx). but a bit lost as i can't find the wp.gettype method the author is using. I am open to suggestion or  is there  a way to remove the web parts by creating a user control which would remove the web parts.  

Custom Web Part Problem After SharePoint Restore

Hi, I've recently moved our sharepoint site and databases (using Microsoft Internal Database) to another standalone server. I did a catastrophic backup and then restored it on the destination server successfully via the central Administration page. I have also copied our custom web part library dll to 'c:\windows\assembly' directory and 'C:\Inetpub\wwwroot\wss\VirtualDirectories\80\bin' directory. I also copied over the old web.config file to 'C:\Inetpub\wwwroot\wss\VirtualDirectories\80'. However, I still seem to be missing something as I get the error below while loading the site. I haven't been able to find a solution so hoping someone has seen it before here. Has anyone seen this happen before? Any advice/help would be greatly appreciated. Many thanks. Mehds ERROR====================================================================================================== The “webpartname” web part appears to be causing a problem. Object reference not set to an instance of an object.  Web parts maintenance page: if you have permission, you can use this page to temporarily close web parts or remove personal settings. For more information, contact you site administrator. ==========================================================================================================

How to keep custom web part collapsed on page load

Hi, I have developed one custom web part and successfully deployed it on MOSS site. Now the requirement is that the custom web part should be collapse mode by default. how to do this? Which property need to set and where? Please suggest.

MyLinks dropdown apply to one asp.net dropdown control in MOSS custom webpart

Hi, I am using MOSS 2007 with Visual Studio 2008. I have to develop one custom webpart having one asp.net dropdown. Now on click of that it should open the same or similar type of window which open OOB Mylinks link. can anyone suggest me some solution or related links?

Deploying a Custom Web Part

I created a custom web part using Visual Studio 2010.  I am able to add the web part to the default SharePoint site; however, the custom web part is not showing up in other sites on the same server.  I am using SharePoint 2010.  Any advice?

Custom Web Part deployment with class library reference

Hi All, We have class library as a project in our solution as well as a web part project. Our web part simply references and executes a service utility class in the class library and outputs it into a label. The deployment is successful but when attempting to add the web part to the page, it comes out with a error page saying "File Not Found" with a correlation ID and date/time reference. Once we take out the code that executes the utility class, it deploys fine and we're able to add it to the page without any issues. It seems evident that any reference to our class library causes this "File Not Found" issue... but we're not sure how to implement this solution. Any ideas? Do we add the class library dll directly into the GAC?  If so, how? Is there another reference we have to implement in the AssemblyInfo.cs?  If so, what does that look like? Any help is appreciated. Thanks, Eric

Programmatically adding Calendar web part with summary view or custom view?

Within my feature I am adding a calendar web part to page.  I would like to specify the summary view (not the full graphic calendar view).  Is this possible? Is it possible to create a custom view and set the listviewwebpart to this custom view through code?   thx -davedave

Encapsulating custom list into a deployable web part.

Hello,I have created a custom list (using the internal create column method and not infopath) and then created new pages (EditForm.aspx, NewForm.aspx) using sharepoint designer so that I could format the pages as I needed. I need to somehow 'deploy' the entire custom list as a single web part whereby when another sharepoint instance could use the web part and utilize all the pages (new, edit etc) but always stay within the web part. - the only way i can see to do this is to create a new wep part using sp designer and using div's to hide / show different content. or, could i actually do a master page thing.Please help.If what I have said above is total gibberish then please say and I will try to explain it differently. Many thanks for any help I really am stuck in a hole.Kind regards,Jason.

Custom Web Part doesn't work with in anonymous access

Hi there, I have a custom webpart in a farm solution deployed to my site. Anonymous users should be able to view the site, however they can't because they are required to login due to the custom web part. If i remove the webpart from the page, anonymous users can view the site perfectly without the need to login. There is nothing really special about the webpart. It's a visual web part which uses the site and it's web data to display a sort of menu. Any idea? Thx in advance! Brecht

Support paging in custom xslt and apply it to Listview webpart

Hi Gurus, I have a listview webpart. I want to apply a custom xslt to it. I am able to apply a custom xslt to the listview webpart, however I am not able to find a xslt code to support "paging" in the xslt for the webpart. Please bail me out. Thanks in Advance Regards, Bokes

A Custom KPI Web Part


I have a kpi list and I want to change the view of the list either by using SharePoint admin tools or by creating a new web part to display the data as I need it.

At the moment the data looks like this:

SYSTEM1A            RED
SYSTEM1B            GREEN
SYSTEM2A            RED

I want to get the data displayed like this:

                                 A               B
SYSTEM1             RED         GREEN
SYSTEM2             RED         AMBER

Almost like a grid layout but using data from a KPI list.

Can anyone suggest a way to achieve this be it using SharePoint or creating a custom web part to display the data?

Many Thanks

not able to set custom property of web part on page load


I am not able to set the custom property of the web part on page load.

It gives me exception if i try to get or set that property but i can still access other inbuilt property of the web part and can display them on the page.


I am using sharepoint designer and MOSS 2007.

unable set value of web part on page load for custom propeity


I am trying to set the property of the custom web part on page load. MOSS 2007

while accessing the custom property i am getting error. But can add the inbuilt property like ID , Border and other.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend