Ok try something like this:
1: Add onclick to you "<tr> " like below:
<tr onclick="testRedirect('<%#G
etRedirect
Url(Eval("
UserName")
.ToString(
))%>')" style="cursor: pointer" onmouseover="style.backgro
undColor='
LightBlue'
" onmouseout="style.backgrou
ndColor=''
">
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["H
TTP_HOST"]
+ VirtualPathUtility.ToAbsol
ute("~/Sec
ure/ViewPr
ofile.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("Use
rName").To
String()%>'
)" style="cursor: pointer" onmouseover="style.backgro
undColor='
LightBlue'
" onmouseout="style.backgrou
ndColor=''
">
javascript function
<script type="text/javascript">
function testRedirect2(username) {
alert(username);
document.location.href = "
http://www.omegalove.com/Secure/ViewProfile?UserName=" + username;
}
</script>