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.
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”;
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…