Error: Too many characters in character literal

Hi. I'm tryingout the CallBack Event handling code from here: http://www.asp.net/QuickStart/util/srcview.aspx?path=~/aspnet/samples/tipstricks/CallBackEventHandler.src

 

I'm using C#.   My problem is when I build the website I get error: "Too many characters in character literal" for line

<asp:DropDownList ID="ParentDropDown" OnSelectedIndexChanged="GetChildren(this.options[this.selectedIndex].value, 'ddl')" Runat="server">

Please help. Thanks!

0
pshisbey
2/15/2006 4:05:31 PM
asp.net.getting-started 91979 articles. 3 followers. Follow

8 Replies
1142 Views

Similar Articles

[PageSpeed] 29

You are missing ";" in  OnSelectedIndexChanged..

Try this.

<asp:DropDownList ID="ParentDropDown" OnSelectedIndexChanged="GetChildren(this.options[this.selectedIndex].value, 'ddl');" Runat="server">



My Blog


"Don't be afraid to be wrong; otherwise you'll never be right."
0
budugu
2/15/2006 4:25:44 PM

Not 100% sure, bu try changing

OnSelectedIndexChanged="GetChildren(this.options[this.selectedIndex].value, 'ddl')"

to

OnSelectedIndexChanged='GetChildren(this.options[this.selectedIndex].value, "ddl")'

0
jcasp
2/15/2006 4:35:50 PM
Thanks. That did get rid of the "Too many literals" error but now it complains that there is no definition for "GetChildren", "options", and "selectedIndex".  I'm using the code straight from ASP.Net. Why doesn't it work?
0
pshisbey
2/15/2006 4:46:08 PM
budugu wrote:

You are missing ";" in  OnSelectedIndexChanged..

Try this.

<asp:DropDownList ID="ParentDropDown" OnSelectedIndexChanged="GetChildren(this.options[this.selectedIndex].value, 'ddl');" Runat="server">

Thanks! You're right.  However:

<asp:DropDownList ID="ParentDropDown" OnSelectedIndexChanged='GetChildren(this.options[this.selectedIndex].value, "ddl");' Runat="server"> 

Errors out with : ')' expected and invalid expression in term ')'

<asp:DropDownList ID="ParentDropDown" OnSelectedIndexChanged="GetChildren(this.options[this.selectedIndex].value, 'ddl');" Runat="server">

Errors out with: Too many litterals....

0
pshisbey
2/15/2006 5:10:55 PM


That's because your DDL needs to be defined like:
   <asp:DropDownList ID="ParentDropDown" OnSelectedIndexChanged="GetChildren" Runat="server">

And then in the CodeBehind, have an event handler for it like this:
   C#
   ---
   protected void GetChildren(object sender, System.EventArgs e)
   {

   }

   VB
   ---
   Protected Sub GetChildren(ByVal sender As System.Object, ByVal e As System.EventArgs)
 
   End Sub

NC...

0
NC01
2/15/2006 5:23:55 PM

You're saying that I make major modifications to the sample file?  I don't know.  This code is taken from here :

http://www.asp.net/QuickStart/util/srcview.aspx?path=~/aspnet/samples/tipstricks/CallBackEventHandler.src&file=CallBackEventHandler_cs.aspx.cs&lang=C%23+Source

and it works for them.

0
pshisbey
2/15/2006 5:33:55 PM

It's fixed.   Don't know what was wrong but when I recopied and pasted both files it worked.

Thanks for the help.

0
pshisbey
2/15/2006 5:42:20 PM

Ahhh, sorry didn't catch that you were using 2.0 and CallBacks.

Maybe there's an error in the source. Bring the page up in the browser and do a View Source and post the resultant code.

 

NC...

 

0
NC01
2/15/2006 5:54:18 PM
Reply:

Similar Artilces:

Why am I getting "Too many characters in character literal" here?
Why am I getting "Too many characters in character literal" here? <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> I checked another project that compiles, and the line above is exactly the same...?Clay Shannon,author of historical works, novels, and art/poetryhttp://www.knowitallsports.com/booklinks.aspx Are you sure that's the line causing the error?That error usually happens when you use single quotes when you should have used double quotes. Please Mark As Answer posts that ...

