473,662 Members | 2,382 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Setting the outgoing querystring

I would like to be able to set the querystring for the URL used for a
postback (the action attribute of the form). The Form property of the page
does not give access to this property, and I do not want to set the entire
value by using the Attributes property. Is there any simple property that
can be used to add to the outgoing querystring? Thanks.

Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/
Aug 15 '08 #1
3 1603
"Nathan Sokalski" <ns*******@kyle davidgroup.comw rote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
I would like to be able to set the querystring for the URL used for a
postback (the action attribute of the form). The Form property of the page
does not give access to this property, and I do not want to set the entire
value by using the Attributes property. Is there any simple property that
can be used to add to the outgoing querystring? Thanks.
Is this not for an ASP Classic / ASP.NET app...?

Assuming it's ASP.NET, there's no need to to this - this isn't the way
ASP.NET postbacks work at all...

If you need to persist information from client-side to server-side so that
it is available to a postback, put it in a hidden field:
http://msdn.microsoft.com/en-us/libr...ddenfield.aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 15 '08 #2
I understand that using a hidden field is a common (and normally good) way
to persist information, but here is a more detailed description of my
situation:

As a search technique, I am offering users the ability to use the
querystring. This will allow them to bookmark a specific search, as well as
simplify situations in which I create links and redirects to the page for
the purpose of displaying certain results. When a certain action is taken on
the page and it is posted back, I want the most recent search to be
displayed. I would like to only need to check one thing (in this case
QueryString) to see if I should display a specified search or the default
search. And regardless of why I am using it here, I would like to know a
simple way to add to the querystring without using string manipulation. Any
ideas?

"Mark Rae [MVP]" <ma**@markNOSPA Mrae.netwrote in message
news:uN******** ******@TK2MSFTN GP05.phx.gbl...
"Nathan Sokalski" <ns*******@kyle davidgroup.comw rote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
>I would like to be able to set the querystring for the URL used for a
postback (the action attribute of the form). The Form property of the
page does not give access to this property, and I do not want to set the
entire value by using the Attributes property. Is there any simple
property that can be used to add to the outgoing querystring? Thanks.

Is this not for an ASP Classic / ASP.NET app...?

Assuming it's ASP.NET, there's no need to to this - this isn't the way
ASP.NET postbacks work at all...

If you need to persist information from client-side to server-side so that
it is available to a postback, put it in a hidden field:
http://msdn.microsoft.com/en-us/libr...ddenfield.aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 15 '08 #3
"Nathan Sokalski" <ns*******@kyle davidgroup.comw rote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
>I would like to be able to set the querystring for the URL used for a
postback (the action attribute of the form). The Form property of the page
does not give access to this property, and I do not want to set the entire
value by using the Attributes property. Is there any simple property that
can be used to add to the outgoing querystring? Thanks.

Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/
Server-side buttons have the PostBackUrl property, does this help?

Jeff
Aug 15 '08 #4

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

Similar topics

12
5286
by: Alex | last post by:
I have a question about determining if one QueryString keys exists. The idea is, if this key exists, than its presence is enough to indicate that its value is true. For example ... www.something.com/main.aspx?client Client is the QueryString, but no value is given. This would mean to me that client exists, so its value is true. In the code behind, I can tell that client exists using Request.QueryString.Keys.Count, which equals 1....
3
5614
by: Nobody | last post by:
Hi -- I'm developing an ASP.NET application in VS.NET and I want the startup page to read in some parameters from a querystring. But I can't figure out where to set the querystring. I thought it was in the Project Properties dialog under the Debugging tab. There's a dropdown box where you can set the start up page. But VS ignores the querystring I add to the page name in this combo box. I know this because the Request.QueryString...
8
2258
by: David Lozzi | last post by:
Howdy, I have a user control that is a report to display data. On the page the control is inserted in, I have filter options to filter the report. When I try to do something like this, nothing happens. dim filt as string ... build filter string... UserControl.ReportFilter = filt
3
4268
by: Reny J Joseph Thuthikattu | last post by:
Hi, If i put a month callender on a asp.net web form and specify the culture on the page directive like '<%@ Page language="c#" Culture="ar-OM"%> it will display the Month callender in arabic. I want the same result for my windows application.Can any one tell me how can i do that?
2
3024
by: jeffmagill | last post by:
Hello everyone, I have what I thought was a simple script but I cant figure it out. Anyway, I want to set the selected item of a drop down list with information i am recieving from request.querystring. Seems like this is a case of when learning asp.net first is a hindrance to what i want to do. Im looking for something to the effect of, Request.Form("dd_eventdate")= Request.QueryString("event")
1
1849
by: Chris Lincoln | last post by:
Hello, I can't quite seem to figure out this issue; it is specific to Firefox, as it works fine in IE. I have an iFrame within an aspx page that is passed a value in the query string (e.g. /index.aspx?query=about%20us). What happens (in IE at least!) is that upon load, a textbox is filled with the querystring and a search function is executed (search function is not an issue).
3
8172
by: keith.schincke | last post by:
I know I must be missing something basic. I am developing of Firefox 1.5 and am trying to to send a basic QUERY_STRING to a test CGI that will print the data back to the brower: I can print my query string with an alert() right before the request.send(queryString). An examination of the cgi enviroment and tcpdump does not show QUERY_STRING being set. Is there some I uncrossed or T on dotted?
10
2507
by: Brad Baker | last post by:
I have an asp.net/csharp application that requires a particular variable to work properly. This variable is usually passed via a query string in the URL when the application is first run but under certain circumstances the query string may not contain the variable. So I need some way of establishing a default value if one isn't set. Is there some way I can set a query string on page_load OR is there some way I can use a global variable...
3
2156
by: pingsheng | last post by:
Dear all, I have a form with dynamically created input fields. These fields go to next page for submitting into SQL database. The thing is all fields are the same but 4 fields. So each record must be submitted with a unique key, while everything is the same, these 4 fields must be different.... Idealy, these are the codes. please teach me how to do it. objConn.Open(sConnection) sRowNum = request.querystring("row_num")
0
8432
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8856
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8762
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8545
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7365
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6185
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5653
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.