Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

195
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda