|
-
Oct 29th, 2006, 10:58 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] Login
hi, well i was just trying asp.net 2.0 , i've created a login and sign up form using the tools from the toolbox. and when the user login i'm made the login form to go to a member page. my problem is that even the user is not login he still can access the memer website, and me i don't want him to see the member webpage if he is not signed in. can someone help me how do i fix this???
tanks
-
Oct 29th, 2006, 04:13 PM
#2
Re: Login
Sis you add any code to identify if a member was logged in? Its not automatic. Maybe create a session variable of the logged in user and just validate upon the page load of every page. If not logged in redirect to your login 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 
-
Oct 31st, 2006, 11:29 AM
#3
Re: Login
I just completed the walkthrough on using Memberships and the new Login controls. It suggests putting all your "member pages" in their own folder. Using the ASP Configuration tool, you create an "Access Rule" for the folder. The "access rule" is created in the following web.config file (for that folder)
Code:
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</configuration>
If someone tries to access the member pages without logging in they are automatically redirected to the login page. I
-
Oct 31st, 2006, 12:57 PM
#4
Re: Login
But you also need to add the allowed users in your cofig file -
<allow users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
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 
-
Oct 31st, 2006, 02:30 PM
#5
Thread Starter
Frenzied Member
Re: Login
well i the user that will be allowed are those who are signed in so what do i have to type??
-
Oct 31st, 2006, 02:33 PM
#6
Thread Starter
Frenzied Member
Re: Login
well the user that will be allowed to suref the menber area are those who are signed in so what do i have to type??
-
Nov 1st, 2006, 12:28 AM
#7
Re: Login
But you also need to add the allowed users in your config file -
I know I am new to ASP.Net but those lines are not in my Web.Config file and for me every thing is working.
-
Nov 1st, 2006, 12:06 PM
#8
Re: Login
Its just another level of granularity. You can deny all or allo the specified.
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 
-
Nov 1st, 2006, 12:11 PM
#9
Thread Starter
Frenzied Member
Re: Login
ok, what about this ? will this work ? on the login form
and on the menber page :
VB Code:
<%
if session("logged_in")=0 then
response.redirect("www.av.com")
end if
%>
<html>
<head>
-
Nov 1st, 2006, 12:20 PM
#10
Re: Login
Yes for the most part. You need to test for the session var being created already before setting a value to it.
Login page:
VB Code:
Protected Sub btnLogin(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.Trim)
Else
'Already logged in and re-viewing the login page.
'Handle as you desire - force a re-login or autologin etc.
End If
'...
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 
-
Nov 1st, 2006, 12:29 PM
#11
Re: [RESOLVED] Login
I havent usedthe asp tags for before the html tag for verification of the login. I usually just eval it in the page load. Does it work that way to eval the session variable?
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
|