Solved

ASP.net VB.net simple panel with a gradient

Posted on 2012-04-10
4
856 Views
Last Modified: 2012-04-26
Hi

Does anyone know of a simple example of how to get a gradient effect on a panel in an ASP.net WebForm. Not C# please, just VB.net

Thanks
0
Comment
Question by:murbro
  • 2
4 Comments
 
LVL 42

Accepted Solution

by:
sedgwick earned 250 total points
ID: 37831273
take a look at gradient generators using css3:
http://gradients.glrzad.com/
0
 

Author Comment

by:murbro
ID: 37831466
Thanks. Where do I put the code?
background-image: linear-gradient(bottom, rgb(223,240,242) 21%, rgb(163,205,240) 61%, rgb(99,167,219) 81%);
background-image: -o-linear-gradient(bottom, rgb(223,240,242) 21%, rgb(163,205,240) 61%, rgb(99,167,219) 81%);
background-image: -moz-linear-gradient(bottom, rgb(223,240,242) 21%, rgb(163,205,240) 61%, rgb(99,167,219) 81%);
background-image: -webkit-linear-gradient(bottom, rgb(223,240,242) 21%, rgb(163,205,240) 61%, rgb(99,167,219) 81%);
background-image: -ms-linear-gradient(bottom, rgb(223,240,242) 21%, rgb(163,205,240) 61%, rgb(99,167,219) 81%);

background-image: -webkit-gradient(
      linear,
      left bottom,
      left top,
      color-stop(0.21, rgb(223,240,242)),
      color-stop(0.61, rgb(163,205,240)),
      color-stop(0.81, rgb(99,167,219))
);
0
 
LVL 7

Assisted Solution

by:vbigham
vbigham earned 250 total points
ID: 37834426
I prefer this one: http://www.colorzilla.com/gradient-editor/

You should put the resulting code in your css file (maybe Site.css) in a selector for the element that should use the gradient.

For example maybe you have a div element where you want a gradient background like this:
    <div class="MyGradientBackground" />

Open in new window


You might have a css style selector like this:
.MyGradientBackground 
{
    background: rgb(174,188,191); /* Old browsers */
    background: -moz-linear-gradient(top, rgba(174,188,191,1) 0%, rgba(110,119,116,1) 50%, rgba(10,14,10,1) 51%, rgba(10,8,9,1) 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(174,188,191,1)), color-stop(50%,rgba(110,119,116,1)), color-stop(51%,rgba(10,14,10,1)), color-stop(100%,rgba(10,8,9,1))); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top, rgba(174,188,191,1) 0%,rgba(110,119,116,1) 50%,rgba(10,14,10,1) 51%,rgba(10,8,9,1) 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top, rgba(174,188,191,1) 0%,rgba(110,119,116,1) 50%,rgba(10,14,10,1) 51%,rgba(10,8,9,1) 100%); /* Opera 11.10+ */
    background: -ms-linear-gradient(top, rgba(174,188,191,1) 0%,rgba(110,119,116,1) 50%,rgba(10,14,10,1) 51%,rgba(10,8,9,1) 100%); /* IE10+ */
    background: linear-gradient(top, rgba(174,188,191,1) 0%,rgba(110,119,116,1) 50%,rgba(10,14,10,1) 51%,rgba(10,8,9,1) 100%); /* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#aebcbf', endColorstr='#0a0809',GradientType=0 ); /* IE6-8 */
}

Open in new window

0
 

Author Closing Comment

by:murbro
ID: 37899103
thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now