Urgent! Passing Variables - Website Using Visual Studio 2005
Hello,
I'm practicing creating a website for a test, although I am having trouble passing varialbes between the webpage with which the user logs in, and the web page in which the user sees/amends their details (it's an online bank).
Basically, I want the user to enter their customer ID and password, then click on the 'Login' button. When the user clicks on this, I want to display their details based upon their login info (ie their own, and nobody else's bank details).
To pass variables, i've tried using a method that I had used for my coursework:
Code:
Dim f2 As FirstWebPage f2 = New FirstWebPage f2.Owner = Me f2.ShowDialog()
On the webpage that will allow the user to see their bank details and change PIN number, I have tried this code:
Code:
Dim f1 As FirstWebPage f1 = Me.Owner accountID = f1.accountID cardNumber = f1.cardNumber
I'm getting absolutely nowhere, although i'm not sure whether this is down to the fact that asp is involved.
Thanks
Re: Urgent! Passing Variables - Website Using Visual Studio 2005
Hey,
How are you authenticating the users? Are you using the ASP.Net Membership Provider?
It would appear that you are trying to use concepts from a Windows Form application, and this won't work in the Web World.
For passing variables around you need to look into things like:
- Session Variables
- Cookies
- Application Variables
- web.config files
- the ASP.Net Profile Provider
I would suggest you maybe details exactly what you are trying to achieve, and people may be able to help you.
Is this a homework assignment by the way? If it is, you should be up front about it. People here will be willing to help you, provided you show some effort, but they won't write it for you.
Gary
Re: Urgent! Passing Variables - Website Using Visual Studio 2005
ASP.NET != windows forms.
You cannot showdialog a web page, the web page has to be requested. When the user logs in, if they are successfully authenticated, store the username or userid in a session variable. Redirect the user to page2. On page2, check the value in the session variable and use that when querying the database.