Error Message from HyperLink control : Too many characters in character literal
Hi all, I can getting this error message from the HyperLink control for some reason when using the following code:<asp:HyperLink     CssClass="text"     NavigateUrl="clients.aspx?CatType=<%# DataBinder.Eval(Container.DataItem, 'au_id')%>"     Text="<%# DataBinder.Eval(Container.DataItem, 'au_fname') %>"     Runat="server"     ID="HyperLink1" />Now I think the problem is because I am using single quotes and ASP.NET assuming its a Char (am I right here?), so if I replace these single quotes with double...

too many characters in character literal
I have this javascriptfunction kolla(hal) {  alert(document.getElementById('<%=txtHole'+hal+'Points.ClientID%>').value);     } the errormessage from VS2005 is too many characters in character literal   the functioncall is txtHole1Strokes.Attributes.Add("onchange", "kolla('1');");   how can i change the string?   also, this is ok document.getElementById('<%=txtHole8Strokes.ClientID%>').value;   // Regards Tomas  alert(document.getElementById('<%=txtHole %>'...

"Newline in constant" and "Too many characters in character literal" errors. Dataadapters and datatables.
I'm getting the above errors on line 41 (parameter delcaration)... been hitting my head on this for a while.. please help.  public static DataTable dtCleanVendorUsers(string username) {SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["VendorEvaluationConnectionString"].ConnectionString); SqlDataAdapter dataadapter = new SqlDataAdapter();dataadapter.SelectCommand = new SqlCommand("SELECT vendoruser_user_id, vendoruser_vendor_id, user_name, vendor_name, vendor_evaluated FROM vwVendorUsers WHERE (vendor_evaluated = 0) and (u...

