Hi preetpalkapoor,
If you're asking how to bind data, here is an example:
http://www.dotnetheaven.com/UploadFi...ndatagrid.aspx
Now, if you're asking when to bind data in your second dropdown, well, you would do that in the event of making a selection in your first dropdown. I think
OnSelectedIndexChanged should do it. So, your first dropdown will look something like this:
Code:
<asp:DropDownList ID="ddp1" runat="server" ... OnSelectedIndexChanged="GetStates" ...>
...
</asp:DropdownList>
Then in your codebehind, you will have method:
Code:
protected void GetStates(object sender, EventArgs e)
{
//Get states from SQL
//Bind results to ddp2
}
Easy. Oh, and one tip from me (since you happen to be using C#): Use the "Using" statement to create your objects (the disposable ones, that is)
Regards,
Mike