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
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 |
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 we try to set the dropdownlist1 autopostback to true. we
will not get the error
Is This Answer Correct ? | 2 Yes | 3 No |
Answer / milind
If(dropdownlist1.selectedIndexChanged!=0)
Try this 1 you will not get error
Is This Answer Correct ? | 1 Yes | 2 No |
What is HTTPModule and HTTPcontext? What is the use of each?
How can you achieve nested Masterpages in 2.0?
What are the advantages of Web API?
what is shared assembly asp net
Compare and contrast between inline and code behind - which one is best?
Explain Factory pattern?
What are ASP.NET Web Forms? How is this technology different than what is available though ASP (1.0-3.0)?
How can we make sure that Web API returns JSON data only?
How response object is related to asp's response object?
What is difference between ASP and ASP.NET ?
Where session variables are stored?
How do you pass session values from one page to another ?