473,804 Members | 4,128 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Removing a Request variable

I set ndi in a repost of a page:

window.location .href=
'../Test/test.aspx' +
'?ndi=' +
theform.domain_ SELECT.options. selectedIndex;

In the test.aspx.cs code-behind, I test if ndi is set as

if ( Request [ "ndi" ] != null )

How can I cause ndi to become null once that I've tested it and found it
existed? A Session variable is cleared by Session.Content s.Remove. Is there
an equivalent for a Request variable?

TIA

--
Gus Gustafson
Nov 17 '05 #1
2 1488
Hi Gus,

I think the querystring name value collection of the HttpRequest object
is read only.

I'm a little puzzled why you might need this functionality? When needing
a querystring value, you might want to use a variable, especially as the
ndi variable is actually an integer.

int ndi = -1; //no ndi value selected

if (Request["ndi"] != null && Request["ndi"] != String.Empty)
{
ndi = Int32.Parse(Req uest["ndi"]);
}
if (ndi > -1)
{
Debug.WriteLine ("We have a ndi value!");
}

Ward

Gus Gustafson wrote:
I set ndi in a repost of a page:

window.location .href=
'../Test/test.aspx' +
'?ndi=' +
theform.domain_ SELECT.options. selectedIndex;

In the test.aspx.cs code-behind, I test if ndi is set as

if ( Request [ "ndi" ] != null )

How can I cause ndi to become null once that I've tested it and found it
existed? A Session variable is cleared by Session.Content s.Remove. Is there
an equivalent for a Request variable?

TIA

Nov 17 '05 #2
Ward, of course you are right in your questioning motive. Last night I
realized that the only time I needed to test ndi was in the case ! PostBack.
That saves trying to clear a read-only variable.

Thanks for reminding me about the String.Empty test.

Thanks for your thoughts.

--
Gus Gustafson
"wbekker" wrote:
Hi Gus,

I think the querystring name value collection of the HttpRequest object
is read only.

I'm a little puzzled why you might need this functionality? When needing
a querystring value, you might want to use a variable, especially as the
ndi variable is actually an integer.

int ndi = -1; //no ndi value selected

if (Request["ndi"] != null && Request["ndi"] != String.Empty)
{
ndi = Int32.Parse(Req uest["ndi"]);
}
if (ndi > -1)
{
Debug.WriteLine ("We have a ndi value!");
}

Ward

Gus Gustafson wrote:
I set ndi in a repost of a page:

window.location .href=
'../Test/test.aspx' +
'?ndi=' +
theform.domain_ SELECT.options. selectedIndex;

In the test.aspx.cs code-behind, I test if ndi is set as

if ( Request [ "ndi" ] != null )

How can I cause ndi to become null once that I've tested it and found it
existed? A Session variable is cleared by Session.Content s.Remove. Is there
an equivalent for a Request variable?

TIA

Nov 17 '05 #3

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

Similar topics

0
1299
by: J. Muenchbourg | last post by:
I'm cannot seem to get my request objects posted from a form on a previous page to show up on the page I'm posting to. When I try it locally on my IIS webserver, it works fine. But the form posting does not seem to work when I do it live (on Windows 2000). Below is the series of statements I'm using. <%' QUERY POST stuff dim req if request("DBCode") = "LY-YrToDate" or request("DBCode") = "YrToDate" then
1
3821
by: Phil Amey | last post by:
In a web based form I am able to make sure that there is text in an input field but I want to restrict the user from using such characters as ~ # & ' How can I modify this JavaScript below to enable this ? if (document.form1.ProjectTitle.value == ""){ alert("Please complete the Project Title: field") document.form1.ProjectTitle.focus() validFlag = false return validFlag
66
4150
by: Cor | last post by:
Hi, I start a new thread about a discussion from yesterday (or for some of us this morning). It was a not so nice discussion about dynamically removing controls from a panel or what ever. It started by an example from me, that was far from complete and with typing errors, but basically it had the meaning to show that removing controls reversible was the nicest method. This was a lets say conclusion (but what is that in a newsgroup) in a...
2
4887
by: Milsnips | last post by:
hi there, i have the following HTML code: -------------------------- <asp:DropDownList id="hddList" runat="server"> <asp:ListItem Value="1">Item 1</asp:ListItem> <asp:ListItem Value="2">Item 2</asp:ListItem> <asp:ListItem Value="3">Item 3</asp:ListItem> <asp:ListItem Value="4">Item 4</asp:ListItem> <asp:ListItem Value="5">Item 5</asp:ListItem>
3
1315
by: Nathan Sokalski | last post by:
I am having trouble removing cookies that I created with my site. Here is the code I am using to try and remove them: If Not Request.Cookies("username") Is Nothing Then Response.Cookies.Remove("username") If Not Request.Cookies("password") Is Nothing Then Response.Cookies.Remove("password")
6
19351
by: saif.shakeel | last post by:
Hi, Suppose i have a string stored in variable,how do i remove the space between them,like if i have the name: "USDT request" in a variable.i need "USDTrequest",without any space . Thanks
5
6138
by: chromis | last post by:
Hi there, I've recently been updating a site to use locking on application level variables, and I am trying to use a commonly used method which copies the application struct into the request scope. Application variables are then accessed in this manner Request.App.<Var>. To begin with I had a simple functioning login system inside a subdirectory named admin, this subdirectory had it's own application.cfm, I wasn't sure whether to duplicate...
7
4693
by: ADN | last post by:
Hi, I am creating a custom HTTPModule to intercept the request of when the user is attempting to retrieve a session variable. For instance, if I set a session variable in my code like so: session = "Hello World"; When the request for that session variable "myString" is attempted to be retrieved, I would like to intercept that request like so: if (Request is for session variable "myString")
14
6415
by: doublestack | last post by:
I am calling a variable from an aspx page (LOGON_USER) into a url and need to remove the special character "\" so the user can be logged in correctly. I am using: <script type="text/javascript"> location.replace("http://testsite.com:1001/forms/html/testinstance.html?vsuccess=" + "<%=Request.ServerVariables%>","iframe1"); </script>
0
9706
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
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10577
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...
1
10320
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
10077
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4299
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2991
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.