Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I will explain scenario first.

I have 2 list boxes, list a with some units and list b with the same units. For ex. list a im selecting Kg and list b im selecting g. In 'From' textbox im entering 1 and as soon as the key is up in 'To' textbox 1000 will be displayed. it is working correct.Im doing this with keyup event i.e when the key is up im passing the values to xml through ajax and to c# if condition and if the 'From' unit and 'To' unit matches then it calculates.
For ex. if list a im selecting cm/s² and when keyup event is triggered the cm/s is passing correctly but the squared is not passing correctly...so that when it passes to c# the condition is becoming false and it is returning 0 to the 'To' textbox as 0 i.e the squuared or cubed is passin as a unknown symbol.

Please help me out how to pass the squared to xml through ajax as such as squared itself.

Thanks in advance

Regards,
Naveen
Posted

1 solution

There is no such thing as "special character". HTML, JavaScript and .NET all support Unicode. There is nothing you have to do about it. With HTML, you should save file using appropriate Unicode charset, which should be UTF-8. It is important to always write it in HTTP-EQUIV, even if UTF-8 is default for your site (people saving your pages locally don't have to know it and don't have to modify the file):
HTML
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

To hard-code any arbitrary character in HTML, you need to know HTML character entities:
http://www.w3.org/TR/html4/sgml/entities.html[^].

Note the "&#...;" (or "&#0x...;") syntax which allow you to enter a character by its Unicode code point.

—SA
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900