DROPDOWN SELECTEDINDEX PROBLEM

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I have a datagrid and a dropdown in my page. I want to fill dropdown with my
pagenumbers. When a user change the dropdown selected index i wnt to display
the result on label1. Anytime i change the dropdown index it returns zero ..
What is the problem ?

private void Page_Load(object sender, System.EventArgs e)

{

int TotalP=0;

SortedList hash =new SortedList ();





SqlConnection baglantim=con.MyConnect ();





for (int j=1;j<5;j++)

{

hash.Add (j,j);

}




dd.DataTextField ="Value";

dd.DataValueField ="Key";

dd.DataSource=hash;

dd.DataBind();


if (!Page.IsPostBack )

{

DataGrid1.DataSource = con.FillGrid (baglantim,0);

DataGrid1.DataBind();

}

}



private void dd_SelectedIndexChanged(object sender, System.EventArgs e)

{

// Label1.Text =dd.SelectedIndex.ToString() ;

string PageN;


PageN=dd.SelectedIndex.ToString();

Label1.Text = PageN;

}


.