I have a bunch of Image Buttons in my code. When I leave them as they are, I can build my project without problems. However, when I add OnClick to an image button, I get the error:
Too many characters in character literal
For example, the following builds with no problems:
Expand|Select|Wrap|Line Numbers
- <asp:imagebutton id="myImgBtn" style="Z-INDEX: 102; LEFT: 82px; POSITION: absolute; TOP: 8px" runat="server" ImageUrl="images/myBtns/order.gif" BorderStyle="None" ToolTip="Order"></asp:imagebutton>
Expand|Select|Wrap|Line Numbers
- <asp:imagebutton id="myImgBtn" style="Z-INDEX: 102; LEFT: 82px; POSITION: absolute; TOP: 8px" runat="server" ImageUrl="images/myBtns/order.gif" BorderStyle="None" ToolTip="Order" OnClick="dcsMultiTrack('DCS.dcsuri','/ordering/orderbtn', 'WT.ti','Order')"></asp:imagebutton>
Why exactly is that error happening?
I googled for a solution, and found that I could add an attribute to the button in my C# code. However, I was wondering if I can do this straight in asp without resorting to changing the C# code. Oh, this happens with Visual Studio 2005. My machine has the following .Net frameworks: 1.1, 2.0, 2.0 SP2, 3.0 SP2, 3.5 SP1 (also 2.0 SDK and 1.1 SDK)
Thanks for any help.