?
Solved

How do I clear request.querystring?

Posted on 2010-01-10
7
Medium Priority
?
970 Views
Last Modified: 2013-11-08
I have a  page which is called initially with a querystring. After I get the querystring values, I don't need the querystring. How do I set querystring null or nothing. Request.QueryString.Clear()
but get "readonly" errors.
Thanks
0
Comment
Question by:chandanchoubey
7 Comments
 
LVL 11

Accepted Solution

by:
ICaldwell earned 600 total points
ID: 26280195
You can't... The querystring is the data from the URL, for it to go to null or nothing you would need to redirect the user to the same page without parameters passed, this would of course cause the problem where you no longer see the data... Why do you want to clear the data?  It shouldn't cause any problems, this is by design to help you retrieve data....
0
 

Author Comment

by:chandanchoubey
ID: 26280232
Thanks for your response.  My gridview has employee name and date. so when you click on employee name, employee's time sheet is displayed from the date (passed through request.querystring) mentioned. I have another frame, where there is dropdown list of dates. To see employees timesheet, user can select date from the date dropdown too. Since this date dropdown in different frame and page timesheet is always displayed depending on the date earlier passed in querystring. Do you have any suggestion to achieve it.
Thanks for your help.
0
 
LVL 11

Assisted Solution

by:ICaldwell
ICaldwell earned 600 total points
ID: 26280252
Are you using an IFrame for this separate Date Drop down?  why do you have it in a separate frame?
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 

Author Comment

by:chandanchoubey
ID: 26280260
the separate frame is navigation frame. Its the way the application is designed, I cant remove the frame.
0
 
LVL 11

Assisted Solution

by:ICaldwell
ICaldwell earned 600 total points
ID: 26280268
You could pass data back and forth between the frames, you could pass the employee data to your date frame, while will then pass it back to your current frame when the date is selected.... Its going to be a pain but thats one way to do it....

Passing data would be done by using the query string, you can pass the user data in a variable....
0
 
LVL 6

Assisted Solution

by:aymoon80
aymoon80 earned 200 total points
ID: 26281060
you can use a ViewState or Session variables or Cookies to avoid depending on any information in the URL.

http://asp.net-tutorials.com/state/cookies/
0
 
LVL 10

Assisted Solution

by:codingbeaver
codingbeaver earned 200 total points
ID: 26288407
The QueryString is read only, so you cannot clear it. But there is a trick you can use to accomplish your task.

Say your page is called ABC.aspx?qs=Something&qs2=SomethingElse, then in Page_Load, you get the values from QueryString, and then save them in Session, then call Response.Redirect("ABC.aspx"). This way use will never get to see the QueryString in the URL.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Suggested Courses
Course of the Month12 days, 17 hours left to enroll

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question