Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Server.UrlEncode
Message
De
14/01/2008 14:00:31
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
ASP.NET
OS:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01281652
Message ID:
01281670
Vues:
7
This message has been marked as a message which has helped to the initial question of the thread.
>>>In JavaScript the ' should be replaced with \', however simply replacing newtitle doesn't work.
>>>
>>>Do you have ideas how can I solve this problem?
>>>
>>>Thanks a lot in advance.
>>
>>If special characters are needed as part of the value of the parm, you should URLEncode it and then URLDecode it when you need to extract the value again.
>
>What is the order of changes in this
>
>"&title=" + Server.UrlEncode(newtitle).Replace("'", "\'") + "';";
>
>Does it first do UrlEncode and then tries to replace ' with \' or vice versa?
>
>I think for JavaScript ' should be replaced with \' but the above code doesn't do this for me. How should I fix it?
>
>Thanks a lot again for your help.

URLEncode will be performed before the Replace method. At the time your Replace is run, there should be no "'" present in the string because it will have been encoded.
Very fitting: http://xkcd.com/386/
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform