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

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

How to set backgroud color of the webpart?

Posted By:      Posted Date: September 24, 2010    Points: 0   Category :SharePoint

We have SharePoint 2010 Server Ent based portal.

We have annoucement webpart and we tried to set backgroud color as gray.
We did it in CSS file and we used webpart ID to point to the webpart.

Solutions worked fine, until we started to add new webparts to the site.
After adding new webparts, the gray background was shifted to another webpart.
It seem like IDs are dynamic and they are changing.

How to set gray backgroud to the Annoucement webpart?


View Complete Post

More Related Resource Links

Download and Share Visual Studio Color Schemes

The good news is that Visual Studio allows you to completely customize the editor background and text colors to whatever you want - allowing you to tweak them to create the experience that is "just right" for your eyes and personality. You can then optionally export/import your color scheme preferences to an XML file via the Tools->Import and Export Settings menu command.

Ajax Tab: Each TabPanel with different Color



I have situation like, Each tab panel should display with different colors based on the status. Example:

Completed tabs should display in "Green"

Inprogress status tabs should display in "Red"

Not eligible status tabs should display in "Gray".

Ajax Tab look and feel is very good. So, thought of using the Ajax Tab for my above requirement. I tried to change it. But I am not able to change the color of the each tab.  

Is it possible to change the color of each tab in Ajax Tab control? Pleas help me.

If not possible, please suggest any other tab controls to achieve above my requirement.

Note:I already tried with IE tab controls, since it provides me that flexibility to change the color of the each tab. But, It is crashing my browswer. I am not sure about the reason.

I tried Jquery option, since I need to change the tab status dynamically based on the selection made in that same page, I am not able to achieve this one in the JQuery.

Selected to change the background color of the page



As this site, http://www.borfin.com.tr/genel/Default.aspx, How can I change the background color selected pages.



Hi there,


 I am doing one task on asp.net graphics. i would like to a form that let the user choose the color code from the color picker.

inside my backend code, i can get the color code and convert to the system.drawing.color.



Dim col As System.Drawing.Color = System.Drawing.ColorTranslator.FromHtml("#9932CC")

 Dim Brush As New SolidBrush(col)


but i have some problem in make this col object to alpha color. as i know the .net code that make the system color to become alpha is wrote as like tat :

gr.DrawString(strWatermarkText, wmFont, New SolidBrush(Color.FromArgb(8, 0, 0, 0)), x, y)


May someone share me how to make the color input from form to become alpha color? thanx in advanced. hope to hear from you all soon 


Toolbox: Realistic Test Data, Dare Obasanjo's Blog, Color-Coding Tools, and More


This month Scott shows how to generate realistic test data, visits Dare Obasanjo's blog, and demonstrates color coding code for better readability.

Scott Mitchell

MSDN Magazine October 2008

GDI+: A Primer on Building a Color Picker User Control with GDI+ in Visual Basic .NET or C#


Although most developers and APIs use the RGB scheme when working with colors, it's not the only available way to represent or select colors. For instance, the standard Windows color-selection dialog box allows you to work with the HSL color scheme in an indirect way. In this article, the author describes several color selection schemes, and uses GDI+ (via the System.Drawing namespace) to create a component that makes it possible for your own applications to provide a simpler, friendlier color chooser. Along the way, you'll get tips to help you use GDI+ in your own apps.

Ken Getz

MSDN Magazine July 2003

How i find out light and dark color range??



I am showing preview of text in text box.

But if text color is light(Like white) and i want to show that text preview than text is not visible because textbox background color is white.

Can i get the range of dark and light color so i'll change textbox backgroun color accordingly.

Thanks in advance.

How can I change the color of my clandar by data from Db

Sub DayRender(ByVal source As Object, ByVal e As DayRenderEventArgs)

            Dim i As Integer
            For i = 0 To DataGrid1.Items.Count - 1
            'If (DataGrid1.Items(i).Cells(1).Text = e.Day.Date) Then
            'If (DataGrid1.Items(i).Cells(0).Text <> "") Then
            If (DataGrid1.Items(i).Cells(1).Text.Equals(e.Day.Date.ToString)) Then

                '  e.Cell.BackColor = Color.DarkOrange
                e.Cell.BackColor = System.Drawing.Color.Red
                e.Cell.ForeColor = System.Drawing.Color.Yellow

            End If
now I click the day on clendar, which have data from db it chage color ,  How can I let when the calendar is load wich day have dat in db change color ?

    End Sub


GridView color



How could I show the entire row or the cell with different color if particular data has been updated previously? For example I am showing 10 employees in gridview with their name and annual  salary, the 5th row employee's salary has been updated with different value. I know I can keep a flag in table and updated with updated flag. Later if I come back to same form, I would like to show this particular employee's  row or salary cell with 'red' color because it has been updated previously. How can I do using VB.net?



UpdatePanel in a Webpart


I'm exploring the usage of UpdatePanels in WebParts for MOSS 2007. The code I have so far for adding a test update panel is this:

                LinkButton goButton;
                goButton = new LinkButton();
                goButton.ID = "butGo";
                goButton.Text = "Go";
                goButton.Command += new CommandEventHandler(goButton_Command);
                goButton.Click += new EventHandler(goButton_Click);

How to merge 3 separated color (Red, Green and Blue) saved as grayscale images images into colored i


Hi friends, I have separated Red, Green and Blue color from a bitmap image and stored it in grayscale (obviously).  Now I want to know how can I merge it so that I can get the exact previous colour, when I am merging them by reading its color values but it is giving  me grayscale image :( . Please help me out with some working sample code. Thanking in anticipation.

I am using the following code:

 public bool mergeToRGBandWriteBitmap(string sourceRFile, string sourceGFile, string sourceBFile, string targetFile)
            bool isSuccessfullywritten = false;
                Bitmap bitmapRed = (Bitmap)Image.FromFile(sourceRFile);
                Bitmap bitmapGreen = (Bitmap)Image.FromFile(sourceGFile);
                Bitmap bitmapBlue = (Bitmap)Image.FromFile(sourceBFile);
   Bitmap afterMerge = mergeRGB(bitmapRed, bitmapGreen

Rowlimit and PageFirstRow properties of listview as parameters to Listview Webpart


Hi ,

 I need to set the  Rowlimit  and PageFirstRow properties  of  listview  as  parameters to Listview Webpart

 And these parameters  will be passed from the custom provider webpart


name of the list will be provided in custom webpart's toolpane.

and i need to save this as list content type of list defs


Please provide me the guidance on this.



Error in / Application after adding employee search in webpart


Hello everyone,

I am working on sharepoint 2007 and I was editing the webpart of the software and after adding the predefined employee search table, the server has crashed while trying to access the server remotely with the following error message:

Error in / Application

However, while trying to login locally I have no problem and can easily login.

What will be the course of action in fixing this error.

Also the site is complaining of an invalid certificate even after adding an exception.

Any help would be greatly appreciated.

Thank You,

Chris Stanko

Create a Outlook Task from Custom WebPart in Code



I have a requirement to create a Outlook Task , from a custom webpart through code .

Is this possible?

has any body tried this , if yes can you please give me an insight on how to acheive it.

Some sample Code would be highly appreciated.



Is there any way to list WebPart's authorised users?


Actually, I set access to some of the WebParts to desired group of SP users. (Web Part edition->Advance->last option on the bottom)

Is there any way to list this access? I'd like to have some kind of list with WebParts and users signed to its.

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