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 |
How can we inherit a static variable?
how to encrypt a connection string in web.config file?
Explain ViewState?
What is an application domain?
What are the different methods of session maintenance in asp.net?
What is session id in web application?
How do I upload a file from my ASP.NET page?
Various types of Page Load functions
how many script manager controls are used in Ajax web page?
7 Answers CSC, Health Prime Services, TCS,
What is a session government?
Asp.net - How to find last error which occurred?
Can we throw exception from catch block ?
4 Answers Accenture, BirlaSoft,