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


Please Help Members By Posting Answers For Below Questions

What is the function used for removing an event listener?

633


Differentiate the session object and application object?

623


What methods are fired during the page load? Init()

631


What is the difference between page-level caching and fragment caching?

619


In What Order Do The Events Of An Aspx Page Execute. As A Developer Is It Important To Undertsand These Events?

677






In which event are the controls fully loaded?

658


Explain culture and uiculture values.

645


How to use push notification?

695


Give a few examples of page life cycle events.

766


In Data grid the question is below quantity price total these are 3 fields available in data grid if you enter quantity the total has to update automatically.Price field is already filled completely

1650


Is it possible to develop a single web application using ASP.NET webforms and ASP.MVC?

679


How many languages are supported by .NET at present time?

392


In order to get assembly info which namespace we should import?

617


What’s the difference between asp.net web forms and asp.net mvc?

640


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?

623