Skip to main content

Posts

Showing posts from June, 2011

Auto Complete property of Text box

Last week i learned about auto-complete property of  text box.so i want to share it with all of you so that it can help you as well. First declare following global variables.  AutoCompleteStringCollection collection = new AutoCompleteStringCollection();   private string strConnection =System.Configuration.ConfigurationManager.ConnectionStrings["connectionString"].ConnectionString;         SqlConnection conn = new SqlConnection(); After that i have made a function  public void  AutoComplete()         {             SqlDataReader dReader;             conn.ConnectionString = strConnection;             SqlCommand cmd = new SqlCommand();             cmd.Connection = conn;             cmd.CommandType = CommandType.Text;             cmd.CommandText = "Select * from test";             conn.Open();             dReader = cmd.ExecuteReader();             if (dReader.HasRows == true)             {                 while (dReader.Read())                  

Modal Popup Extender Example in .NET

Firstly we need to add CSS classes. .modalBackground {    background-color : #CCCCFF ;    filter : alpha(opacity=40) ;    opacity : 0.5 ; } .modalWindow {    border :  solid1px#c0c0c0 ;    background : #f0f0f0 ;    padding :  0px10px10px10px ;    position : absolute ;    top : -1000px ; } After that Write the following code behind the aspx page. < ajaxToolkit : ModalPopupExtenderID ="ModalPopupExtender1" runat ="server" TargetControlID ="lnkPopup" PopupControlID ="panEdit" BackgroundCssClass ="modalBackground" CancelControlID ="btnCancel" PopupDragHandleControlID ="panEdit"> </ ajaxToolkit : ModalPopupExtender > < asp : PanelID ="panEdit" runat ="server" Height ="180px" Width ="400px" CssClass =" modalWindow ">                  < table   width ="100%">              < tr >                  < td >