Dave Burke : Freelance .NET Web Developer specializing in Online Communities

Give me a hand! (Cursor, that is)

I've created a few custom Community Server link controls in my day deriving from WrappedContentBase that display a modal window when clicked.  They're smart and efficient, but I didn't like the fact that when doing a mouseover the cursor did not change to...the hand.



Certainly I could make this happen with CSS, I thought, but found it took a little longer than the 3 minutes I anticipated it to take.  Thus, the incident burst into blog-worthiness and so here we are.

The secret CSS sauce to cause an area to trigger "the hand" on mouseover follows.  It works in IE6/IE7 and Firefox.


.PopOver
{
    cursor: pointer;
    cursor: hand;
}


I guess I should say a word about the Custom Link Objects that display Modal Windows in Community Server.  The HTML when dropped onto the page would look like the following.


<DBVT:POLineDetailsImageLink ID="POLineDetailsImageLink2" runat="server" CssClass="PopOver" Tag="Span" />


And that's it.  As I said, pretty darn efficient.  The CodeBehind content binding code creating the modal window link looks like this, with the essential link construction code in bold.


CSContext csContext = CSControlUtility.Instance().GetCurrentCSContext(this.Page);
POLine poline = this.DataSource as POLine;

if (poline.POLineDetail != null)
{
    HyperLink imageLink = new HyperLink();
    imageLink.Attributes["onclick"] = ModalHelper.BuildHandler(this.Page,
        JobUrls.Instance().POLineDetails(poline.PoItemID), 700, 500, "null", true);

    imageLink.ImageUrl = Globals.ApplicationPath + "/images/details.gif";
    control.Controls.Add(imageLink);
}
    else
    this.AutomatedVisible = false;
}


The information about creating Modal Window link objects is pretty cool, but it doesn't hold a candle to releasing "the hand."  Just my opinion, of course...

Comments (2) | Post RSS RSS comment feed

Posted on 5/3/2008 9:50:28 AM by Dave Burke
Categories: .NET | Community Server
Tags: no tags for this post

Related posts

Comments (2) -

5/4/2008 12:50:32 PM Permalink

You shouldn't need the cursor: hand, should only be an IE alias; cursor: pointer works in IE 7 and firefox, couldn't test IE 6.  here's a little test page: http://panteravb.com/cursorhand.html

chris carter |

5/4/2008 1:47:26 PM Permalink

Thank you, Chris!  I started out in IE6, which may indeed require the cursor: hand.  Can't say for sure until I get back to my office network to test without it.  Will let you know.

daveburke |


Powered by BlogEngine.NET 2.0.0.36
Theme by Dave Burke