using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        index1.Text = DropDownList1.SelectedIndex.ToString();//this coe is writen to display defaut item of dropdown
        text1.Text = DropDownList1.SelectedItem.Text;//remove this code and see the result
        value1.Text = DropDownList1.SelectedValue;//
    }
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        index1.Text = DropDownList1.SelectedIndex.ToString();
        text1.Text = DropDownList1.SelectedItem.Text;
        value1.Text = DropDownList1.SelectedValue;
       }
    protected void Button1_Click(object sender, EventArgs e)
    {
        DropDownList1.Items.RemoveAt(Convert.ToInt16(DropDownList1.SelectedIndex.ToString()));
   
        /* these button do nothing but kept fort autopostback as to display content in
         DropDownList1_SelectedIndexChanged as these need postback to do so;
        IMP--> Inorder not to INCLUDE button make AutoPostBack property of drpp true
        */
    }
}

Like it on Facebook, Tweet it or share this article on other bookmarking websites.

Comments (0)

There are no comments posted here yet

Whom are you supporting this IPL4?

Now that the heat is ON (cricket fever), let's add some Spice (IPL)...Whom are you supporting this IPL4?
No answer selected. Please try again.
Please select either existing option or enter your own, however not both.
Please select minimum 0 answer(s) and maximum 10 answer(s).
/polls/sports-and-games/5973-whom-are-you-supporting-this-ipl4.json?task=poll.vote
5973
radio
[{"id":"20569","title":"CSK","votes":"25","type":"x","order":"0","pct":29.07,"resources":[]},{"id":"20570","title":"DD","votes":"7","type":"x","order":"0","pct":8.14,"resources":[]},{"id":"20571","title":"MI","votes":"18","type":"x","order":"0","pct":20.93,"resources":[]},{"id":"20572","title":"KXIP","votes":"4","type":"x","order":"0","pct":4.65,"resources":[]},{"id":"20573","title":"KKR","votes":"9","type":"x","order":"0","pct":10.47,"resources":[]},{"id":"20574","title":"PWI","votes":"4","type":"x","order":"0","pct":4.65,"resources":[]},{"id":"20575","title":"RR","votes":"3","type":"x","order":"0","pct":3.49,"resources":[]},{"id":"20576","title":"RCB","votes":"7","type":"x","order":"0","pct":8.14,"resources":[]},{"id":"20577","title":"KTK","votes":"6","type":"x","order":"0","pct":6.98,"resources":[]},{"id":"20578","title":"DC","votes":"3","type":"x","order":"0","pct":3.49,"resources":[]}] ["#ff5b00","#4ac0f2","#b80028","#eef66c","#60bb22","#b96a9a","#62c2cc"] ["rgba(255,91,0,0.7)","rgba(74,192,242,0.7)","rgba(184,0,40,0.7)","rgba(238,246,108,0.7)","rgba(96,187,34,0.7)","rgba(185,106,154,0.7)","rgba(98,194,204,0.7)"] 350
bottom 200
No married couple wants to end up getting divorced. It is not like they have planned for it. They try to put up with their partners for as long as they
Due to our modern lifestyle, we feel that digestion related disorders are a common problem. Thus, we neither give importance to them nor seek any help
The bond of marriage brings the two people together. Initially, everything may seem okay and both of them slowly start discovering each other in the journey.
Your online reputation is important You should know that it takes decades to make your reputation but to ruin it you need just couple of minutes and this
Basics of Cookies is Asp.Net Through this article you are able to know about the following points:1> What are the cookies?2> How to write and read cookies
  Introduction A Web server hosts information in the form of HTML files. The Web server is usually passive and merely acts as an efficient interface
Best language to learn .NET language is the best thing to learn. It has somewhat similar syntax as java and it’s a Microsoft Technology moreover it
If you decide to have an  opt-in list is not just a matter of sending your subscribers your promotional newsletters or catalogs. There are several things