.net query string

we have to call a query string like default.aspx?id=1&address=1000 main street. #1000

and when we called like string address = request.querystring["address"], we only get 100 main street.

How can we get the whole address?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

On the client side you'll have to encode the query string and decode it on the server before parsing it.

//client side
//called by the onSubmit;
 function encodeURL(requeststring)
    //encodeURI("default.aspx?id=1&address=1000 main street. #1000");


string address = HttpContext.Current.Server.UrlDecode(HttpContext.Current.Request.QueryString["address"].ToString());
Rose BabuSenior Team ManagerCommented:
If you can change the original url as below while redirecting
Response.Redirect("~/Default.aspx?id=1&address=" + Server.UrlEncode("1000 main street. #1000"));

Open in new window

then you can parse that as below
Label1.Text   = Server.UrlDecode(Request.QueryString["address"]);

Open in new window

ITsolutionWizardAuthor Commented:
not working from both solutions
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

Post your code from client and server, should work, must be an order of calls issue.
ITsolutionWizardAuthor Commented:
If I do not add "#", everything is working. But if I add "#", it shows nothing.

OK when are you encoding the url ?
show us some results frome both sides i.e. debug.print

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.