event handling error

  • Thread starter Thread starter Nikhil Patel
  • Start date Start date
N

Nikhil Patel

Hi all,
I have a drop down in an asp.net form defined as below:

<asp:DropDownList id="dropDownLeaseType" runat="server"
OnSelectedIndexChanged="LeaseTypeChanged"></asp:DropDownList>

I have declared a javascript function as below:
<SCRIPT type="text/javascript">
function LeaseTypeChanged() {
WebComboWinningStructure.SelectedIndex =
WebComboLeaseType.SelectedIndex;
}
</SCRIPT>

The browser displays following error:
CS0117: Page does not contain the definition for LeaseTypeChanged.

Any help will be appreciated.

Thanks.
 
"OnSelectedIndexChanged" is a server-side event, which requires a
server-side event handler. "onchange" is the client-side event.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 
Thanks Kevin.
I changed it to onChange. Now I don't get any error but the event does
not fire.
 
Can you post the code now that you've revised it? Also, be aware of case
issues with JavaScript.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 
Back
Top