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 |
Is asp.net easy to learn?
Who will magage un-managed code?
What is connection pooling and how to enable and disable connection pooling?
what is synchronization and asynchronization. what are the difference between two?
can any one tell about web services?
How many types of file extensions for razor views in ASP.Net MVC?
What are ASP.NET Web Forms? How is this technology different than what is available though ASP?
i have one gridview contains edititemtemplate(which contains update and cancel buttons) and i have one item template (contains edit button) i want the code for update and cancelbuttons in edit item template and i want the code for edit button in itemtemplate. please help me
How to identify host of my system? How to identify servername of my system? How to identify domainname of my system?
What’s the catch?
Can we handle the error and redirect to some pages using web.config?
Difference between using directive vs using statement?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)