[VB.NET] Problème de logique?
alors la je ne comprends pas pourquoi ca ne marche pas :s
c'est juste une page de test ou je test lorsque je coche la checkbox il met en readonly les textbox sinon a true
et un "reset" dans le bouton valider
rien que ca et ca ne marche pas, pourtant j'ai beau relire mon code, tout me parait logique
voici le code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents lbl_login As System.Web.UI.WebControls.Label
Protected WithEvents Image1 As System.Web.UI.WebControls.Image
Protected WithEvents txtbx_login As System.Web.UI.WebControls.TextBox
Protected WithEvents lbl_pwd As System.Web.UI.WebControls.Label
Protected WithEvents txtbx_pwd As System.Web.UI.WebControls.TextBox
Protected WithEvents btn_valider_login As System.Web.UI.WebControls.Button
Protected WithEvents chckbx_visiteur As System.Web.UI.WebControls.CheckBox
Dim uid As String
Dim pwd As String
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
Private Sub chckbx_visiteur_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chckbx_visiteur.CheckedChanged
If chckbx_visiteur.Checked = True Then
txtbx_login.ReadOnly = True
txtbx_pwd.ReadOnly = True
uid = "visiteur"
pwd = "visiteur"
'appel page postlogin_1 (celle qui va tester les logins) avec en envoi uid et pwd
Else
txtbx_login.ReadOnly = False
txtbx_pwd.ReadOnly = False
End If
End Sub
Private Sub btn_valider_login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_valider_login.Click
'appel de la page postlogin avec 2 parametres (uid et pwd)
txtbx_login.Text = ""
txtbx_pwd.Text = ""
uid = txtbx_login.Text
'pwd = passwordField.???
'call...
End Sub |
merci bien a vous