473,396 Members | 1,923 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,396 software developers and data experts.

sending data between two pages

Hi all,

I have two aspx pages, first one has a listbox and a button that opens popup
aspx page. Popup page has listbox control ,
so what i want to do is when I close the popup , the datas in popup's
listbox will be sent to listbox of first aspx page,
Any ideas ?

Best regards...
Nov 19 '05 #1
1 1565
Ugar,

There are three common ways to do this:

1) Place the value to pass in the query string:
http://www.mysite.com/page2.aspx?value=[yourvaluehere]
Retrieve in page 2:
Dim ValueToRetrieve As String = Request.Querystring("value")

2) Place the value in a session variable:
In page 1:
Session.Items.Add("ValueToPass", [YourValueAsObjectHere])

In page 2:

Dim ValueToRetrieve As String =
Session.Items.Item("ValueToPass").ToString

3) Store the value in the context object and then use Server.Transfer to to
change pages.
In page 1:
Context.Items.Add("ValueToPass", [YourValueAsObjectHere])
Server.Transfer("Page2.aspx")

In page 2:
Dim ValueToRetrieve As String =
Context.Items.Item("ValueToPass").ToString

Of course you can pass any type of object in examples 2 and 3 but only
singular objects like a string or int in example 1. Also example 2 requires
a redirect be sent to the client browser in order to change pages while
example 3 does not.

In example 3 a Server.Transfer delivers page2 code to the client even though
the client thinks it's getting pag1 code. What that means is that the client
will still have page1.aspx in the addresss bar even though they will be
seeing page2.aspx. But that won't affect your code. And the client sees your
page faster because the redirect is skipped.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Ugur Ekinci" <ug**@argeset.com> wrote in message
news:ON**************@TK2MSFTNGP14.phx.gbl...
Hi all,

I have two aspx pages, first one has a listbox and a button that opens
popup aspx page. Popup page has listbox control ,
so what i want to do is when I close the popup , the datas in popup's
listbox will be sent to listbox of first aspx page,
Any ideas ?

Best regards...

Nov 19 '05 #2

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

Similar topics

16
by: Jochen Daum | last post by:
Hi! I have a function in a lot of pages, which redirects to a new page, if a form has been submitted: if (!(defined("DEBUG_INSERT") && DEBUG_INSERT) && !(defined("DEBUG_UPDATE") &&...
1
by: coder_1024 | last post by:
I'm trying to send a packet of binary data to a UDP server. If I send a text string, it works fine. If I attempt to send binary data, it sends a UDP packet with 0 bytes of data (just the...
5
by: vanisathish | last post by:
Hi All, I need to constantly update some values to the User Interface. In order to do the updation efficiently, i am planning to run some script in the server side that constantly keeps sending...
5
by: Naveen Mukkelli | last post by:
Hi, I'm writing a server applicaiton using C# and .NET Framework. This server sends out time to all the clients. The clients are expected to be written in various platforms for example, Delphi,...
4
by: yaron | last post by:
Hi, I have a problem when sending data over TCP socket from c# client to java server. the connection established ok, but i can't send data from c# client to java server. it's work ok with...
7
by: tshad | last post by:
I have been sending messages to myself from work that worked before and now all of my message only seem to be sending part of my messages. I get the first part of the message and then get...
9
by: Miro | last post by:
VB 2003 at the end of the code, this works great. bytCommand = Encoding.ASCII.GetBytes("testing hello send text") udpClient.Send(bytCommand, bytCommand.Length) and this recieves it Dim...
3
by: phpmike | last post by:
I have a simple form and would like the data sent to two different pages. Actually I only need the data sent to one page and the user sent to another page. For example user is at page1.php (which...
5
by: hurricane_number_one | last post by:
I am creating a simple server application, that will listen for incoming mouse coordinates and then move the mouse accordingly. So basically it's like a very simple VNC server without and screen...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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,...

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.