473,606 Members | 2,877 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pass an additionnal HTTP parameter while using Server.Transfer

Hi all,

I have an "EditeItem.aspx " page which lets me edit properties of an "Item".
In the OnClick() event of my Save button, I do save Item changes to the
database and then I redirect the user to the Item page "ViewItem.a spx" with
a simple :

Server.Transfer ("ViewItem.aspx ");

I'd like to pass another HTTP parameter so that in the "ViewItem.a spx" page,
I am able to know that the user comes from the "EditItem.aspx" . Here's what
I'd like to do :

Request.QuerySt ring.Add("Refre shMenu", "1"); // <-- Raises an
exception
Server.Transfer ("ViewItem.aspx ");

Indeed, QueryString (or Form, or Params) are read-only collection and
therefore, it raises an exception. How can I pass an addtionnal HTTP
parameter ?

Thanks in advance !

Julien C.
Nov 18 '05 #1
5 7814
Seb
Hi Julien,

Server.Transfer ("ViewItem.aspx ?source=EditIte m.aspx");

Cheers
Seb
-----Original Message-----
Hi all,

I have an "EditeItem.aspx " page which lets me edit properties of an "Item".In the OnClick() event of my Save button, I do save Item changes to thedatabase and then I redirect the user to the Item page "ViewItem.a spx" witha simple :

Server.Transfer ("ViewItem.aspx ");

I'd like to pass another HTTP parameter so that in the "ViewItem.a spx" page,I am able to know that the user comes from the "EditItem.aspx" . Here's whatI'd like to do :

Request.QuerySt ring.Add("Refre shMenu", "1"); // <-- Raises anexception
Server.Transfer ("ViewItem.aspx ");

Indeed, QueryString (or Form, or Params) are read-only collection andtherefore, it raises an exception. How can I pass an addtionnal HTTPparameter ?

Thanks in advance !

Julien C.
.

Nov 18 '05 #2
Hi Seb,

I already tried and it doesn't work !
Thanks anyway !

Julien C.

"Seb" <an*******@disc ussions.microso ft.com> a écrit dans le message de
news:06******** *************** *****@phx.gbl.. .
Hi Julien,

Server.Transfer ("ViewItem.aspx ?source=EditIte m.aspx");

Cheers
Seb
-----Original Message-----
Hi all,

I have an "EditeItem.aspx " page which lets me edit

properties of an "Item".
In the OnClick() event of my Save button, I do save Item

changes to the
database and then I redirect the user to the Item

page "ViewItem.a spx" with
a simple :

Server.Transfer ("ViewItem.aspx ");

I'd like to pass another HTTP parameter so that in

the "ViewItem.a spx" page,
I am able to know that the user comes from

the "EditItem.aspx" . Here's what
I'd like to do :

Request.QuerySt ring.Add("Refre shMenu", "1"); //

<-- Raises an
exception
Server.Transfer ("ViewItem.aspx ");

Indeed, QueryString (or Form, or Params) are read-only

collection and
therefore, it raises an exception. How can I pass an

addtionnal HTTP
parameter ?

Thanks in advance !

Julien C.
.

Nov 18 '05 #3
Should work!

How do you read the parameter?
string source = Request.Params["source"];

If not ok:
try
Response.Redire ct(url);
instead of
Server.Transfer (url);
Seb
-----Original Message-----
Hi Seb,

I already tried and it doesn't work !
Thanks anyway !

Julien C.

"Seb" <an*******@disc ussions.microso ft.com> a écrit dans le message denews:06******* *************** ******@phx.gbl. ..
Hi Julien,

Server.Transfer ("ViewItem.aspx ?source=EditIte m.aspx");

Cheers
Seb
>-----Original Message-----
>Hi all,
>
>I have an "EditeItem.aspx " page which lets me edit

properties of an "Item".
>In the OnClick() event of my Save button, I do save
Item changes to the
>database and then I redirect the user to the Item

page "ViewItem.a spx" with
>a simple :
>
> Server.Transfer ("ViewItem.aspx ");
>
>I'd like to pass another HTTP parameter so that in

