473,394 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Too many characters in character literal - what does it mean, and how to fix?

17
Hello,

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
  1. <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>
  2.  
That same line, with OnClick added, does not build, and I get the above mentioned error:
Expand|Select|Wrap|Line Numbers
  1. <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>
  2.  
How can I fix this? I'm trying to add the OnClick code in order to keep stats of button presses (we use webtrends).
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.
Dec 19 '08 #1
2 14511
Curtis Rutland
3,256 Expert 2GB
Are you trying to use a Javascript when you click the imagebutton?

OnClick is a server side event. If you want your client side scripting to catch the event, you want to use OnClientClick.
Dec 19 '08 #2
Plater
7,872 Expert 4TB
@insertAlias
I didn't even catch that, nice one
Dec 19 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Old Wolf | last post by:
The purpose of the following code is to search a string for a substring, and replace the first character of the found string with a new value: #include <algorithm> #include <string> ...
6
by: wintaki | last post by:
Given int x; What does x evaluate to? If x is 0, it equals 0x31, the ascii value of '1'. So for some reason, x evaluates to *(y+x) where x is a non pointer/array type.
3
by: Eranga | last post by:
What is empty character literal and how can we get rid of it. I want to check whether the text box is empty so I use if (TextBox1.Text == '' ) Why cant I do this? *** Sent via Developersdex...
9
by: VJ | last post by:
I have a property for a control ( source code not available) . The property accepts single char as value.. so I can set it to '/' or ':' or anything like that...At initialize of my From I want this...
15
by: pkaeowic | last post by:
I am having a problem with the "escape" character \e. This code is in my Windows form KeyPress event. The compiler gives me "unrecognized escape sequence" even though this is documented in MSDN....
9
by: plusk1008 | last post by:
I have finals next week and I am stuck on one question on my review sheet for excel. So once again I beg: Please, please, please, please, please, please, please, please, please, please someone help...
9
by: gvanosdol | last post by:
When on my development machine, I can execute the code in the subject (string strVarArr = strVar.Split('x');) without any problems. When I try to move the code to my server, I get "CS1011: Empty...
6
by: =?ISO-8859-2?Q?Boris_Du=B9ek?= | last post by:
Hi, I have trouble defining a macro - see the following code: #define LETTER_STRAIGHT(let) let = L'#let' enum Letter { LETTER_STRAIGHT(A), LETTER_STRAIGHT(B), LETTER_STRAIGHT(C),
1
by: Monica Pnade | last post by:
what does /^/ mean in perl?
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.