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

110
Vistas
how to encode string with spaces into html valid id?

I have classitems whose unique identifier is their stringfield. I am set these elements in html using Razor(C#). I handle it for javascript. I need to convert strings from example"Mr. Smith" to id"{2342-2341-2324-...}" or at Base64"92384098230...". And then use javascript to get the value from the encoded string. How to do it in C# and Javascript?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You could do the following-

C# - Uri.EscapeDataString(String)

And to convert the above value in JavaScript-

js - unescape(string) or decodeURI(string)

If you would like to do the reverse you can use

C# - Uri.UnEscapeDataString(string) & js - escape(string) or encodeURI (string)
about 4 years ago · Juan Pablo Isaza Denunciar
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