Category: asp.net

Books I’ve Read

Sometimes, when I have applied for full time employment in the past I have seen job ads or received responses from companies asking what books I’ve read. Nearly every time, I have heard this question I was so shocked because I didn’t ever keep track of what I had read or where I had gleamed those little bits of valuable information.

This list will be updated at least monthly, although when I have an abundance of extra time I might be able to read an additonal book or two. Please note that this list only contains books I am interested in professionally and in no specific order.

Books Finished:

  • ASP.NET 2.0 Unleashed
  • Beginning Ubuntu Linux
  • C# How to Program
  • Code Craft: The Practice of Writing Excellent Code
  • Don’t Make Me Think: A Common Sense Approach to Web Usability
  • jQuery In Action
  • Network+ Guide to Networks
  • Learn to Program With C++
  • Practical Web 2.0 Applications with PHP
  • Systems Analysis and Design in a Changing World
  • Teach Yourself HTML 4 in 24 Hours
  • Visual Basic 6 Complete
  • Web Style Guide: Basic Design Principles for Creating Web Sites

Currently Reading:

  • Operating System Concepts

Although the list is getting pretty extensive, please understand that these are books I can verify as of September 7th 2009. The title suggests this is only books, so please remember that I definitely have visited many websites along the way.

Mouse Overs For ASP.NET

Have you ever wanted to have the ability for the colour of a row to change when your user moves the mouse over top of a particular row, and then change the colour back whenever the cursor is moved back off?

Well, this process isn’t very difficult in fact using some knowledge of JavaScript & the Document Object Model (DOM) we can dynamically change the background colour.

We need to override the Render class and then add some attributes to each GridViewRow before the page is finally output to the browser.

In this example, I have called the gridview we are adding the mouseovers and mouseouts “gvClients” because it displays a list of my fictional company’s clients. Wherever you see gvClients you need to make sure that you change this to your respective gridview’s name.

protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
   /*Using a simple foreach we iterate through the Rows and use the row.Attributes.Add() and pass in the javascript property we want to output as    html, along with the function we will use and then because asp.net usually dynmically creates the names for each item we need to use    the row.ClientID as this will exist only on the client side.
*/
foreach (GridViewRow row in gvClients.Rows)
{
  row.Attributes.Add(“onmouseout”, “ColorGridForMouseOut(‘” + row.ClientID + “‘);”);
  row.Attributes.Add(“onmouseover”, “ColorGridForMouseOver(‘” + row.ClientID + “‘);”);
}

//We finally just pass in the html that’s now been created.
base.Render(writer);
}

— Sample javascript

//Change Color of Gridview on MouseOut
function ColorGridForMouseOver(id) {
var el = document.getElementById(id);

if(el.currentStyle) // for msie
{
if (el.style.backgroundColor !=’orange’)
{
el.style.backgroundColor=’lightblue’;
el.style.cursor=’hand’;
}
}
else // for real browsers 😉
{
if (el.style.backgroundColor != ‘Orange’)
{
el.style.backgroundColor = ‘lightblue’;
el.style.cursor = ‘pointer’;
}
}
}

function ColorGridForMouseOut(id)
{
var el = document.getElementById(id);

if(el.currentStyle) // for msie
{
if (el.style.backgroundColor !=’orange’)
{
el.style.backgroundColor=’White’;
el.style.textDecoration=’none’;
}
}
else // for real browsers 😉
{
if (el.style.backgroundColor != ‘Orange’)
{
el.style.backgroundColor = ‘White’;
el.style.textDecoration=’none’;
}
}
}

Thank you for taking the time to visit.