Jagadish's profileJagadish Pulakhandam'sPhotosBlogListsMore ![]() | Help |
|
June 15 TIP: Highlighting ASP.NET 2.0 GridView rows on mouseover (using CSS)In my example, the GridView definition looks something like the following: <asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False" I added the StyleSheet at the top as following: <head runat="server"> In the code behind, the following was coded: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Private Sub EnableHighLightGrid(ByVal GridViewClientID As String) I tweaked the above code from beautiful explanation available at http://aspnet.4guysfromrolla.com/articles/021605-1.aspx. Thanks Scott! June 13 TIP: Placing "Search" message in ASP.NET textbox using JavaScriptHello,
I would like to have an ASP.NET textbox with a message "Search" in it. If it receives focus, "Search" should be erased. If the focus is lost, "Search" should be back. If the user types anything other than "Search", the user typed message should remain.
It is a small trick using javascript as follows (place the script in <head> section):
< script language="javascript">
function ReceivedFocus(ctl)
{
if (ctl.value=="Search")
{
ctl.value= "";
}
}
function LostFocus(ctl)
{
if (ctl.value == "")
{
ctl.value= "Search";
}
}
</ script>
Finally, add the following in the page_load event:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Me.TextBox1.Text = "Search"
Me.TextBox1.Attributes.Add("onfocus", "ReceivedFocus(this);return true;")
Me.TextBox1.Attributes.Add("onblur", "LostFocus(this);return true;")
End If
End Sub
June 05 Part 1:Programming Crystal Reports with ASP.NET 2.0
Hello, My new article focusing on "Programming Crystal Reports With ASP.NET 2.0" got published here: http://www.aspfree.com/c/a/ASP.NET/Programming-Crystal-Reports-with-ASP-NET-2-0/ Enjoy. Thanks Jag |
|
|