Basically I've been developing a system in VB.NET that uses a database back end and I've been messing around with the database, connecting dynamically using my own random code, pulling out the info I need and displaying it in DataGridView objects and textboxes, and then allowing the users to write back to the database and update it whenever they want to change some content. It's taken me a few weeks to get the whole system working, and now it is and I'm most happy, and I figured it might be quite neat to develop a smaller version of the system using ASP.NET instead. Obviously a lot of the code is similar, but there's a few things I just have no clue how to do and I know if I can get the basics working the actual hard parts won't be that hard, since they're all so similar to VB.NET, right?
So here's the problem:
In VB.NET I can use a basic form to enter a username and a password, validate the username and password match the database, and then hide the form and launch a new form, passing it the username, and displaying all the personal details of that user. That's basically the bit I want to recreate using ASP.NET, only I have no clue how to launch a new page as it's completely different (obviously) to VB.NET.
The VB.NET equivalent of what I'm looking for is this:
Form: login.vb
Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click
Dim username, password, tempUser, tempPass As String
Dim loopNo, maxLoop As Integer
Dim ds As New DataSet
username = txtUser.Text
password = txtPass.Text
ds = DatabaseConnections.getDataSet("SELECT userID, userPassword FROM tblUsers", "tblUsers")
maxLoop = ds.Tables("tblUsers").Rows.Count - 1
For loopNo = 0 To maxLoop
tempUser = ds.Tables("tblUsers").Rows(loopNo).Item("userID")
tempPass = ds.Tables("tblUsers").Rows(loopNo).Item("userPassword").ToString
If tempUser = username And tempPass = password Then
Dim myDetails As New DetailsForm
myDetails.Show()
myDetails.loadDetails(username)
Me.Hide()
End If
Next
End Sub
Then the DetailsForm form has a basic class in that's something like "Public Sub loadDetails(ByVal userID As String)" and I go from there. The problem is I have absolutely no clue how to do something similar to ASP.NET. I can obviously write the methods just fine, since they're exactly the same as VB.NET, but for actually creating a new instance of the form, and launching it in the same window, and firing up the method I want to use (which, the plan was, would just be loadDetails(ByVal userID As String) again) I have no clue what to do.
So yeah, ASP.NET newbie, if anybody wants to save me a whole bunch of time and tell me how to do the same basic plan in ASP as in VB I'd love them forever, and buy them a cookie or something.


Help
This topic is locked
MultiQuote









