How to clear selected item dropdownlist in asp.net c#


   for example runtime dropdown list selected item you want clear put below coding aspx.cs page    

 protected void Button3_Click(object sender, EventArgs e)
    {
        DropDownList1.SelectedIndex = -1;
            DropDownList2.SelectedIndex = -1;


    }
read more...

How to show message box in asp.net



Where you want Your Messagebox Put Below Lines in your coding Page(aspx.cs)....



 protected void Button1_Click(object sender, EventArgs e)
{


  Response.Write("<script>alert('Your Text...');</script>");


}


                   if click button1 this message will display.....
read more...

How to validate textbox to accept only numeric value in C#.net


 Below Coding for accept only Numbers.....


      if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8)
            {
                e.Handled = true; // Remove the character
                MessageBox.Show("Please Enter No only...");
            }
read more...

How to clear selected item in combobox in c#


For Windows Application We Want to Paste Below Lines


combobox1.selectedIndex = -1;
read more...

How to validate textbox to accept only characters in windows form


 Below Coding TextBox Accept only Characters....


  if ((e.KeyChar >= 65 && e.KeyChar <= 90) || (e.KeyChar >= 97 && e.KeyChar <= 122) ||               (e.KeyChar  == 32) || (e.KeyChar == 8))  //keychar 8 is for backspace
            {
                e.Handled = false;

            }
            else
            {
                e.Handled = true;
                MessageBox.Show("Please Enter Character Only...." );
             }
read more...