About the author

Vijay Kodali
E-mail me Send mail

Recent comments



The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2024

Auto refresh a web form asp.net

Some times we need to auto-refresh page after few seconds. you can do it with Meta Refresh tags

<head><meta http-equiv="Refresh" content="180" /></head>

Where content '180' is the number of seconds.

Another approach is by addding HTTP header..


Response.AppendHeader("Refresh", "180");


Posted by vijay on Sunday, October 14, 2007 3:24 PM
Permalink | Comments (1) | Post RSSRSS comment feed

To add Tool Tip for DropDownList items in Asp.Net

Here is sample code for adding tooltip to DropDownList. The key here is adding "title" attribute to the list items in DataBound event.

<asp:DropDownList ID="DropDownList1" runat="server" ondatabound="DropDownList1_DataBound">
In code behind ..
protected void DropDownList1_DataBound(object sender, EventArgs e)
    DropDownList ddl = sender as DropDownList;
    if (ddl != null)
        foreach (ListItem li in ddl.Items)
           li.Attributes["title"] = li.Text; // setting text value of item as tooltip


Posted by vijay on Thursday, October 11, 2007 9:15 PM
Permalink | Comments (1) | Post RSSRSS comment feed