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

113
Views
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 answers
Answer question

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 Report
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!