473,466 Members | 1,326 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

View ASP .NET variable values in C#

I have a form that sends data to another .aspx page.

In the second .aspx I have this code to retrieve the form's values and
create sessions:

Application("Login") = Request.Form("txtLogin") Application("Password")
= Request.Form("pwdPassword")

I need to validate this values with the C# code I use to connect to the DB2
database.

Is it possible to access the Request.Form("txtLogin") value from the C#
code?

Thanks
Nov 18 '05 #1
5 1676
Not clear. Don't you alreay use Request.fomr to retrive this value. Also
once you stored these values in application variables they are available
from anywhere. NOTE that I would put this rather in session as application
variables are shared by all sessions and this could result in a problem if
multiple users are logging at the same time (you could also use a
"sessionid" so that you can connect later using an application specific
account).

Actually my personal preference is to post data to the same page so that a
single page handles the whole process...

Patrice

--

"Antoni Massó Mola" <am****@triliumsoftware.com> a écrit dans le message de
news:eI**************@tk2msftngp13.phx.gbl...
I have a form that sends data to another .aspx page.

In the second .aspx I have this code to retrieve the form's values and
create sessions:

Application("Login") = Request.Form("txtLogin") Application("Password") = Request.Form("pwdPassword")

I need to validate this values with the C# code I use to connect to the DB2 database.

Is it possible to access the Request.Form("txtLogin") value from the C#
code?

Thanks


Nov 18 '05 #2
Not sure what you are asking. Just do something like "string myVariable =
Request.Form(...)".

"Antoni Massó Mola" <am****@triliumsoftware.com> wrote in message
news:eI**************@tk2msftngp13.phx.gbl...
I have a form that sends data to another .aspx page.

In the second .aspx I have this code to retrieve the form's values and
create sessions:

Application("Login") = Request.Form("txtLogin") Application("Password") = Request.Form("pwdPassword")

I need to validate this values with the C# code I use to connect to the DB2 database.

Is it possible to access the Request.Form("txtLogin") value from the C#
code?

Thanks

Nov 18 '05 #3
Thanks for the comments.

I found what I was looking for:

strLogin = Request.Form["txtLogin"]
strPassword = Request.Form["pwdPassword"]

Patrice, I'll post data in the same page, better idea than using two
different pages.

What do you mean with putting it in sessions? Many users will connect to
this web page and I need to maintain their user name in a session variable,
which is the best way to acheive this?

Thanks
"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Not sure what you are asking. Just do something like "string myVariable =
Request.Form(...)".

"Antoni Massó Mola" <am****@triliumsoftware.com> wrote in message
news:eI**************@tk2msftngp13.phx.gbl...
I have a form that sends data to another .aspx page.

In the second .aspx I have this code to retrieve the form's values and
create sessions:

Application("Login") = Request.Form("txtLogin")

Application("Password")
= Request.Form("pwdPassword")

I need to validate this values with the C# code I use to connect to the

DB2
database.

Is it possible to access the Request.Form("txtLogin") value from the C#
code?

Thanks


Nov 18 '05 #4
I meant that storing them in the Application object as shown in the
pseudo-code you posted fisrt, is not a good idea, as its values are shared
by all users (ie this is the same value for all users).
If you want to maintain a value that is unique to each user it is best to
keep it in the Session object (each user having its own set of session
variables).

It looks like each user will connect to the DB2 database using its own
login. Another option is to use a single account to connect all users and to
handle rights at the application level (using the same connection allows to
benefit from connection pooling).

Patrice
--

"Antoni Massó Mola" <am****@triliumsoftware.com> a écrit dans le message de
news:Ol*************@tk2msftngp13.phx.gbl...
Thanks for the comments.

I found what I was looking for:

strLogin = Request.Form["txtLogin"]
strPassword = Request.Form["pwdPassword"]

Patrice, I'll post data in the same page, better idea than using two
different pages.

What do you mean with putting it in sessions? Many users will connect to
this web page and I need to maintain their user name in a session variable, which is the best way to acheive this?

Thanks
"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Not sure what you are asking. Just do something like "string myVariable = Request.Form(...)".

