|
-
Mar 10th, 2006, 09:00 AM
#1
[RESOLVED] On Focus...
I have a Login teextbox and I want it to be populated with "Please enter username" or such upon the page loading, no issues there. But when the user tabs or clicks into the textbox I want it to clear the text so its ready for entry. I didnt find anything on a quick search so is there some event that I am missing that I can use for this?
The textbox control does not have a GotFocus event os I am unsure on this.
Thanks
Last edited by RobDog888; Mar 11th, 2006 at 04:28 AM.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 10th, 2006, 09:09 AM
#2
Re: On Focus...
That is a client side event, You will have to use Javascript to do that.
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Mar 10th, 2006, 09:10 AM
#3
Re: On Focus...
Not GotFocus. It's onFocus.
In the onFocus event, call a client side javascript method that first compares the text in that textbox with 'Please enter username'. If they match, then set the textbox's value to an empty string. Else, let it be.
-
Mar 10th, 2006, 09:15 AM
#4
Re: On Focus...
I suppose I should create an external js file for all the js code that will be coming in the days ahead.
Do you have an outline of the js event? I hate js. Should I pass the control name and its value to the procedure that is going to be called? or can it be done some other way?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 10th, 2006, 09:17 AM
#5
Re: On Focus...
And In case you just too lazy to write the function here is an example
Code:
<asp:TextBox id="TextBox1" runat="server" value = "Please Enter Username" onFocus = "changeVal()"></asp:TextBox>
<script type="text/javascript" language="JavaScript">
function changeVal() {
if (document.Form1.TextBox1.value == "Please Enter Username")
document.Form1.TextBox1.value = "";
}
</script>
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Mar 10th, 2006, 09:22 AM
#6
Re: On Focus...
JS is quite loose. Shuja's shown you how to do this. In the case of this particular function, you wouldn't pass the control's name because it's just a matter of ONE control being processed. If it were a whole bunch of controls, you would pass 'this' as an argument.
Adding it to a .JS file is your discretion. You may want to start by having it on the same page itself at first and then move it all out later.
Look out for case sensitivity. It can invoke hours of debugging time.
-
Mar 10th, 2006, 09:23 AM
#7
Re: On Focus...
 Originally Posted by RobDog888
I suppose I should create an external js file for all the js code that will be coming in the days ahead.
You can put all Javascript in an external js file. Looks like a big ASP project is going on.
 Originally Posted by RobDog888
