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
Is asp.net and .net the same?
What are the advantages of Web API?
If iam developing an application that must accomodate multiple security levels though secure login and my asp.net web appplication is spanned across three web-servers (using round-robbin load balancing) what would be the best approach to maintain login-in state for the users?
What is a web pool?
Is there any alternative to avoid name collisions other then Namespaces?
What are validator? Name the validation controls in asp.net? How do you disable them?
What does it mean your session has timed out?
What are client activated objects and server activated objects?
If you are using two select queries and retrieving data. how do you access second query's result set using data reader?
Can you use Web API with ASP.NET Web Form?
What is the difference between a multi-layer and multi-tier applications?
What is the difference between client-side and server-side validations in ASP.NET?
if i wanna deploy my asp.net project to the production server and situation is that i m still not compiled my project i have as-is on my development side now on production server we dont have a visual studio now what kind of settings i need to be to do in webconfig /machine.config file to deploy my project and in iis too....
What do you mean by View State and what is its role?
How do u declare static variable and how it is declared and what is its lifetime?