473,396 Members | 1,748 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.

Visual Studio Beginner with question

Hello,
I am a php programmer moving over to ASP.NET, VS and C#. I am having a few
problems getting started. I have everything installed and running, it is
more or less figuring out how to do simple things.

I have a test form called webform1 with one field on it for a first name. I
am trying to figure out how to post this info to webform2 and display the
field value on webform2 in a label. In php and HTML all I had to do was put
webform2 in the action property of the form of webform1 and on post, access
the post var by $HTTP_POST_VARS["firstname"].

I figured out how to pass the value over to the other page via query string.
But if I had a form with 30 fields on it this would get tiresome. I just
need some guidance as to what I need to do to accomplish this simple task so
I can continue learning. I have been stuck on this for days and can not find
a tutorial online that goes beyond posting to the same page (i.e: webform1
posts info to webform1).

So I basically need to know how to pass a form's values to another page and
then access those variables on the next page(not the same page) within
Visual Studio (C#).
Thank you for any help in this.
Nov 16 '05 #1
1 1291
"tripwater" <ts****@sonador.com> wrote in message
news:u2**************@TK2MSFTNGP09.phx.gbl...

It works almost identically in ASP.NET.

Set the action of webform1 to point to webform2.
Within the <form></form> tags on webform1, create a text input field and
give it an ID of txtFirstName
Also create a submit button

Within the <form></form> tags on webform2, create an <asp:Label> field, give
it an ID of lblFirstName, and set its Runat property to "server"

In the code behind webform2 define a label variable:
protected Label lblFirstName;

In the Page_Load event of webform2, populate the Text property of
lblFirstName
lblFirstName.Text = Request.Form["txtFirstName"];
Nov 16 '05 #2

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

Similar topics

1
by: angelag | last post by:
I am currently taking a college course in Visual Basic.Net and I am a beginner. I bought Visual Studio.Net 2003 to do my homework at home. I built my first project and e-mailed it to myself at...
4
by: IS | last post by:
At the recommendation of several people in this newsgroup I have downloaded two or three Compilers. One is the Beta version of Microsoft's Visual C++ 2005. I have entered a complete beginner code...
2
by: zatenay | last post by:
Hey, I'm a beginner with Visual Studio and C++, so I've the following problem : when I run a program with Debug-Start without debugging command, I can't see the output, so I have to run it...
9
by: Trevor | last post by:
I am just learning c# and I have a book entitled "Programming c#" O'Reilly. It strongly recommends Visual .Net. Can anyone enlighten me on their experiences of SDK versus Visual ..Net?
3
by: mph140 | last post by:
Hi, I wonder if someone can help me with this beginner's question. When I add a web referenece to my C# projecct - using Add Web Reference - local machine. where and how does VS search and...
3
by: RS | last post by:
Hi all, My code compiles well with gcc on linux and OS X, but now I have to run it at work, and my only choice is Visual Studio .Net 2003 environment on windows, which I had never used before....
8
by: HELLO $$$ | last post by:
To those who are familiar to MS Visual studio : I have recently Visual Studio 2005. Please can any body tells me , when I write a code: How can I separate the files of such code from the Studio...
4
by: Keith Russell | last post by:
Hi, everyone. I have done a variety of programming in the past in several (mostly older) languages. I also worked for a couple of years about 5 years ago programming in Visual C 6. I have...
6
by: raylopez99 | last post by:
Will ASP.NET 3.0 work under Visual Studio 2005? And what is a good newbie ASP.NET book? Subject: Will ASP.NET 3.0 work under Visual Studio 2005? And what is a good newbie ASP.NET book? My...
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
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:
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
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,...

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.