I am calling a javascript on index change of a DropDownList, i do as follows
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
OnSelectedIndexChanged="toggleVisibility('Button1');">
I get the error during compiling as for the above line of code
Too many characters in character literal
Can anyone help me solve this issue?
OnSelectedIndexChangedis a server side event,you need to setOnClientClickinstead and set AutoPostBack=”false” if your intention is to toggle visibility on client sideFor the server side
So for the events you need to use the method name which has a specific signature, defined by the event type. Here is
object sender, EventArgs eEdit
DropDownList has no property called OnClientClick, so you need to add it in codebehind