Pulling my hair out on this one. I want to run a simple js function when a user selects an item from a drop down (I'm sure this is an ASP.NET issue).
This is my Javascript function:
My call to the (js) file that contains the function
My drop down listbox that contains the event:
This is the error (right at compile):
Any ideas? Let me know thanks.
This is my Javascript function:
Code:
function SetupUserType(UserType){
if(UserType=='Customer'){
lstNPCs.Enable=false;
lstRoles.Enable=true;
}else{
lstNPCs.Enable=true;
lstRoles.Enable=false;
}
}
My call to the (js) file that contains the function
Code:
<script language="javascript" src="Local.js"></script>
My drop down listbox that contains the event:
Code:
<asp:dropdownlist OnSelectedIndexChanged="SetupUserType(this)" id="ddlUserType" runat="server">
<asp:ListItem Value="Customer" Selected="True">Customer</asp:ListItem>
<asp:ListItem Value="Employee">Employee</asp:ListItem>
</asp:dropdownlist>
This is the error (right at compile):
Code:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0117: 'ASP.Administrator_aspx' does not contain a definition for 'SetupUserType'
Source Error:
Line 30:
<asp:dropdownlist OnSelectedIndexChanged="SetupUserType(this)" id="ddlUserType" runat="server">
Line 31: <asp:ListItem Value="Customer" Selected="True">Customer</asp:ListItem>
Line 32: <asp:ListItem Value="Employee">Employee</asp:ListItem>
Any ideas? Let me know thanks.