473,407 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

removing query string items from url?

I have a gridview with data that's a link to another page.

I want to pass search information to the called page, but I don't want
that query string to remain in the address line beyond the initial
call.

Say my like looks like this, mypage.aspx?search="whatever"

should my users make a selection on the page or even refresh, I want
the ?search to go away.. what's the best way to address this

without forcing a response redirect?

Thanks for any help or information.

Apr 2 '07 #1
3 4232
On Apr 2, 10:51 pm, "jobs" <j...@webdos.comwrote:
I have a gridview with data that's a link to another page.

I want to pass search information to the called page, but I don't want
that query string to remain in the address line beyond the initial
call.

Say my like looks like this, mypage.aspx?search="whatever"

should my users make a selection on the page or even refresh, I want
the ?search to go away.. what's the best way to address this

without forcing a response redirect?

Thanks for any help or information.
Maybe you can use HTTP POST instead of GET method? In this case you
can call mypage.aspx without using querystring...

Example:

<form action="mypage.aspx" method="post">
<input type="text" name="search" value="whatever" />
<input type="submit" value="search" />
</form>

Apr 2 '07 #2
<form action="mypage.aspx" method="post">
<input type="text" name="search" value="whatever" />
<input type="submit" value="search" />
</form>
Thanks for that.. thinking about how this will work and what the
impact might be.

the hyperlink is inside a gridview on content page. The form, is on
the master page and will control many pages and controls. I'm not sure
how I would even set the id search to whatever from the gridview.

thank you.

Apr 2 '07 #3
On Apr 2, 11:56 pm, "jobs" <j...@webdos.comwrote:
<form action="mypage.aspx" method="post">
<input type="text" name="search" value="whatever" />
<input type="submit" value="search" />
</form>

Thanks for that.. thinking about how this will work and what the
impact might be.

the hyperlink is inside a gridview on content page. The form, is on
the master page and will control many pages and controls. I'm not sure
how I would even set the id search to whatever from the gridview.

thank you.
Well, what about a LinkButton Control instead of normal hyperlink?
The LinkButton posts the web form back.

in the grid

<asp:LinkButton
ID="Button1"
CommandArgument="whatever"
Text="Search">
runat="server" />

in the code-behind

protected void EditContent(object sender, CommandEventArgs e)
{
//e.g. use Session
Session["search"] = e.CommandArgument.ToString();
Response.Redirect("~/mypage.aspx");
}

OR there is also another way to use the PostBackUrl property

<asp:LinkButton ID="Button1"
PostBackUrl="~/mypage.aspx"
runat="server"
Text="Search" />

to pass the value: http://msdn2.microsoft.com/en-us/lib...39(VS.80).aspx

Apr 2 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jeremy Owens-Boggs | last post by:
We are trying to implement a dual list box selection where you have two list boxes, You highlight items in the right side list box, click a button and this moves those items over to the left hand...
6
by: A.M | last post by:
Hi, When I call Request.QueryString.Clear(); ASP.NET throws me this exception: Exception Details: System.NotSupportedException: Collection is read-only If the collection is read-onle,...
2
by: Zlatko Matić | last post by:
Hello. How to reference selected values from a multi-select list box, as a criteria in a query ? Is it possible at all? Regards, Zlatko
6
by: Niyazi | last post by:
Hi all, What is fastest way removing duplicated value from string array using vb.net? Here is what currently I am doing but the the array contains over 16000 items. And it just do it in 10 or...
17
by: Eric_Dexter | last post by:
def simplecsdtoorc(filename): file = open(filename,"r") alllines = file.read_until("</CsInstruments>") pattern1 = re.compile("</") orcfilename = filename + "orc" for line in alllines: if not...
0
by: mharness | last post by:
Hello, Under most circumstances I don't have any trouble removing items from a dropdownlist but this time it's not working. I have a ddl that list items which, when choosen are added to a...
2
by: Chesne | last post by:
I would like to be able to utilise a combo box where once an item has been selected then that item no longer appears in that list. Is there some code anyone has which will achieve this? If I...
7
by: =?Utf-8?B?Sm9lbCBNZXJr?= | last post by:
I have created a custom class with both value type members and reference type members. I then have another custom class which inherits from a generic list of my first class. This custom listneeds...
1
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, In my application I need to periodically remove all current items from a ListView and add a new set into it. The following abbreviated code contains the basic idea: private void...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.