TextBox.text not showing in code behind
-
I have a simple login form that uses a master page. Im having a weird problem where when the login button is clicked the code behind cannot see the txtUserName.Text The text box html is The code behind is Dim currentUser As New DAL.AppUser currentUser = currentUser.AuthenticateUser(txtUsername.Text, txtPassword.Text) If currentUser.AppUserId > 0 Then .... When I set a breakpoint at currentUser =... I see txtPassword.Text value but txtUsername.Text shows "" even though it is filled. I checked that its view state is enabled. Tried deleting it and re-adding. Very weird. Has anyone ever had this problem?
-
I have a simple login form that uses a master page. Im having a weird problem where when the login button is clicked the code behind cannot see the txtUserName.Text The text box html is The code behind is Dim currentUser As New DAL.AppUser currentUser = currentUser.AuthenticateUser(txtUsername.Text, txtPassword.Text) If currentUser.AppUserId > 0 Then .... When I set a breakpoint at currentUser =... I see txtPassword.Text value but txtUsername.Text shows "" even though it is filled. I checked that its view state is enabled. Tried deleting it and re-adding. Very weird. Has anyone ever had this problem?
-
I have a simple login form that uses a master page. Im having a weird problem where when the login button is clicked the code behind cannot see the txtUserName.Text The text box html is The code behind is Dim currentUser As New DAL.AppUser currentUser = currentUser.AuthenticateUser(txtUsername.Text, txtPassword.Text) If currentUser.AppUserId > 0 Then .... When I set a breakpoint at currentUser =... I see txtPassword.Text value but txtUsername.Text shows "" even though it is filled. I checked that its view state is enabled. Tried deleting it and re-adding. Very weird. Has anyone ever had this problem?
Dim currentUser As New DAL.AppUser currentUser = currentUser.AuthenticateUser(txtUsername.Text, txtPassword.Text) If currentUser.AppUserId > 0 Then ===================================== where is this in the code behind? is this on page load? or page init? when the page is submit and then loads those text boxes will be blank when the code goes for them. also when you step through the application and you go one step past the txtUsername, what is the value then? is it still "" for currentUser?
----------------------------------------------------------- "When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
-
Dim currentUser As New DAL.AppUser currentUser = currentUser.AuthenticateUser(txtUsername.Text, txtPassword.Text) If currentUser.AppUserId > 0 Then ===================================== where is this in the code behind? is this on page load? or page init? when the page is submit and then loads those text boxes will be blank when the code goes for them. also when you step through the application and you go one step past the txtUsername, what is the value then? is it still "" for currentUser?
----------------------------------------------------------- "When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
-
if i had to guess it's because the page is posting back to itself when "login" is clicked and then you're code to collect the information is processing after the post back. otherwise...i have no idea :(
----------------------------------------------------------- "When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
-
I have a simple login form that uses a master page. Im having a weird problem where when the login button is clicked the code behind cannot see the txtUserName.Text The text box html is The code behind is Dim currentUser As New DAL.AppUser currentUser = currentUser.AuthenticateUser(txtUsername.Text, txtPassword.Text) If currentUser.AppUserId > 0 Then .... When I set a breakpoint at currentUser =... I see txtPassword.Text value but txtUsername.Text shows "" even though it is filled. I checked that its view state is enabled. Tried deleting it and re-adding. Very weird. Has anyone ever had this problem?
I think it's asp:TextBox, does the other one work with this capitalisation ? Do you have code that sets the username value anywhere, such as page_load ?
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
if i had to guess it's because the page is posting back to itself when "login" is clicked and then you're code to collect the information is processing after the post back. otherwise...i have no idea :(
----------------------------------------------------------- "When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
I tried setting AutoPostBack to true and setting a string var on the txtUesrName_TextCahnged event but it show TxtUsrName.Text as NULL also so I am pissed at this point. Its a copy of another site that works fine. It must be some corruption in the asp page.
-
I think it's asp:TextBox, does the other one work with this capitalisation ? Do you have code that sets the username value anywhere, such as page_load ?
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )