Scrollbar Colors customization                                         It's uncertain how many browsers are still supporting color scrollbars. I understand IE only supported it for one version, then dropped it with the next. However we will keep the code here for those who wish to learn from it. Add the following script within your head tag and change the color attributes to suit.

<style type="text/css">
body { scrollbar-arrow-color: ffffff; scrollbar-base-color:ffffff; scrollbar-dark-shadow-color: ffffff; scrollbar-track-color: ffffff; scrollbar-face-color: ffffff; scrollbar-shadow-color: ffffff; scrollbar-highlight-color: ffffff; scrollbar-3d-light-color: ffffff; }
</style>
Read more ...

This is one of the method to Change font color "onMouseOver" and "onMouseOut" using(CSS)

<style type="text/css">
<html>
<!-- Created on: 27/09/2012 -->
<head>
  <title></title>
</head>
<body>
 <table onmouseover="document.style.x.color='white'"  border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#008080" width="100%" height="34" bgcolor="#95BED4">
      <tr>
        <td onMouseOver="this.style.backgroundColor='#2172A1';  this.style.cursor='hand';" onMouseOut="this.style.backgroundColor='#95BED4'" width="20%">
         <!-- <P> tag onMouseOver Color -->
  <p align="center"><b><font face="Verdana" color="#2172A1" onmouseover="this.style.color='white'" onmouseout="this.style.color='#2172A1'" size="2">Home</font></b></td>
      </tr>
    </table>
</body>
</html></style>

you can do it like this: make two classes in your stylesheet something like menuon and menuoff.

<style type="text/css">
td.menuon { background-color: #000000; color: #FFFFFF; }
td.menuoff { background-color: #FFFFFF; color: #000000; }
</style>

<td class="menuoff" onmouseover="className='menuon';" onmouseout="className='menuoff';">
</td>

<a href="#" style="text-decoration: none;" onmouseover="this.style.textDecoration = 'underline'" onmouseout="this.style.textDecoration = 'none'">asdasdasdads</a>


<p onMouseOut="this.style.color = 'black';" onMouseOver="this.style.color = 'red';" align="justify">
Your text here to change text on mouseover</p>
Read more ...

This is one of the method to set mouse pointer focus in page load  on first text-box or
dropdownlist. 

Page.ClientScript.RegisterStartupScript(this.GetType(), "Setfocus", "document.getElementById('" +ddlCountry.ClientID+"').focus();", true);


Read more ...

Create log file in asp.net using C# :
                                                                                        Dot net have  various classes to create, write  on a text file . Here I'm using create() method to create a text file and using some classes to reading and writing text files those are TextReader,StreamReader,StreamWriter,TextWriter classes.These are abstract classes .Here i have taken a logfilepath which is the physical path of the text file.If the file is existing in path then we will write (log) messages into this text file.If the file is not existing in the path then we will create a file in this path and write a message into it 
public static string strPath = AppDomain.CurrentDomain.BaseDirectory;
public static string strLogFilePath = strPath + @"log\log.txt";
public static void WriteToLog(string msg)
 {
  try
   {
    if (!File.Exists(strLogFilePath))
       {
       File.Create(strLogFilePath).Close();
       }
    using (StreamWriter w = File.AppendText(strLogFilePath))
       {
        w.WriteLine("\r\nLog: ");
        w.WriteLine("{0}",DateTime.Now.ToString(CultureInfo.InvariantCulture));
        string err = "Error Message:" + msg;
        w.WriteLine(err);
        w.Flush();
        w.Close();
       }
   }

Read more ...

Related Posts Plugin for WordPress, Blogger...