views:

52

answers:

1

A actionlink like:

<%= Ajax.ActionLink("more", "myControl", new { id = item.ID },
     new AjaxOptions { UpdateTargetId = "pop", OnComplete = "showdetail" },
     new { @class = "search" })

Then I set css in css file like:

a.search 
{...}
a:search.hover 
{...}

It doesn't work. If I change css name is css file as:

.search 
{...}

It seems work only in Firefox, not work in IE.

How to resolve this issue?

+1  A: 

Your CSS appears to be incorrect; you will want to define it as:

a.search { ... }
a.search:hover { ... }
Jason
Do you mean that it should put all css code in one row?
KentZhou
No; you have a typo in your original CSS. The hover selector should read `a.search:hover` not `a:search.hover`.
Jason
Thanks. Keep new { @class = "search" } and change css as a.search { ... } a.search:hover { ... } , then It works for Firefox, But not work for IE. Any idea?
KentZhou
Jason
Thanks. I use IE7. I tried to remove a.search:hover { ... } in css file and tried it again. Still not work for IE. I use this css to display a image for the action link.
KentZhou
Find out the reason: In order to use image for this link, I change the actionlink call as: <%= Ajax.ActionLink(" ", "myControl",...), Firefox seems recognize the space, but IE removes all of them and display nothing. What's the solution?
KentZhou
Try using " " or " ", it may work.
Jason