Loading ...

OnSelectedIndexChanged event method not recognized

Who is online?  0 guests and 0 members
home  »  forums   »  asp.net topics   »  web forms / data controls   » OnSelectedIndexChanged event method not recognized

OnSelectedIndexChanged event method not recognized

Posts under the topic: OnSelectedIndexChanged event method not recognized

Posted: 11/11/2011

Lurker 10  points  Lurker
  • Joined on: 11/11/2011
  • Posts: 2

Hi all,

I am having a problem with ASP.NET form. I am trying to add a few fields to an already existing asp.net form. I have a few dropdown lists. Depending on the dropdown option selected, I want to display the next few fields of the form. 
I have added a OnSelectedIndexChanged event in my code behind file and have also added it in the fields tag like OnSelectedIndexChanged="lstSemsRemaining_SelectedIndexChanged". 
When I load the form, I get an error message which says
'ASP.default_aspx' does not contain a definition for 'lstSemsRemaining_SelectedIndexChanged' and no extension method 'lstSemsRemaining_SelectedIndexChanged' accepting a first argument of type 'ASP.default_aspx' could be found (are you missing a using directive or an assembly reference?)
I dont understand why it cannot see the event in my code-behind file! Even puzzling is that the form already had a few dropdown lists with OnSelectedIndexChanged properties. They work just fine. Only the new dropdown lists I added have this problem. I have checked so many times to see if I am doing anything different, but could find nothing.
Please help me with this asap. Help would be greatly appreciated.
Thanks!


Posted: 12/16/2011

Lurker 65  points  Lurker
  • Joined on: 12/16/2011
  • Posts: 9

Have you already created a method stub for "lstSemsRemaining_SelectedIndexChanged"? I believe that this error is stating that when the index changed event is triggered, there is no method stub found on the code behind.


Posted: 12/21/2011

Professional 8338  points  Professional
  • Joined on: 4/15/2009
  • Posts: 424

Can you also please check if your .ASPX file is pointing properly to your .ASPX.CS (Code behind) file. Also try to recreate your dropdownlist and double click on it to generate the event for you.


Page 1 of 1 (3 items)