Click here to Skip to main content
15,886,806 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created web application.I am giving one of web page to client as api.Client can pass parameter to web page like below
Ex: www.domainname.com/Testpage.aspx?name=pinky&city=pune&number=xxxxxxxx

In same page Testpage.aspx,I am accessing/fetching querystring like below.
C#
string s= Request.Querystring["name"];

I am not sure how client can call api.I mean to say from browser or code throught.Whether client use urlencode or not?

from code

www.domainname.com/Testpage.aspx?name=Server.UrlEncode("pinky")&city=Server.UrlEncode("pune")&number=Server.UrlEncode("xxxxxxxx")

will below code work ? or does i need to decode?If client did not use Encode then decode work fine?.I want user querystring value further processing and insert into table.
C#
string s= Request.Querystring["name"];


What I have tried:

string s= Request.Querystring["name"]; 
Posted
Updated 9-Mar-17 21:02pm
v2
Comments
Graeme_Grant 10-Mar-17 2:06am    
Have you tried it?
Member 11589429 10-Mar-17 2:38am    
Yes
Graeme_Grant 10-Mar-17 2:39am    
and what happens?
Graeme_Grant 10-Mar-17 3:33am    
Developers sacrifice and contribute their time for free to help fellow developers resolve difficulties. It is important that you are crystal clear about what you are experiencing with plenty of information so that your time and theirs are not wasted. The clearer the question, the better chance that you will get a favorable response in a timely manner.

Please take the time to look at these links provided before posting questions:
* Basic Debugging with Visual Studio 2010 - YouTube[^]
* Some guidelines for posting questions in the forums[^]
* Tales from the Evil Empire - Asking questions is a skill[^]

Once you are ready update the question with clear and concise details, sample code, any error messages (includding inner exception details), etc, please click on Improve question to add more info to the question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900