Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Dear team,

I unable to send the Special Character on Joson Result through MVC3.
My code is

$.ajax({
url: "/ProxyMaster/AddProxyGroupMapping?jsonValue=" + strSelecteds + '&VendorId=' + hdnVendorId + '&hdncode=' + 'abcd#123',
type: 'POST',
cache: false,
dataType: "json",

but my JosnAction result i got hdncode is "abcd" only .
can you plese guide me hows we are send the special character.

Regards,
Ravi Sharma
Posted
Updated 6-Jan-19 23:38pm

Instead of using direct special characters use Url Endoding equivalent

http://www.tutorialspoint.com/html/html_url_encoding.htm[^]
 
Share this answer
 
Comments
Ravi Sharma 2 27-Nov-13 7:36am    
Hi,

Pass the Spcial Character this way encoded and browser conside this as text.
var hdncode = encodeURIComponent(abcd#123);

Regards,
Ravi Sharma
Mani89 30-Jan-15 1:22am    
thank u ravi sharma...
Kasious_KMR 4-Jun-20 9:43am    
thanks. worked for me :)
Use data attribute and post method in ajax method
 
Share this answer
 
Comments
CHill60 7-Jan-19 6:32am    
Far more information than this needed to explain the solution. When answering questions try to make the answer as clear as possible and don't make assumptions about anyone's level of knowledge

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