"Antoni Massó Mola" <am****@triliumsoftware.com> wrote in message
news:eI**************@tk2msftngp13.phx.gbl...
I have a form that sends data to another .aspx page.

In the second .aspx I have this code to retrieve the form's values and
create sessions:

Application("Login") = Request.Form("txtLogin")

Application("Password")
= Request.Form("pwdPassword")

I need to validate this values with the C# code I use to connect to the
DB2
database.

Is it possible to access the Request.Form("txtLogin") value from the

C# code?

Thanks




Nov 18 '05 #5
Thanks!

"Patrice Scribe" <no****@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I meant that storing them in the Application object as shown in the
pseudo-code you posted fisrt, is not a good idea, as its values are shared
by all users (ie this is the same value for all users).
If you want to maintain a value that is unique to each user it is best to
keep it in the Session object (each user having its own set of session
variables).

It looks like each user will connect to the DB2 database using its own
login. Another option is to use a single account to connect all users and to handle rights at the application level (using the same connection allows to benefit from connection pooling).

Patrice
--

"Antoni Massó Mola" <am****@triliumsoftware.com> a écrit dans le message de news:Ol*************@tk2msftngp13.phx.gbl...
Thanks for the comments.

I found what I was looking for:

strLogin = Request.Form["txtLogin"]
strPassword = Request.Form["pwdPassword"]

Patrice, I'll post data in the same page, better idea than using two
different pages.

What do you mean with putting it in sessions? Many users will connect to
this web page and I need to maintain their user name in a session variable,
which is the best way to acheive this?

Thanks
"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Not sure what you are asking. Just do something like "string myVariable =
Request.Form(...)".

"Antoni Massó Mola" <am****@triliumsoftware.com> wrote in message
news:eI**************@tk2msftngp13.phx.gbl...
> I have a form that sends data to another .aspx page.
>
> In the second .aspx I have this code to retrieve the form's values
and > create sessions:
>
> Application("Login") = Request.Form("txtLogin")
Application("Password")
> = Request.Form("pwdPassword")
>
> I need to validate this values with the C# code I use to connect to

the DB2
> database.
>
> Is it possible to access the Request.Form("txtLogin") value from the C# > code?
>
> Thanks
>
>


Nov 18 '05 #6

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

Similar topics

13
by: Droolboy | last post by:
I'm trying to build a fairly small (max. 10 different pages) site using php, and it's becoming obvious that I need some kind of model view separation. Having done a few searches, I've come...
2
by: Hennie de Nooijer | last post by:
Because of an error in google or underlying site i can reply on my own issue. Therefore i copied the former entered message in this message....
3
by: brendan_gallagher_2001 | last post by:
Hi, I have a view(A) and I am trying to do a join on another table (B) to include only rows where date values in view A is greater than in table B. I also want the view to pick up rows in viewA...
4
by: stacdab | last post by:
We have a partitioned view with 4 underlying tables. The view and each of the underlying tables are in seperate databases on the same server. Inserts and deletes on the view work fine. We then...
3
by: V T | last post by:
Hello all, SQL Server 2000 documentation http://www.microsoft.com/technet/prodtechnol/sql/2000/reskit/part10/c3761.mspx states that if view is using "NOT NULL" columns of a base table, then...
4
by: john | last post by:
Is it possible, for learning purposes, to show the values of an array? Something like: arMyArray.view()? I tried MsgBox (arMyArray) but that (obviously) doesn't work. Thanks, john
1
by: Matik | last post by:
Hey, First, sorry if this post appear twice, because, I can not find my post recently send, trying to post it once again. I'm out of ideas, so, I thought, will search help here again :( I'm...
12
by: brwalias | last post by:
Hi, using .net 2 sql server 2005 Here is my situation: I'm passing a variable in the url from a selection on Page A and need to display the results on the Results page be based on that...
3
by: mckbill | last post by:
Is there a way I can direct the cursor to a specific field (variable) in a form by typing the field name while in form view? I have a form with many fields, and it would be nice if there were...
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,...
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.