Many organizations, financial institutions in particular, do not like the standard behavior of web browsers and web controls. Such organizations may have the first page of their website be a 'hidden' page that pops up the main page of the application with certain browser elements removed. Many choose to remove the status bar, the tool bar, and the address bar. In the web application on which I am currently working, the client has chosen to leave the status bar visible, but to override the message presented in the status bar. For a web page using straight HTML controls, this is fairly easy to do by simply adding code to the onmouseover and onmouseout event parameters of an HTML element.
But what if you are using a DataGrid control that contains a LinkButton control? When the user's mouse hovers over a link in the DataGrid, they will see a status message similar to the following:
javascript:__doPostBack('MyDataGrid$_ctl30$ctl0','')
As you can see, this displays the control's ID within the parentheses. This could be considered a security risk. When you choose a DataGrid column to be a sort column, ASP.NET generates the header text for the column as a link button. So, when the user's mouse hovers over the header text in the sort column, they see a status bar message similar to the one above.
So, we need a way to override the standard status bar message. This article will show how to do this in the code-behind for the page. Incidentally, the technique I document below can be modified for use in other situations.
Furthermore, there is some standard behavior for a link that apparently cannot be overridden. I will demonstrate this behavior as well. It may be possible to override this standard behavior as well, but every link I have tested has behaved with the same shortcomings.