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

Passing values between forms

(Type your message here)
Hi
I'm new to asp.net and I need some help
I have three forms with some textboxes.I want to pass the values of the textboxes of form1 and form2 to the third form
For this I'm using in the first form
System.Web.HttpContext.Current.Server.Transfer("se condform.aspx")
also a get function for returning the values of textbox
In the second form
rp1 = CType(context.Current.Handler, firstform)
RegisterHiddenField("txtpjcode", Request("txtpjcode"))
similarly for the second form
But When I run this I can't retrive any values of previous forms

--------------------------------
From: Mani P.S

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>vrL66fQqLUe3kVkG/raHIA==</Id>
Nov 19 '05 #1
2 1773
Hi,

see this in MSDN
http://msdn.microsoft.com/library/de...formspages.asp

HTH
Regards

Joyjit

"Mani P.S via .NET 247" <an*******@dotnet247.com> wrote in message
news:u1**************@TK2MSFTNGP14.phx.gbl...
(Type your message here)
Hi
I'm new to asp.net and I need some help
I have three forms with some textboxes.I want to pass the values of the textboxes of form1 and form2 to the third form For this I'm using in the first form
System.Web.HttpContext.Current.Server.Transfer("se condform.aspx")
also a get function for returning the values of textbox
In the second form
rp1 = CType(context.Current.Handler, firstform)
RegisterHiddenField("txtpjcode", Request("txtpjcode"))
similarly for the second form
But When I run this I can't retrive any values of previous forms

--------------------------------
From: Mani P.S

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>vrL66fQqLUe3kVkG/raHIA==</Id>

Nov 19 '05 #2
Here's a nice, simple way to pass values from one page to another:
(VB.NET code)

'Add data to the context object before transferring
Context.Items("myParameter") = x
Server.Transfer("WebForm2.aspx")

Then, in WebForm2.aspx:

'Grab data from the context property
Dim x as Integer = CType(Context.Items("myParameter"),Integer)

Of course there are a number of ways to pass values from one page to
another, such as using the querystring, cookies, session,
context, saving to a temporary table in the database between each page, etc.
You'll have to decide which technique is best for your application.
Here are several good articles on the subject to help you decide.
http://msdn.microsoft.com/msdnmag/is...e/default.aspx

http://www.aspalliance.com/kenc/passval.aspx

http://www.dotnetbips.com/displayarticle.aspx?id=79

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Mani P.S via .NET 247" <an*******@dotnet247.com> wrote in message
news:u1**************@TK2MSFTNGP14.phx.gbl...
(Type your message here)
Hi
I'm new to asp.net and I need some help
I have three forms with some textboxes.I want to pass the values of the
textboxes of form1 and form2 to the third form
For this I'm using in the first form
System.Web.HttpContext.Current.Server.Transfer("se condform.aspx")
also a get function for returning the values of textbox
In the second form
rp1 = CType(context.Current.Handler, firstform)
RegisterHiddenField("txtpjcode", Request("txtpjcode"))
similarly for the second form
But When I run this I can't retrive any values of previous forms

--------------------------------
From: Mani P.S

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>vrL66fQqLUe3kVkG/raHIA==</Id>

Nov 19 '05 #3

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

Similar topics

4
by: rick | last post by:
Does anyone having a working example of passing values between web forms pages? I tried the example in the ms- help but I can't get by the following: To read property values from the source...
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...
0
by: Neelima Godugu | last post by:
Hi All, I have developed a windows forms user control, which I am going to host in Internet Explorer.. I am familiar with the security settings requirement inorder to do the above. I have...
1
by: Dave Harris | last post by:
I am a raw newbie to VB.NET trying to convert a data processing QuickBasic program into .NET. I have about 14 forms, the first of which has a bank of radio buttons identifying the airline. The...
2
by: o1j2m3 | last post by:
I created 2 forms, A and B using VB.NET 2003 in A, the codes are : ========================== public AsName as string public AsPrice as double public sub setValue(ByVal sname as string,...
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...
3
by: Ross McLean | last post by:
Hi all, I've been teaching myself C# for a new project at work. I have a bit of a background in c++ and java but never been what you could call a guru. I'm having some strange things happening...
6
by: olsongt | last post by:
I have a C# problem I've been struggling with for a week now. I can't figure it out. I've made a sample application to demonstrate my problem: how do I pass data between forms? I've read tons of...
3
by: vidhyapriya | last post by:
Hi all I am developing windows application using vb.net.I want to pass values to open form.I am opening only one form when user click the buttons several times.Useing delegate i am passing...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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...
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,...

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.