How do I prevent asp net from converting the symbol to amp when adding a url

Introduction

1: URL


string url = "https://example.com/page?param1=value1%26param2=value2";

Solution 2: Encoding



  
    
  

Solution 3: Use .UrlDecode


string encodedUrl = "https://example.com/page?param1=value1&param2=value2";
string decodedUrl = Server.UrlDecode(encodedUrl);

Conclusion

Rate this post

Leave a Reply

Your email address will not be published. Required fields are marked *

Table of Contents