event handling error

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.
 
K

Kevin Spencer

"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.
 
N

Nikhil Patel

Thanks Kevin.
I changed it to onChange. Now I don't get any error but the event does
not fire.
 
K

Kevin Spencer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,778
Messages
2,569,605
Members
45,237
Latest member
AvivMNS

Latest Threads

Top