Too many characters in character literal in javascript!!!
Hi All: I have code:string MyCust_Code = e.Row.Cells.FromKey("CusCode").ToString(); e.Row.Cells.FromKey("CusName").Value = "<span style='cursor:hand' onclick='javascript:PopupCampaign_Test('" + MyCust_Code + "');'><font color='#0000ff'>" + e.Row.Cells.FromKey("CusName").ToString() + "</font></span>"; And PopupCampaign_Test Javascript function:function PopupCampaign_Test(stringrequest) {mywindow = window.open('../LGPopup/SearchCampaignReload.aspx?MyCus_Code='+strin...

Too many characters in character literal while calling javascript function.
Hi, I wanna call the java script function when a gridview's link is clicked.The link is dependent on the query string value of the row.I am using the the template column in the gridview as below code, <ItemTemplate>       <a style="color: Blue" href="javascript:gotoURL(this,<%#GetURl(DataBinder.Eval(Container.DataItem,'id'))%>);">               <%#GetMove(DataBinder.Eval(Container.DataItem,'M_Number').ToString())%> //This is the...

Error converting characters into server's character set. Some character(s) could not be converted.
Error converting characters into server's character set. Some character(s) could not be converted. No changes made to database. UPDATE Ticket_detail SET problem = 'mecho Team, I have set up several table repdefs in our test environment (PROD_jam) to determine the benefit of having table repdefs in addition to a database repdef. After I set up one of the table repdefs I ran several updates on the primary table to verify whether the where-clause was smaller on the replicate database. When I reviewed the transaction in the outbound queue on the secondary rep server (T...

How do I get the data character by character from a dw_1?
Hi I need to capture character by character the data at the time the user is entering the information on the dw_1 object input field. How do I get that? or it must be in a particular event? Thanks EN See EditChanged event of Datawidnow dw_1 .... but don't necessarily expect "character by character" data input. With a Ctrl-V, a user can paste thousands of characters into a field, and this will fire off only one EditChanged event. There is no event that will fire for each of these pasted characters. Be careful of your assumptions. Good luck, Terry [Team...

too many characters in literal
thats my javascript error it wont build and this is my code <input type="hidden" runat="server" id="hdnAddInfoIndex" /> <asp:RadioButtonList ID="rblOffers" runat="server" AutoPostBack="false" OnSelectedIndexChanged="CheckAdditionalInfo('rblOffers')" > </asp:RadioButtonList>  function CheckAdditionalInfo(rbList) {var needAdditionalInfo = new Array(); var selectedValue = '';var radiobuttonlist = document.getElementById(rbList);needAdditionalInfo = document.getElementById("h...

superreview requested: [Bug 260660] RDFServ nspr logging for literals prints out a single character : [Attachment 159530] print more than a single character of the literal
timeless@myrealbox.com (working) <timeless@bemail.org> has asked Daniel Veditz <dveditz@cruzio.com> for superreview: Bug 260660: RDFServ nspr logging for literals prints out a single character http://bugzilla.mozilla.org/show_bug.cgi?id=260660 Attachment 159530: print more than a single character of the literal http://bugzilla.mozilla.org/attachment.cgi?id=159530&action=edit ...

superreview granted: [Bug 260660] RDFServ nspr logging for literals prints out a single character : [Attachment 159530] print more than a single character of the literal
Daniel Veditz <dveditz@cruzio.com> has granted timeless@myrealbox.com (working) <timeless@bemail.org>'s request for superreview: Bug 260660: RDFServ nspr logging for literals prints out a single character https://bugzilla.mozilla.org/show_bug.cgi?id=260660 Attachment 159530: print more than a single character of the literal https://bugzilla.mozilla.org/attachment.cgi?id=159530&action=edit ------- Additional Comments from Daniel Veditz <dveditz@cruzio.com> sr=dveditz ...

Error converting characters into server's character set.
Hello, I am running Sybase ASE as repository (Forms) for application development. I try load some forms (10 MB) into application (its repository in Sybase) but I ve got this message: Error converting characters into server's character set. Some character(s) could not be converted. (Sybase SQL Server error number : 2402 severity : 16 state : 11) I know theese commands : sp_configure "enable unicode conversions" and set char_convert But I dont know which one I need to use it or how exactly I have to use it for conversion of imported data... David ...

getting double the characters when receiving non-English characters [Edit]
Hi, I have a webbroker standalone application receiving requests from a sms cloud service (Twilio). It's sending the SMS or texting body from a mobile phone. Everything works fine if I receive English characters. If other characters are sent (like French or Greek), I get double the characters and they are weird characters - not the right ones. I suspect that it's being sent as utf8 encoded. And when there's non-English, it's 2 bytes ... for some reason this turns into 4 bytes by the time it gets to: text := Request.Content.Fields['Body']; ??? I don...

A name was started with an invalid character
hi friends, we have developed web Application, its working fine in Win NT Server, but now we are trying to deploy in Linux server, But now we are receiving the following error, its very urgent , Please help me to sort put this. The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. -------------------------------------------------------------------------------- A name was started with an invalid character. Error processing resource 'http://www.fxtradex.com/Default.asp...

Web resources about - Error: Too many characters in character literal - asp.net.getting-started

Dilbert (character) - Wikipedia, the free encyclopedia
Dilbert is a fictional character and the main character and protagonist of the Dilbert comic strip . He is a white collar office worker who has ...

Cut ‘Star Wars: The Force Awakens’ scene reveals a new character’s major powers
... one of the many Star Wars movies that will hit cinemas by the end of this decade. One of the best things about the movie was its new characters ...

Jack & Coke renamed "The Lemmy" by Food & Beverage magazine; Lemmy now a GTA V character
by Rob Sperry-Fromm In the wake of Lemmy's passing, tributes to the Motorhead frontman have come from all over the place, including a petition ...

A deleted scene from 'Star Wars: The Force Awakens' reveals a new character's awesome power
Maz Kanata's castle plays a larger part in "The Force Awakens" than the character herself, but she's more powerful than you realized watching ...

Nintendo promises “big characters” like Mario coming to smartphones this year
... by 2017. The first Nintendo game for smartphones, though, was delated until March, and worse, features none of Nintendo’s best known characters. ...

Barbara Allyne Bennet Dies: Veteran Character Actress Was 76
Barbara Allyne Bennet , a veteran character actress and former SAG board member, has died January 9. She was 76. A Cleveland native, Bennet moved ...

Jimmy Fallon and 'Sesame Street' Characters Adorably Photobomb Unsuspecting Kids
The 'Tonight Show' host teamed up with Big Bird, Elmo, Cookie Monster and other 'Sesame Street' stars for the cutest video ever!

Netflix open to more Marvel shows: Any character could get spin-off - EW.com
Skip to main content X TV TV Recaps Movies Music Books Gaming Video Recaps The Royals Angie Tribeca Billions Downton Abbey Galavant The Good ...

'Plants vs. Zombies Garden Warfare 2' Beta Shows Off New Modes, Characters And Weapons
Plants vs. Zombies Garden Warfare 2 beta proves popular as sequel impresses with its new modes, characters, weapons and locations.

Rogue One Could Feature a Star Wars Character We Thought We'd Never See Again
Civil War will balance its dark moments with some superhero humor. The long-awaited Jumanji reboot gets a director. Chris Pine talks Wonder Woman ...

Resources last updated: 1/19/2016 6:18:49 AM