Question Locked

asp.net code behind ?

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Dear Colleagues:

I want to separate interface design from its code (in my asp.net school project). So that , I'm trying to use a code-behind using vb.net. For example in my login page I provide the user with username and password input, then handle the user input from lgoin.vb file. But I don't know how to get the values of textbox that are placed in login.aspx file.

How Can access these username and password textbox values in the login.vb code to check the user input. To give u some idea about my code, just see the following simple code:

************************
login.aspx
************************

<%@ page Inherits ="class1" scf="lgoin.vb"%>

************************
login.vb
************************
Imports Microsoft.VisualBasic
Imports system.Web
Imports system.Web.UI
Imports system.Web.UI.Control
Imports system.Web.UI.HtmlControls

Public Class Class1
Inherits Page

Sub button_click(ByVal s As Object, ByVal e As EventArgs)
'based on the the user input(username and passward)
' I want to redirect the users to different pages
' if txtpass.text= "x" and txtuname="something" then

'Response.Redirect("x.aspx")
'else
'Response.Redirect("y.aspx")
End Sub
End Class
************************
As u have seen from the code I commented some lines on login.vb file. This is because I can't access the txtuname and txtpass textboxes from lgoin.vb.

Please help me how can I do that

Regards,

Ben

2 replies

This discussion is closed to new replies.