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

Answers were Sorted based on User's Feedback



If(dropdownlist1.selectedIndexChanged==true) { //code } else { //code } I am getting error i..

Answer / 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

If(dropdownlist1.selectedIndexChanged==true) { //code } else { //code } I am getting error i..

Answer / prashant yadav

selectedIndexChanged is a event while true is bool type
variable which is not corrct

Is This Answer Correct ?    10 Yes 0 No

If(dropdownlist1.selectedIndexChanged==true) { //code } else { //code } I am getting error i..

Answer / narashiman

if we try to set the dropdownlist1 autopostback to true. we
will not get the error

Is This Answer Correct ?    2 Yes 3 No

If(dropdownlist1.selectedIndexChanged==true) { //code } else { //code } I am getting error i..

Answer / milind

If(dropdownlist1.selectedIndexChanged!=0)

Try this 1 you will not get error

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More ASP.NET Interview Questions

What type of code, client-side or server-side, is found in a code-behind file of a Web page?

0 Answers   MindCracker,


What are the different validators in asp.net?

0 Answers  


What is a proxy in web service?

0 Answers  


What is the Difference between MVC And MVP design pattrens

0 Answers   Symphony,


What is a ashx file?

0 Answers  






Why session is more secure than cookies?

0 Answers  


What is mvc in asp.net tutorial? : Asp.Net MVC

0 Answers  


How do we access view state value of this page in the next page?

0 Answers   MindCracker,


Where is the session stored?

0 Answers  


Can you explain composite pattern?

0 Answers   QuestPond,


What is the Impprsonation?and what is the importence of that?

3 Answers   eXensys,


Contrast oop and soa. What are tenets of each16. How does the xmlserializer work? What acl permissions does a process using it require?

0 Answers  


Categories