Passing values to a Web Page

  • Thread starter Thread starter Fabrizio
  • Start date Start date
F

Fabrizio

HI,
i need to pass a value from a Web Page to another in
ASP.NET, eg. i want to keep the user name from a login
page and diplay to next page . What should I use?
Thanks,
fabrizio
 
Well, If you're using asp .NET controls (ie a webform
with a <form... runat="server"> in it, then the asp form
handles all that for you, and stores the values of the
form fields in their related variables on the code page.

If you're just donig it with an ordinary .asp page, then
yuo have two choices-- You can get the login name on a
<form>, and then send it to the called page either using
<form method="post"> to send it in the http header, or
<form method="get"> to send it as part of the url. the
action"..." attribute of the form tag will determine what
page is called, and on that asp page, you then chek the
contents of the request.forms object for the variable.

I may have a couple of the class / object names a little
off here, but basically that's how you do it. If you're
real new to asp .NET, you might want to donwload
the "IBUYSPY" example web. It's in VB though I think. It
is to asp .NET what Northwind is to SQL server and
Access. I hope that helps!

JIM
 
Hi Fabrizio,

Just as Jim said, you can use either the feature of Asp.net page or use
ordinary "post" or "get" way.
After you login, I think you can keep the information of certain user
during operation through session.
And you also can keep the application scope status in application variables.
The article below tells you how to use session and application object in
asp.net:
http://msdn.microsoft.com/msdnmag/issues/01/11/cutting/default.aspx
http://msdn.microsoft.com/msdnmag/issues/01/12/cutting/default.aspx

Hope this helps,
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "Fabrizio" <[email protected]>
| Sender: "Fabrizio" <[email protected]>
| Subject: Passing values to a Web Page
| Date: Tue, 18 Nov 2003 12:36:27 -0800
| Lines: 6
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcOuE6PscTBNJ9dWQ+q4K1zzx9cnYQ==
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:200283
| NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| HI,
| i need to pass a value from a Web Page to another in
| ASP.NET, eg. i want to keep the user name from a login
| page and diplay to next page . What should I use?
| Thanks,
| fabrizio
|
 
Back
Top