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 quotes I get a 'Tag not well formed' error message :(

Can't anyone see how I can resolve this?

Thanks

Tryst
0
Tryst
3/15/2006 9:22:06 PM
asp.net.web-forms 93655 articles. 5 followers. Follow

2 Replies
1226 Views

Similar Articles

[PageSpeed] 58

Try:

<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" />
0
jcasp
3/15/2006 11:51:25 PM
Thanks 'jcasp' that has sorted it.

I don't understand why the tutorial I was following done it that way, when it is clearly wrong.

Tryst
0
Tryst
3/16/2006 4:44:18 PM
Reply:

Similar Artilces:

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! You are missing ";" in  OnSelectedIndexChanged.. Try this. <asp:DropDownList ID="ParentDropDown" OnSe...

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...

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 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...

Funny character being added instead of spaces in .net web forms...please help
Hi,in all of my asp.net pages I have the following html code:&nbsp;&lt;TD class=padding colSpan=2 height=23&gt;&lt;div align="center"&gt;&lt;A &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; href="#"&gt;Privacy Policy&lt;/A&gt; »&lt;a href="#"&gt; Terms of Use&lt;/a&gt;&lt;/div&gt;&lt;/TD&gt;on my default.aspx page, this gets displayed as: Privacy Policy » Terms of Useand the code isPrivacy Policy » Terms of UseCan ...

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...

Sharepoint help! Error msg : "A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe"
hihi, I have set up a testing virtual server on my local machine. I installed win server 2003, wss 2.0, sql server 2000, and visual studio .net 2003. i tried to create a project in C# but when i build it and import the web part (.dwp) into the page, there is this error msg "A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe"  I seached most of the sites and they informed that the problem lies in the safe control in web.config i enter the safe control in web.config but i does not know where to put ...

Controlling web control instances on Web Form
I have created a composite control, extending functionality of the Hidden Control. However, I would like to prevent the user from adding this control to the page multiple times. I only want one instance of the control on the Web Form. What setting in my project to I adjust to enable this functionality? I can not find it in any of the books that I have referenced. Is this a setting or is this code that has to be added to the inheriting class. Looks like there is no standard apporach. But I'd consider using static field to count number of created objects and throw exception if second object ...

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 message on a web form
I am trying to generate text onto a form that is a view only form, but instead of getting the name for a unit I am getting a numeric value instead and I am trying to convert that numeric value into an alpha value. But I am running into an error message: "Column 'CCSC_Unit' does not belong to table CCSCUnit." What am I missing or doing wrong? Thanks ------------------------------------------------------------------------------------------------------ Public Sub GenerateText() Dim connString1 As String = ConfigurationSettings.AppSettings("connString1") '...

Web resources about - Error Message from HyperLink control : Too many characters in character literal - asp.net.web-forms

List of Killzone characters - Wikipedia, the free encyclopedia
Cpl. Dante Garza is a loyal, optimistic and likable character- an effective team player. A close companion of Sev, the pair have served together ...

New Zealanders who failed Australia's 'character test' returned: Peter Dutton
Twelve New Zealanders have left Australia after failing a &quot;character test&quot; as the federal government cracks down on foreign criminals. ...

Zoolander 2 faces boycott over Benedict Cumberbatch's transphobic character
The anticipated Zoolander sequel has been blasted as "hateful" in a petition agitating for the film to be boycotted for enforcing dangerous perceptions ...

Standard Of Review: Legal Novel ‘Motor City Shakedown’ Is Undermined By Romance Between Its Main Characters ...
Pop quiz, hotshot: name a thriller in which the two main characters become romantically involved but the romance does not feel clumsy or tacked ...

Sainsbury's Brings Beloved Kids' Character to Life and Tops U.K. Book Sales
This week saw an unexpected new title shoot to the top of the U.K's official book charts: "Mog's Christmas Calamity," by children's author Judith ...

Friday Evening Open Thread: Cartoons & Cartoon Characters
Charlie Hebdo's new cover: "They've got guns. Screw them, we've got champagne" pic.twitter.com/2vdhjizOU6 — Katy Lee (@kjalee) November 17, ...

George Lucas says if he could be any 'Star Wars' character, he'd be Jar Jar Binks
Of all the characters in "Star Wars," creator George Lucas says he'd be Jar Jar Binks in a v ideo for Vanity Fair . "I like all the characters," ...

Lives cut short by Paris attacks remembered in 140 characters
As Parisians remember the victims of last week's terror attacks with candles and flowers, another kind of memorial is unfolding on social media ...

Is Benedict Cumberbatch’s character in ‘Zoolander 2′ actually transphobic?
... prominently in the second trailer. I assumed Benedict would be playing himself or some version of himself, but he’s playing a real character, ...

Arrow Is Bringing Back A Major Character, Get The Details
When Arrow returns from its midseason hiatus next year, this character who hasn’t been seen since last season will return. Spoiler alert! If ...

Resources last updated: 11/24/2015 2:38:23 PM