I have one dropdownlist which contain value of school and office i have also table in school and office i have also grid. when i select school in dropdownlist the grid display must the school table and vivice-versa.
Thank You,
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
ashok kumarPosted May 15, 2015, 8:44 AM
thanks,
Khargesh RajputPosted May 11, 2015, 4:12 AM
and on selectedindexchenged
check if(DropDownList1.selectedItem.Text=="School")
{
//bind grd from School table
}
else
{
// bind from Office
}
Manoj Kumar MandalPosted May 11, 2015, 3:36 AM
Sample Code
protected void DropDownList1_SelectedIndexChanging(object sender, EventArgs e)
{
int TypeId= Convert.ToInt32(DropDownList1.SelectedValue);
//Call your procedure with TypeId as argument
}
Inside Procedure use condition
IF (TypeId = 1 )
BEGIN
//Query to fetch data of School
END
ELSE IF (TypeId = 2)
BEGIN
//Query to fetch data of College
END
ELSE
BEGIN
//Query to fetch data of Office
END