Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 421851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:01:25+00:00 2026-05-12T19:01:25+00:00

Here’s another one for you to help me solve: I have an ASP.NET website

  • 0

Here’s another one for you to help me solve: I have an ASP.NET website that uses AJAX (asynchronous) calls to am .ashx handler, passing a query string parameter to get some information from the database.

Here’s an example of how it works:

Client-side (Javascript) code snippet that makes the asynchronous call to the handler:

/* Capture selected value from a DropDownBox */
var dropdown = document.getElementById(DropDownID);
var selectedValue = dropdown.options[dropdown.selectedIndex].value;

/* Make the call to the handler */
var url = "MyHandler.ashx?param=" + selectedValue;

var ajaxObj = new Ajax();
ajaxObj.doRequest(url, MyCallback, args, connectionFailed);

When I load the webform (that contains this AJAX call) for the first time, it sends the right query string to the handler (I checked it using debug in Visual Studio), like param = Street Joseph Blíss. That’s the right behavior I want it to have.

The thing is that when I load that webform again (and all subsequent times), that í character from “Blíss” appears in server-side as í-. As that’s the key from the entity I’m trying to select on server-side database access script, it doesn’t work as it worked on 1st webform load.

I tried encoding the query string on client-side and decoding it on server-side, using something like this:

Client-side (Javascript):

var encodedParam = encodeURIComponent(selectedValue);
/* Make the call to the handler */
var url = "MyHandler.ashx?param=" + encodedParam ;

Server-side (ASP.NET, C#):

string encodedParam = context.Request.QueryString["param"];
string value = HttpUtility.UrlDecode(encodedParam, Encoding.ASCII);

…but I had no luck with it and the problem still remains. Any help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T19:01:25+00:00Added an answer on May 12, 2026 at 7:01 pm

    After some more searching, I found out how to solve with server-side code refinement. Here’s the deal:

    I had to alter my .ashx handler to parse the original parameter grabbed from the query string and convert it into UTF-8. Here’s how it’s made:

    // original parameterized value with invalid characters
    string paramQs = context.Request.QueryString["param"];
    // correct parsed value from query string parameter
    string param = Encoding.UTF8.GetString(Encoding.GetEncoding("iso8859-1").GetBytes(paramQs));
    

    Happy coding, folks! 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my scenario - I have an SSIS job that depends on another prior
Here is my problem...I have a page that loads a list of clients and
Here is my code (Say we have a single button on the page that
Here is another spoj problem that asks how to find the number of distinct
Here is the issue I am having: I have a large query that needs
Here is an example: I have a file 1.js, which has some functions. I
Here is my situation: I am using telerik with winform. I have a dataset
Here's the basic setup: I have a thin bar at the top of a
Here is my problem : I have a post controller with the action create.
Here's what I'm trying to accomplish with this program: a recursive method that checks

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.