how to show tooltip in gridview cell mousemove or click event

Javascript code to show tooltip:

function mouseXY(e, val) {
var posx = 0;
var posy = 0;

if (e.pageX || e.pageY) {
posx = e.pageX + 5;
posy = e.pageY;
}
else if (e.clientX || e.clientY) {
posx = e.clientX + 5;
posy = e.clientY;
}
//set current cells value in tooltip
document.getElementById(“lblToolTip”).innerText = val.innerText;
//set current position of div to show as tooltip at mouse position
document.getElementById(“movingDiv”).style.right = posy + “px”;
document.getElementById(“movingDiv”).style.left = posx + “px”;
document.getElementById(“movingDiv”).style.top = posy + “px”;
document.getElementById(“movingDiv”).style.display = ‘block’;
}

function hideDiv() {
document.getElementById(“movingDiv”).style.display = ‘none’;
}

window.onload = mouseXY;

Now write a dive with label to show as like tooltip.

table border=”1″ cellpadding=”0″ cellspacing=”0″ width=”300px”>
tr height=”5px”>
td bgcolor=”#ffcc33″ style=”font-size:14px; font-family:Verdana;”>
Header Information
/td>
/tr>
tr>
td bgcolor=”#ccffff” style=”font-size: 12px; font-family: Verdana;”>
/td>
/tr>
/table>
/div>Now create columns in grid view and call JavaScript function to show tooltip on mouse move event and hide tooltip on mouse out event.
Ex:

<asp:CheckBox ID=”chkCode” runat=”server” Text=” onmousemove=”javascript:mouseXY(event,this);” onmouseout=”javascript:hideDiv();” />

how to hide url in status bar

1.

<a href=”http://www.websitename.com/?parm=12” onMouseOver=”window.status=’http://www.websitename.com&#8217;;return true” onMouseOut=”window.status=””>Click here </a>

 

2.

<script language=”javascript” type=”text/javascript”>     function redirect(URL)     {       document.location=URL;       return false;     }    </script>

<a href=”http://www.websitename.com” onclick=”returnredirect(‘http://www.websitename.com/?parm=12&#8217;);”>Click here</a>

A potentially dangerous Request.Form value

This error occurs when we try to post html code from code behind.
The reason behind it server always validate the posted data, if it find that its an HTML code, error will occues like ‘A potentially dangerous Request.Form value…’.

if you want to send html data then you hvae to write {validateRequest=”false”} in page directive
ex:

AutoEventWireup=”true” ValidateRequest=”false”