the "ViewItem.a spx" page,
>I am able to know that the user comes from

the "EditItem.aspx" . Here's what
>I'd like to do :
>
> Request.QuerySt ring.Add
("RefreshMen u", "1"); // <-- Raises an
>exception
> Server.Transfer ("ViewItem.aspx ");
>
>Indeed, QueryString (or Form, or Params) are read-only

collection and
>therefore, it raises an exception. How can I pass an

addtionnal HTTP
>parameter ?
>
>Thanks in advance !
>
>Julien C.
>
>
>.
>

.

Nov 18 '05 #4
Yep,

I read the parameter with : string source = Request.Params["source"];

I don't want to use Response.Redire ct() since it involves another roundtrip.
The interest of Server.Transfer () was that it happens entirely on the
server.

I'd really like to do this using Server.Transfer ()

Julien C.

<an*******@disc ussions.microso ft.com> a écrit dans le message de
news:07******** *************** *****@phx.gbl.. .
Should work!

How do you read the parameter?
string source = Request.Params["source"];

If not ok:
try
Response.Redire ct(url);
instead of
Server.Transfer (url);
Seb
-----Original Message-----
Hi Seb,

I already tried and it doesn't work !
Thanks anyway !

Julien C.

"Seb" <an*******@disc ussions.microso ft.com> a écrit dans le message denews:06******* *************** ******@phx.gbl. ..
Hi Julien,

Server.Transfer ("ViewItem.aspx ?source=EditIte m.aspx");

Cheers
Seb
>-----Original Message-----
>Hi all,
>
>I have an "EditeItem.aspx " page which lets me edit

properties of an "Item".
>In the OnClick() event of my Save button, I do save
Item changes to the
>database and then I redirect the user to the Item

page "ViewItem.a spx" with
>a simple :
>
> Server.Transfer ("ViewItem.aspx ");
>
>I'd like to pass another HTTP parameter so that in

the "ViewItem.a spx" page,
>I am able to know that the user comes from

the "EditItem.aspx" . Here's what
>I'd like to do :
>
> Request.QuerySt ring.Add
("RefreshMen u", "1"); // <-- Raises an
>exception
> Server.Transfer ("ViewItem.aspx ");
>
>Indeed, QueryString (or Form, or Params) are read-only

collection and
>therefore, it raises an exception. How can I pass an

addtionnal HTTP
>parameter ?
>
>Thanks in advance !
>
>Julien C.
>
>
>.
>

.

Nov 18 '05 #5
You could use a session variable.

In this particular case, I would still use Response.Redire ct as you want to
say to the browser to point to another location (with Server.Transfer the
browser will still show the "old" URL).

IMO, Server.Transfer is rather for those who have processing only pages. It
allows then to transfer the control to a processing only page easily server
side, before perhaps a final redirect to let the browser point to anotehr
final web page (rather than to have several redirects).

Patrice

--

"Julien C." <ch******@hotma il.com> a écrit dans le message de
news:et******** ******@tk2msftn gp13.phx.gbl...
Yep,

I read the parameter with : string source = Request.Params["source"];

I don't want to use Response.Redire ct() since it involves another roundtrip. The interest of Server.Transfer () was that it happens entirely on the
server.

I'd really like to do this using Server.Transfer ()

Julien C.

<an*******@disc ussions.microso ft.com> a écrit dans le message de
news:07******** *************** *****@phx.gbl.. .
Should work!

How do you read the parameter?
string source = Request.Params["source"];

If not ok:
try
Response.Redire ct(url);
instead of
Server.Transfer (url);
Seb
-----Original Message-----
Hi Seb,

I already tried and it doesn't work !
Thanks anyway !

Julien C.

"Seb" <an*******@disc ussions.microso ft.com> a écrit dans

le message de
news:06******* *************** ******@phx.gbl. ..
Hi Julien,

Server.Transfer ("ViewItem.aspx ?source=EditIte m.aspx");

