Results 1 to 2 of 2
  1. #1
    manik's Avatar
    manik is online now Om Shanti!
    Join Date
    Apr 2008
    Location
    Boston, USA
    Posts
    13,172
    Thanks
    744
    Thanked 699 Times in 550 Posts
    Blog Entries
    4
    Feedback Score
    4 (100%)

    Default Too many characters in character literal - Asp .Net with JavaScript

    Too many characters in character literal - Asp .Net with JavaScript

    When you try to build a javascript string in asp .net you might bump into this error. The common cause of this not escaping the characters that need to be escaped.

    For example
    StringBuilder sb=new StringBuilder();
    sb.Append(@"<a href="JavaScript:Method('var');">Call method</a>");

    When using Vervatim you still need to escape the double quotes using another double quote not with a backslash(\).

    This should be the proper way of doing it.

    sb.Append(@"<a href=""JavaScript:Method('var');"">Call method</a>");

    There could be other case scenarios.
    Free Classified Ads & BUSINESS/PROFESSIONAL SOCIAL NETWORK


  2. #2
    samson77 is offline Freshman
    Join Date
    Dec 2010
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Feedback Score
    0

    Default

    The Most of the time users are facing the above mentioned exception when ever they are uploading data or some images into data base.Thanks for sharing information.

Similar Threads

  1. HTML/XHTML Character Entities
    By BrainPulse in forum HTML / DHTML
    Replies: 7
    Last Post: 09-10-2010, 01:19 PM
  2. Replies: 0
    Last Post: 06-23-2010, 08:04 AM
  3. Valid Characters in Url
    By manik in forum Web Development - Programming & Coding
    Replies: 0
    Last Post: 06-08-2010, 03:14 PM
  4. Which character in the Cullen family do you like most?
    By technohive in forum General Talk
    Replies: 7
    Last Post: 01-18-2010, 05:17 PM
  5. XHTML Character Entity Reference
    By Amit.Verma in forum HTML / DHTML
    Replies: 2
    Last Post: 08-07-2008, 09:15 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •