473,405 Members | 2,404 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,405 software developers and data experts.

Passing value from one form to another

Hi,

I need to pass a value from one Web Form to another. In Form #1 I have set up a web control (hyperlink) that in its "Transfer" property contains the name of the Web Form to be loaded. How can I read the listIndex of a Listbox in Form #1 when the Form#2 is loaded?

Thanks

Mike
Nov 18 '05 #1
4 1542
You can make a public property on Form #1 which reads it and returns it. Or, why not just pass it as a request item to Form#2?
"Mike" <no****@nospam.com> wrote in message news:us*************@tk2msftngp13.phx.gbl...
Hi,

I need to pass a value from one Web Form to another. In Form #1 I have set up a web control (hyperlink) that in its "Transfer" property contains the name of the Web Form to be loaded. How can I read the listIndex of a Listbox in Form #1 when the Form#2 is loaded?

Thanks

Mike
Nov 18 '05 #2
When another form loads, the first one's gone. No public property, nothing. Whatever you want to pass, you should put either into the request or session variables.

Eliyahu
"Rick Spiewak" <ri*********@mindspring.com> wrote in message news:uQ**************@TK2MSFTNGP09.phx.gbl...
You can make a public property on Form #1 which reads it and returns it. Or, why not just pass it as a request item to Form#2?
"Mike" <no****@nospam.com> wrote in message news:us*************@tk2msftngp13.phx.gbl...
Hi,

I need to pass a value from one Web Form to another. In Form #1 I have set up a web control (hyperlink) that in its "Transfer" property contains the name of the Web Form to be loaded. How can I read the listIndex of a Listbox in Form #1 when the Form#2 is loaded?

Thanks

Mike
Nov 18 '05 #3
On Mon, 12 Jul 2004 14:36:16 +0200 in
microsoft.public.dotnet.framework.aspnet, "Mike" <no****@nospam.com>
wrote:
Hi,

I need to pass a value from one Web Form to another. In Form #1 I have set up a web control (hyperlink) that in its "Transfer" property contains the name of the Web Form to be loaded. How can I read the listIndex of a Listbox in Form #1 when the Form#2 is loaded?


Why not use Session variables?

Form1:
Session.Add("MyValue", "123");
// load form 2

Form2:
void Page_Load(object sender, System.EventArgs e)
{
string myval = Session["MyValue"].ToString();
}

Roger
Nov 18 '05 #4
Check out this faq,
http://www.extremeexperts.com/Net/FA...tInASPNET.aspx

--
Saravana
Microsoft MVP - ASP.NET
www.extremeexperts.com

"Mike" <no****@nospam.com> wrote in message news:us*************@tk2msftngp13.phx.gbl...
Hi,

I need to pass a value from one Web Form to another. In Form #1 I have set up a web control (hyperlink) that in its "Transfer" property contains the name of the Web Form to be loaded. How can I read the listIndex of a Listbox in Form #1 when the Form#2 is loaded?

Thanks

Mike
Nov 18 '05 #5

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

Similar topics

2
by: Richard | last post by:
**** Post for FREE via your newsreader at post.usenet.com **** HI, I am working on a project where I need to input data to a (local) HTML page using multiple form elements, such as text,...
3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
1
by: Al Jans | last post by:
Hi, I'm having a problem passing a value from a field on one form to another field on another form. The value is being passed between forms, however it's not being displayed and i've got no idea...
8
by: Johnny | last post by:
I'm a rookie at C# and OO so please don't laugh! I have a form (fclsTaxCalculator) that contains a text box (tboxZipCode) containing a zip code. The user can enter a zip code in the text box and...
3
by: michael | last post by:
let me keep it clean, quick and simple. I am passing a variable into another window and am reassigning the value on the new page - window.document...value = opener.document. ....value and...
13
by: Deano | last post by:
Apparently you can only do this with one value i.e Call MyAssetLocationZoom(Me!txtLocation, "Amend data") This runs; Public Sub MyAssetLocationZoom(ctl As Control, formName As String) On...
7
by: AMP | last post by:
Hello, I have this in form1: namespace Pass { public partial class Form1 : Form { public Form2 form2; public Form1() {
9
by: itarizin | last post by:
Today I found as ignorance owe me.. Let me explain what I'm tring to do and fail (fail: in my needs) For example, I've my stupid class: public class Hello { private int x = 0; public...
4
idsanjeev
by: idsanjeev | last post by:
SIR I AM PASSING VALUE FROM ONE FORM TO ANOTHER FORM THROUGH COOKIES BUT IS CAN ONLY TRANSFER LAST VALUE HOW CAN PASS VALUE AFTER CLICKIN ON LINK I AM USING THE CODE IS FOR LINK <td><a...
4
by: John Sheppard | last post by:
Hello there I was wondering if anyone could help me, I am trying to pass a typed dataset to a dialoged child form by reference. I have binding sources sitting on the child form. So to refresh...
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
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
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
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.