Cheers
Seb
>-----Original Message-----
>Hi all,
>
>I have an "EditeItem.aspx " page which lets me edit
properties of an "Item".
>In the OnClick() event of my Save button, I do save Item changes to the
>database and then I redirect the user to the Item
page "ViewItem.a spx" with
>a simple :
>
> Server.Transfer ("ViewItem.aspx ");
>
>I'd like to pass another HTTP parameter so that in
the "ViewItem.a spx" page,
>I am able to know that the user comes from
the "EditItem.aspx" . Here's what
>I'd like to do :
>
> Request.QuerySt ring.Add ("RefreshMen u", "1"); // <-- Raises an
>exception
> Server.Transfer ("ViewItem.aspx ");
>
>Indeed, QueryString (or Form, or Params) are read-only
collection and
>therefore, it raises an exception. How can I pass an
addtionnal HTTP
>parameter ?
>
>Thanks in advance !
>
>Julien C.
>
>
>.
>

.



Nov 18 '05 #6

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

Similar topics

7
21605
by: Zlatko Matiæ | last post by:
Let's assume that we have a database on some SQL server (let it be MS SQL Server) and that we want to execute some parameterized query as a pass.through query. How can we pass parameters to the server ? Is it possible to use parameters in pass-through queries ? An additional question: Is it possible to connect to a database on MySQL or PostgreSQL using ADO ? Is it possible to execute pass-through queries with parameters, using ADO...
0
3313
by: Zlatko Matiæ | last post by:
Hi everybody! Recently I was struggling with client/server issues in MS Access/PostgreSQL combination. Although Access is intuitive and easy to use desktop database solution, many problems appear when someone is trying to use it as front-end for real server database systems such as PostgreSQL or MySQL. One of these problems is regarding pass-through queries and parameters. I wanted to have all the code on client, while executing it on...
5
3743
by: Fresh Air Rider | last post by:
Hello Could anyone please explain how I can pass more than one arguement/parameter value to a function using <asp:linkbutton> or is this a major shortfall of the language ? Consider the following code fragments in which I want to list through all files on a directory with a link to download each file by passing a filename and whether or not to force the download dialog box to appear.
3
1875
by: JezB | last post by:
I know I can use the querystring mechanism to pass simple parameters to a Page using Response.Redirect, but Im having problems getting this to work using Server.Transfer or Server.Execute - is this by design ? What is a simple alternative for passing optional parameters to a Page using Server.Transfer or Server.Execute? I don't want to store a session variable and check that in the called page - too flaky.
9
1960
by: Paul | last post by:
What I am trying to do is as follows. I have a page with 3 links,that direct the user to 3 different pages when selected after login. So all link selections will first direct the user to a login page. Once the user logs in then they are directed to the appropriate link. So for all 3 links they all go to a login page, but each link must pass information to the login in page, specifically the page to go to after login takes place. -- Paul G...
5
2868
by: Apollo0130 | last post by:
hi, i want to pass a parameter (a string) between two forms. i have a Webform A (default.aspx) with a button and a Webform B (detail.aspx). i want to click the button and open the webform B with the parameter submitted from the webform A. how can i do that? greetz Apollo0130
3
1739
by: hugo.flores | last post by:
Hello all. I want to know what would be the best way to pass information between pages in ASP.NET? Querystring, seession variables, server transfer? If possible if anyone can list advantages/disadvantages of each, or any good/bad experience using one against the others. Thanks
17
7064
by: Rabbit | last post by:
Hi, On my 1st page, i have a function which gets a new ID value and need to transfer to another immediately. which I want to get in 2nd page using Request.form("txtID"), but doesn't work, the returned value is "" Anybody know how to set this value on 1st page properly, in order to let 2nd page catch it? I don't want to use querystring to pass this value!
3
1283
by: David C | last post by:
With .NET 1.x, this is what I did. On the destination page public class ToWebForm : System.Web.UI.Page { public const string PARAMETER = "PARAM"; protected void Page_Load(object sender, System.EventArgs e) { if (!IsPostBack) { string paramFromAnotherPage = Context.Items.ToString();
0
8031
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
7962
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
8456
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
8107
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
8315
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...
1
5971
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
5467
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
3945
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.