Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

191
Views
HttpUtility.HtmlEncode() is not working for some special characters

Im using asp.net Telerik Grid and i need to call a javascript method inside of it. as parameters im passing string for that method. that string can contain special characters such as ',",/,\ ect. when that string contains those special characters, the javascript function is not calling.

so i used HttpUtility.HtmlEncode(string) for this and this is working for some special characters and wont work for some. below is my code.

<telerik:GridTemplateColumn>
  <ItemTemplate>
     <%#"<a onclick='" +( ((string)((Container as GridDataItem).GetDataKeyValue("Type")) == "Additional")?  ("showAdditionalPositionNoteEdit("+ (Container as GridDataItem).GetDataKeyValue("ID")+ ",\""+HttpUtility.HtmlEncode((Container as GridDataItem).GetDataKeyValue("Note"))+"\")"): ("showDialog2("+ (Container as GridDataItem).GetDataKeyValue("ID")+ ",\""+HttpUtility.HtmlEncode((Container as GridDataItem).GetDataKeyValue("Note"))+"\")")) + ";return false;'>Edit Notes</a>"%>
  </ItemTemplate>
</telerik:GridTemplateColumn>

this part is the one that need a solution. HttpUtility.HtmlEncode((Container as GridDataItem).GetDataKeyValue("Note"))

This note can contain any special character. and i need to do this on clientside

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!