If(dropdownlist1.selectedIndexChanged==true)
{
//code
}
else
{
//code
}
I am getting error in If condition, so can u pls give me a
solution.

Answer Posted / gaurav k

SelectedIndexChanged is a event for the DropDown Control.
True is a bool type. We can not compare an event with bool
type like this. If we have to do somthing on the change of
the selection of an item, we can write the appropriate code
in the SelectedIndexChanged Event.

protected void DropDownList1_SelectedIndexChanged
(object sender, EventArgs e)
{
//Code
}

Is This Answer Correct ?    11 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between application state and session state in asp net?

483


Can you explain composite pattern?

566


How is the asp.net mvc architecture different from others? : asp.net mvc

458


How to fetch a data from one table to another table in asp.net ?

559


Differentiate between structure and class.

559






Explain the use of dataadapter.

551


Explain the boxing and unboxing concept in .net?

363


List the asp.net validation controls?

507


Give an example of cookie abuse.

573


What is the benefit of WebAPI over WCF?

546


Which method is used to enforce garbage collection in .net?

405


What is different authentication mechanisms used in ASP.NET?

565


How to improve performance of web application asp.net mvc? : Asp.Net MVC

463


When we use cookie less session? Explain its working?

545


what is a .xap file? Explain with an example.

565