Do you have an outline of the js event? I hate js.
Now is the time that you start loving it.
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Mar 10th, 2006, 09:31 AM
#8
Re: On Focus...
YES I have a large site to develop and I know just enough HTML/CSS to get by but I only did one small static site so far using asp.net. I want to learn it well. 
The event doesnt seem to be firing 
Btw, Thanks for the help so far guys. I will be posting many threads over the next week 
VB Code:
<td style="BORDER-RIGHT: #b22222 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #b22222 1px solid; WIDTH: 140px; FONT-FAMILY: Verdana, Arial; ALIGN: center"
vAlign="top" align="center" bgColor="#eeeeee"><asp:textbox id="txtUsername" BackColor="#cccccc" style="FONT-SIZE: 12px; COLOR: #b22222" runat="server"
Width="110" value="Enter UserName" onFocus="changeVal()></asp:textbox>
<script type="text/javascript" language="JavaScript">
function changeVal() {
if (document.Form1.txtUsername.value == "Enter Username")
document.Form1.txtUsername.value = "";
}
</script>
</td>
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 10th, 2006, 09:36 AM
#9
Re: On Focus...
Take a look at your code, you are setting the value to Enter UserName and then in the event you are checking for Enter Username
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Mar 10th, 2006, 09:37 AM
#10
Re: On Focus...
w00t w00t! I'm an ASP.NET programmer now 
It was a stupid missing doublequote from the atuomatic formatting that the ide does. Also found that when it did fire it wasnt matching. I guess its case sensitive?
I didnt know you could place the js code in there that way.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 10th, 2006, 09:45 AM
#11
Re: [RESOLVED] On Focus...
One more question...
When I click on the submit button I have it redirect to "#" for testing. When this happens the postback repopulates the login textbox.
VB Code:
Private Sub btnLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLogin.Click
Response.Redirect("#")
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 10th, 2006, 09:50 AM
#12
Re: [RESOLVED] On Focus...
Thats because ASP.NET has a different State Management that classic ASP. Read about state management on MSDN.
If you want this should not happen then set EnableViewState of the control to False.
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Mar 10th, 2006, 09:52 AM
#13
Re: [RESOLVED] On Focus...
Ok, thanks. I'll look it up.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 10th, 2006, 10:16 AM
#14
Re: [RESOLVED] On Focus...
I tried setting it to false in the page_load but if i type in a username and submit, it repopulates it with "Enter UserName"
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 10th, 2006, 10:20 AM
#15
Re: On Focus... Still 1 more issue
You must be calling a function in the body onload that populates that textbox. Instead of calling the function in body load, send a call to it to the output using Page.RegisterStartupScript.
In your page load event:
VB Code:
If Not Page.IsPostBack
Page.RegisterStartupScript("myscript","nameofthefunction();")
End If
-
Mar 10th, 2006, 10:27 AM
#16
Re: On Focus... Still 1 more issue
I did this in the page_load event procedure
VB Code:
If Page.IsPostBack = False Then
Me.txtUsername.Text = "Enter UserName"
End If
Me.txtUsername.EnableViewState() = False
It appears to work but I wont be 1000% until I finish creating the db and writting the login code.
Does this look correct now? I did have the textbox being populated in the aspx element tag in the html section.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 10th, 2006, 10:29 AM
#17
Re: On Focus... Still 1 more issue
-
Mar 10th, 2006, 10:51 AM
#18
Re: On Focus... Still 1 more issue
Thanks
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 10th, 2006, 03:14 PM
#19
Re: [RESOLVED] On Focus... Still 1 more issue
Actually if you had done your response.redirect to the name of the page "default.aspx" for example, it would not have retained the settings.
When you redirect to an anchor, it instead of redirecting the page just sends the browser a different URL, but maintains state. It does this to help, not hinder, your coding.
Just letting you know that you just killed the proverbial fly with an elephant gun.
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
-
Mar 10th, 2006, 04:57 PM
#20
Re: [RESOLVED] On Focus... Still 1 more issue
Well I like overkill but I just dont have a second page to redirect to yet. I'll test it out with a dummy page.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 10th, 2006, 05:05 PM
#21
Re: [RESOLVED] On Focus... Still 1 more issue
the second page I speak of is the same page.
Lets say the "test" page was called "test.aspx" then what I was saying is instead of redirecting to "#" you redirect to "test.aspx" (which is the same page).
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
-
Mar 10th, 2006, 05:12 PM
#22
Re: [RESOLVED] On Focus... Still 1 more issue
I'm still new to asp.net but I did redirect to the same page and it didnt retain the login name I used. It repopulated it with the "Enter UserName" again. Is this what you meant?
When it goes to a secondary page it shouldnt be populated at all since they will already be logged in.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 11th, 2006, 03:27 AM
#23
Re: On Focus... Still 1 more issue
Ok, related issue still here. The login txtUserName textbox contents should be added to the User_Name session variable but its not retaining or able to even be placed into a label control. 
VB Code:
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
'Login code
If Session.SessionID Is Nothing Then
'code to alert or redirect to login in again
Response.Redirect("index.aspx")
End If
If Session.Item("sesUser_Name") = Nothing Then
Session.Add("sesUser_Name", "RobDog888")
End If
If Page.IsPostBack = False Then
Me.txtUsername.Text = "Enter UserName"
End If
Me.txtUsername.EnableViewState() = False
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 11th, 2006, 03:36 AM
#24
Re: On Focus... Still 1 more issue
Maybe you left it out accidentally but it does not look like you are inserting the contents of the sesson variable anyway 
Something like:
VB Code:
If Session.Item("sesUser_Name") = Nothing Then
Session.Add("sesUser_Name", "RobDog888")
Else
If Page.IsPostBack = False Then
Me.txtUsername.Text = "Enter UserName"
Else
Me.txtUsername.Text = Session.Item("sesUser_Name")
end if
end if
?
-
Mar 11th, 2006, 03:45 AM
#25
Re: On Focus... Still 1 more issue
Sorry, forgot to post the btnLogin click code. RobDog888 was a test. Like a temp guest user id.
VB Code:
Private Sub btnLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLogin.Click
If Session.Item("User_Name") Is Nothing Then
Session.Add("User_Name", Me.txtUsername.Text)
End If
Me.lblUserName.Text = Session.Item("User_Name").ToString 'THIS IS NOT POULATING MY LABEL :(
Session.Timeout = 15
'...
End Sub
Btw, thats a really nice looking forums site in your sig. vBull 3.5
Last edited by RobDog888; Mar 11th, 2006 at 03:48 AM.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 11th, 2006, 03:53 AM
#26
Re: On Focus... Still 1 more issue
is btnLogin your submit button? If so I recommend placing that code in the page load event. Check if you have a username posted and if so add it as a session variable. Elseif check if a session variable is already present and if so place it in the text box.
Then again, I could just be showing my ignorance of ASP.NET. Sorry
-
Mar 11th, 2006, 04:06 AM
#27
Re: On Focus... Still 1 more issue
This is the home page so to be able to login only once and access the secured pages it needs to check on the page load for if they just refresh or renav to the home page after they already logged in. Now if they havent logged in at all then the pageload will not have a txtUserName content to load into the session var. It needs to ignore the "Enter UserName" auto text htat I had populated in the js in the html for the page as shown by Shuja Alis posted code.
So it seems that when the postback happens it doesnt pickup the session var.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 11th, 2006, 04:12 AM
#28
Re: On Focus... Still 1 more issue
w00t, got it. It was the stupid Session.SessionID check that was throwing it off. This now retains the uisername (without any verification of login yet) and populates a label control with the username and starts the session timeout of 15 minutes and redirects with SSL. 
VB Code:
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
If Session.Item("User_Name") = Nothing Then
Session.Add("User_Name", "Guest")
End If
If Page.IsPostBack = False Then
Me.txtUsername.Text = "Enter UserName"
End If
Me.txtUsername.EnableViewState() = False
End Sub
Private Sub btnLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLogin.Click
If Session.Item("User_Name") Is Nothing Then
Session.Add("User_Name", Me.txtUsername.Text)
End If
Me.lblUserName.Text = Session.Item("User_Name").ToString
Session.Timeout = 15
Response.Redirect("https://secure.blah.com")
End Sub
Now I just need to clear the txtUserName box and clear the lblUserName upon page load to take out the control name thats in it by default.
another step closer.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 11th, 2006, 04:18 AM
#29
Re: On Focus... Still 1 more issue
Glad to not be of assistance
-
Mar 11th, 2006, 04:28 AM
#30
Re: On Focus... Still 1 more issue
But a second set of eyes is always a help. I noticed that when you reposted my code my sesUser_Name var was named differently then it was in the btnLogin clck event. 
Now I am multi-tasking and in the middle of creating the users sql table.
Thanks everyone
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 11th, 2006, 06:02 AM
#31
-
Mar 11th, 2006, 03:58 PM
#32
Re: [RESOLVED] On Focus...
Thanks but unfortunately I am a noob at asp.net so its going to take some time. 
Ps, I have 5 or 6 hours left to finish the entire login and security part.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|