Question : Hyperlink does not work in repeater in firefox.

The first hyperlink  does not work see code.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
<asp:Repeater ID="rptList" runat="server" OnItemDataBound="rptList_ItemDataBound">
        <HeaderTemplate>
            <table width="100%">
        </HeaderTemplate>
        <ItemTemplate>
            <asp:HyperLink ID="HLMainID" runat="server" NavigateUrl='<%#"~/Secure/ViewProfile.aspx?UserName="+Eval("UserName") %>'>
                <tr class="profile-box" style="cursor: hand" onmouseover="style.backgroundColor='LightBlue'"
                    onmouseout="style.backgroundColor=''">
                    <td>
                        <div class="profile-item">
                            <div class="pic">
                                <asp:HyperLink ID="HLMainPicID" runat="server" NavigateUrl='<%#"~/Secure/ViewProfile.aspx?UserName="+Eval("UserName") %>'>
                                    <asp:Image ID="MainPicID" Style="vertical-align: middle" runat="server" />
                                </asp:HyperLink>
                            </div>
                            <div class="info">
                                <span class="srusername">
                                    <%#DataBinder.Eval(Container,"DataItem.UserName")%></span>
                                <br />
                                <%#DataBinder.Eval(Container,"DataItem.Age")%>&nbsp;Years Old&nbsp;<%#DataBinder.Eval(Container,"DataItem.GenderName")%>
                                -&nbsp;<%#DataBinder.Eval(Container,"DataItem.ZodiacName")%>&nbsp;
                                <asp:Image ID="imgZodiacSign" ImageUrl='<%# GetUrl(Eval("ZodiacName")) %>' Style="vertical-align: middle"
                                    runat="server" />
                                <br />
                                <%#DataBinder.Eval(Container,"DataItem.HeightName")%>&nbsp;-&nbsp;<%#DataBinder.Eval(Container,"DataItem.BodyTypeName")%>
                                <br />
                                <%#DataBinder.Eval(Container,"DataItem.HairColorName")%>&nbsp;Hair,&nbsp;<%#DataBinder.Eval(Container,"DataItem.EyeColorName")%>&nbsp;Eyes<br />
                                <%#DataBinder.Eval(Container,"DataItem.EthnicityName")%>
                                <br />
                                <%#DataBinder.Eval(Container,"DataItem.GenderName")%>&nbsp;Seeking&nbsp;
                                <%#DataBinder.Eval(Container,"DataItem.SeekingName")%>
                                <br />
                                <div class="loc">
                                    <%#DataBinder.Eval(Container,"DataItem.CityName")%>,&nbsp;<%#DataBinder.Eval(Container,"DataItem.RegionName")%>,
                                    &nbsp;<%#DataBinder.Eval(Container,"DataItem.Country")%>
                                </div>
                            </div>
                            <div class="detail">
                                <span>
                                    <%#DataBinder.Eval(Container,"DataItem.HeadLine")%></span>I really dont know
                                what to say, so here it goes. i'm a loner, im open minded,and im a smartass, plus
                                sometimes im 2 honest and blunt.
                            </div>
                        </div>
                    </td>
                </tr>
            </asp:HyperLink>
            <asp:HiddenField ID="hiddenImgID" runat="server" Value='<%#DataBinder.Eval(Container,"DataItem.ProfileID") %>' />
        </ItemTemplate>
        <FooterTemplate>
            </table>
        </FooterTemplate>

Answer : Hyperlink does not work in repeater in firefox.

Ok try something like this:
1: Add onclick to you "<tr> " like below:
<tr onclick="testRedirect('<%#GetRedirectUrl(Eval("UserName").ToString())%>')" style="cursor: pointer" onmouseover="style.backgroundColor='LightBlue'" onmouseout="style.backgroundColor=''">

2: Add "testRedirect" javascript method:
<script type="text/javascript">
       function testRedirect(url) {
            alert(url); //remove, this is for test
            document.location.href = url;
        }
    </script>
3: Add GetRedirectUrl method to the page code-behind:

public string GetRedirectUrl(string username)
{          //you can hardcode the url1 like: http://www.omegalove.com/Secure/ViewProfile"
            string url1 = Request.Url.Scheme + "://" + Request.ServerVariables["HTTP_HOST"] + VirtualPathUtility.ToAbsolute("~/Secure/ViewProfile.aspx");
            string url = url1+"?Username=" +username;
            return url;
        }

I tested in IE / firefox and seems to work...

If you don't want to do code-behind way you can try this:
1:
<tr onclick="testRedirect2('<%#(Eval("UserName").ToString()%>')" style="cursor: pointer" onmouseover="style.backgroundColor='LightBlue'" onmouseout="style.backgroundColor=''">

javascript function
<script type="text/javascript">
        function testRedirect2(username) {
            alert(username);
        document.location.href = "http://www.omegalove.com/Secure/ViewProfile?UserName=" + username;
      }
 </script>

Random Solutions  
 
programming4us programming4us