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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Creating Custom Providers

Creating Custom Providers

Scheduled Pinned Locked Moved ASP.NET
databasequestiontutorialcsharpasp-net
2 Posts 2 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.
  • S Offline
    S Offline
    Skoder
    wrote on last edited by
    #1

    Hi, I am trying to create my own custom providers. I am using the Microsoft SQL providers as refference. What i want to do is to make a set of providers which works with my own database schema. Key points to my changes is that GUID will be replaced with an incremental Int for Primary key / Id, and i want my code to be based on the id fields instead of a username (which is currently how it works). I have read the documentation for the Membership and Profile Providers. In the Sql Profile provider from Microsoft the GetPropertyValues and SetPropertyValues methods are the central part, they both have an Input parameter of type SettingsContext which contains Username (username or userId according to documentation) and IsAuthenticated. How do I make it "contain" the UserID instead of Username ? Is there anyway to control what is in the SettingsContext collection ? As far as I see it, it will never contain the UserID (or at least i dont know how to make it contain the userid), but probably it will contain the random generated username for an anonymous user. But please let me know how to make it use the userId as mentioned in the documentation. Will I ever be able to make this work or am i better of creating something to "stand-alone" which isnt intended to be used in the provider model ? If it is not recommended to create new providers, can anyone recommend an approach to creating my own "framework" for controlling users/login and such. I was thinking of creating something very similar. Is there some way I can register a class (maybe in the webconfig) which will run when asp.net is running, like etc. the Profile provider soo i dont have to create a new instance on every page load (and get connection string and such, but which is loaded first time it starts (asp.net/iis) and then ready for use/access all the time). Is there any security issues i will need to think about ? I was wondering how the build in Membership system stores if a user is logged in or not. Is the username or userid just saved in a session variable ? I am also thinking about if i make my own framework is there any way to make it work with the existing panels or will i have to create new panels ? (for an example to determine content to show the user if the user is logged-in or not and if the user if one role or another), and what about the way you can control access to your website through the webconfig by specifying which roles have access. Is it possible to make my own "framework" work together with this ? Hope som

    J 1 Reply Last reply
    0
    • S Skoder

      Hi, I am trying to create my own custom providers. I am using the Microsoft SQL providers as refference. What i want to do is to make a set of providers which works with my own database schema. Key points to my changes is that GUID will be replaced with an incremental Int for Primary key / Id, and i want my code to be based on the id fields instead of a username (which is currently how it works). I have read the documentation for the Membership and Profile Providers. In the Sql Profile provider from Microsoft the GetPropertyValues and SetPropertyValues methods are the central part, they both have an Input parameter of type SettingsContext which contains Username (username or userId according to documentation) and IsAuthenticated. How do I make it "contain" the UserID instead of Username ? Is there anyway to control what is in the SettingsContext collection ? As far as I see it, it will never contain the UserID (or at least i dont know how to make it contain the userid), but probably it will contain the random generated username for an anonymous user. But please let me know how to make it use the userId as mentioned in the documentation. Will I ever be able to make this work or am i better of creating something to "stand-alone" which isnt intended to be used in the provider model ? If it is not recommended to create new providers, can anyone recommend an approach to creating my own "framework" for controlling users/login and such. I was thinking of creating something very similar. Is there some way I can register a class (maybe in the webconfig) which will run when asp.net is running, like etc. the Profile provider soo i dont have to create a new instance on every page load (and get connection string and such, but which is loaded first time it starts (asp.net/iis) and then ready for use/access all the time). Is there any security issues i will need to think about ? I was wondering how the build in Membership system stores if a user is logged in or not. Is the username or userid just saved in a session variable ? I am also thinking about if i make my own framework is there any way to make it work with the existing panels or will i have to create new panels ? (for an example to determine content to show the user if the user is logged-in or not and if the user if one role or another), and what about the way you can control access to your website through the webconfig by specifying which roles have access. Is it possible to make my own "framework" work together with this ? Hope som

      J Offline
      J Offline
      Jasmine2501
      wrote on last edited by
      #2

      What is wrong with creating stored procedures and databinding or using ADO in the normal way?

      "Quality Software since 1983!"
      http://www.smoothjazzy.com/ - see the "Programming" section for freeware tools and articles.

      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