Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. HTML Login Controls help!

HTML Login Controls help!

Scheduled Pinned Locked Moved ASP.NET
databasecsharphelphtmlasp-net
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Necron8
    wrote on last edited by
    #1

    Hello there people I'm working on an ASP.NET website using C# code on VS 2005. My problem is that when using the Login controls like the Registration Form, Login Control, Login Status, Change Password, etc, I don't want the project to create a .mdf file. So, I made a connection string in the web.config file to use my SQL Server 2005 database. The problem is how could I make this kind of registration type of site? I've tried searching tutorials but with no success. I want the site to be able to handle registrations and logins using my SQL Server 2005 database Website type is: Shopping Cart. Problems I'm encountering: 1. I need to know how to use login controls using an SQL Database which is not created automatically. 2. I need to know hot to tackle permissions, like I have the main site to be available to non-registered users and registered users but I don't want anyone to access the Administration site. File Structure: Folder -> Administration Admin.aspx UserList.aspx Folder -> App_Code (to store the code of the cart/other functions Code.aspx Folder -> App_Data (not used because I want to use an external Database) Folder -> App_Themes (to store stylesheets) Folder -> Images to store all the images Folder -> Catalog (contains the products cathegories) Folder -> Login Login.aspx Register.aspx ChangePW.aspx RecoverPW.aspx RecoverPWConfirmation.aspx Default.aspx MasterPage.master Admin.master I'm Using two master pages, one for the whole site, and one for the administration. I want to use the main login with a hard coded admin privileged user in the database to access the administration and no-one else. My DB has a table named user Permission where it has the PermissionID(PK)(1, 2), PermissionType(User/Admin) and have a table named Clients with the Client ID(PK), Name, Surname, PermissionID(FK) So far this is the code I used for the Web.Config File

    S A T 3 Replies Last reply
    0
    • N Necron8

      Hello there people I'm working on an ASP.NET website using C# code on VS 2005. My problem is that when using the Login controls like the Registration Form, Login Control, Login Status, Change Password, etc, I don't want the project to create a .mdf file. So, I made a connection string in the web.config file to use my SQL Server 2005 database. The problem is how could I make this kind of registration type of site? I've tried searching tutorials but with no success. I want the site to be able to handle registrations and logins using my SQL Server 2005 database Website type is: Shopping Cart. Problems I'm encountering: 1. I need to know how to use login controls using an SQL Database which is not created automatically. 2. I need to know hot to tackle permissions, like I have the main site to be available to non-registered users and registered users but I don't want anyone to access the Administration site. File Structure: Folder -> Administration Admin.aspx UserList.aspx Folder -> App_Code (to store the code of the cart/other functions Code.aspx Folder -> App_Data (not used because I want to use an external Database) Folder -> App_Themes (to store stylesheets) Folder -> Images to store all the images Folder -> Catalog (contains the products cathegories) Folder -> Login Login.aspx Register.aspx ChangePW.aspx RecoverPW.aspx RecoverPWConfirmation.aspx Default.aspx MasterPage.master Admin.master I'm Using two master pages, one for the whole site, and one for the administration. I want to use the main login with a hard coded admin privileged user in the database to access the administration and no-one else. My DB has a table named user Permission where it has the PermissionID(PK)(1, 2), PermissionType(User/Admin) and have a table named Clients with the Client ID(PK), Name, Surname, PermissionID(FK) So far this is the code I used for the Web.Config File

      S Offline
      S Offline
      Stein The Ruler
      wrote on last edited by
      #2

      Hi there! I've just been doing the same thing as you and ended up with creating my own registration system. Mostly because thats what I'm used to from the days of standard ASP and include files. Basically I created an object called SessionContainer that I store in a session variable which contains a bool value that tells me if the current user is logged in or not (IsSignedIn). This container also contains the signed in user (if signed in). I then created a object that inherits from System.Web.UI.Page and all the pages in my sites inherits this object. And the object has a public property so I can access the SessionContainer. So in your administration pages you can just check IsSignedIn, if false then redirect to something else.. And yeah I got two master pages, one named defaultMaster (for non-secure pages) and another nested masterpage named secureMaster. secureMaster checks the level of security for the current page (None, ReadOnly or Restricted). So I can set the level of security on each page.. Some pages I let the user read but not write and some pages are off-limit to non-signed in users. You dont need two different masterpages, but I needed some design changes in the secure pages so I ended up with this solution. Sorry for the poorly description, but maybe you get the idea. If not I could easily create a little project for you to look at and play with.. Just let me know and I'll throw something together. I'm not saying that my way is the only way, but it works :)

      N 1 Reply Last reply
      0
      • N Necron8

        Hello there people I'm working on an ASP.NET website using C# code on VS 2005. My problem is that when using the Login controls like the Registration Form, Login Control, Login Status, Change Password, etc, I don't want the project to create a .mdf file. So, I made a connection string in the web.config file to use my SQL Server 2005 database. The problem is how could I make this kind of registration type of site? I've tried searching tutorials but with no success. I want the site to be able to handle registrations and logins using my SQL Server 2005 database Website type is: Shopping Cart. Problems I'm encountering: 1. I need to know how to use login controls using an SQL Database which is not created automatically. 2. I need to know hot to tackle permissions, like I have the main site to be available to non-registered users and registered users but I don't want anyone to access the Administration site. File Structure: Folder -> Administration Admin.aspx UserList.aspx Folder -> App_Code (to store the code of the cart/other functions Code.aspx Folder -> App_Data (not used because I want to use an external Database) Folder -> App_Themes (to store stylesheets) Folder -> Images to store all the images Folder -> Catalog (contains the products cathegories) Folder -> Login Login.aspx Register.aspx ChangePW.aspx RecoverPW.aspx RecoverPWConfirmation.aspx Default.aspx MasterPage.master Admin.master I'm Using two master pages, one for the whole site, and one for the administration. I want to use the main login with a hard coded admin privileged user in the database to access the administration and no-one else. My DB has a table named user Permission where it has the PermissionID(PK)(1, 2), PermissionType(User/Admin) and have a table named Clients with the Client ID(PK), Name, Surname, PermissionID(FK) So far this is the code I used for the Web.Config File

        A Offline
        A Offline
        Abhijit Jana
        wrote on last edited by
        #3

        Did you every look at your question after posting, that how it is look like ?

        cheers, Abhijit CodeProject MVP

        1 Reply Last reply
        0
        • S Stein The Ruler

          Hi there! I've just been doing the same thing as you and ended up with creating my own registration system. Mostly because thats what I'm used to from the days of standard ASP and include files. Basically I created an object called SessionContainer that I store in a session variable which contains a bool value that tells me if the current user is logged in or not (IsSignedIn). This container also contains the signed in user (if signed in). I then created a object that inherits from System.Web.UI.Page and all the pages in my sites inherits this object. And the object has a public property so I can access the SessionContainer. So in your administration pages you can just check IsSignedIn, if false then redirect to something else.. And yeah I got two master pages, one named defaultMaster (for non-secure pages) and another nested masterpage named secureMaster. secureMaster checks the level of security for the current page (None, ReadOnly or Restricted). So I can set the level of security on each page.. Some pages I let the user read but not write and some pages are off-limit to non-signed in users. You dont need two different masterpages, but I needed some design changes in the secure pages so I ended up with this solution. Sorry for the poorly description, but maybe you get the idea. If not I could easily create a little project for you to look at and play with.. Just let me know and I'll throw something together. I'm not saying that my way is the only way, but it works :)

          N Offline
          N Offline
          Necron8
          wrote on last edited by
          #4

          Yes I get the idea, so I make my custom controls using textboxes/labels/buttons etc to connect to my database. So that's problem solved. Second prob which is of administration. so I add a field to the client table as IsLoggedIn (as bool - Yes/No) and make a session. Now do I have to create the session in the master page? And how should i create it? Also another idea is: For the administration page, while the user logs in, I check for the username and password the client has together with his permission. If the username and password match, the user is logged in as a normal registered user (if permission is User). If the username and password entered are in the database and his permission is Admin, he is redirected to the Admin page. Is that a secure solution or? If you could send me some sample small login with the session please do so. I'm not requesting the whole code, just a sample so as to help me make this type of feature in my website. Thanks! I thank you for the help and for administrators, sorry that I've made my question too long. Thanks!

          1 Reply Last reply
          0
          • N Necron8

            Hello there people I'm working on an ASP.NET website using C# code on VS 2005. My problem is that when using the Login controls like the Registration Form, Login Control, Login Status, Change Password, etc, I don't want the project to create a .mdf file. So, I made a connection string in the web.config file to use my SQL Server 2005 database. The problem is how could I make this kind of registration type of site? I've tried searching tutorials but with no success. I want the site to be able to handle registrations and logins using my SQL Server 2005 database Website type is: Shopping Cart. Problems I'm encountering: 1. I need to know how to use login controls using an SQL Database which is not created automatically. 2. I need to know hot to tackle permissions, like I have the main site to be available to non-registered users and registered users but I don't want anyone to access the Administration site. File Structure: Folder -> Administration Admin.aspx UserList.aspx Folder -> App_Code (to store the code of the cart/other functions Code.aspx Folder -> App_Data (not used because I want to use an external Database) Folder -> App_Themes (to store stylesheets) Folder -> Images to store all the images Folder -> Catalog (contains the products cathegories) Folder -> Login Login.aspx Register.aspx ChangePW.aspx RecoverPW.aspx RecoverPWConfirmation.aspx Default.aspx MasterPage.master Admin.master I'm Using two master pages, one for the whole site, and one for the administration. I want to use the main login with a hard coded admin privileged user in the database to access the administration and no-one else. My DB has a table named user Permission where it has the PermissionID(PK)(1, 2), PermissionType(User/Admin) and have a table named Clients with the Client ID(PK), Name, Surname, PermissionID(FK) So far this is the code I used for the Web.Config File

            T Offline
            T Offline
            tech603
            wrote on last edited by
            #5

            You can easily use ASP Membership with a SQL database. You were on the right track by updating the web.config with a connection string to the sql server. The only step you need to take after that is running aspnet_regsql.exe . This file is located in C:\Windows\Microsoft.net\Framework\v2.0.... When you run the aspent_regsql.exe it will bring up a wizard that allows asks you for your database server and login credentials. This will create all the necessary tables you need for ASP.Net Memberships in your database. After that you should be good to go. Also this msdn link is very helfuull http://msdn.microsoft.com/en-us/library/879kf95c(VS.80).aspx[^] Hope that helps.

            Matthew Vass QA Analyst mvass@hostmysite.com HostMySite.com

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups