Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 17, 2010 04:43 PM by m_userName
Jun 16, 2010 04:58 PM|LINK
I've been experimenting with adding login functionality, and have followed some of the security tutorials such as http://www.asp.net/security/tutorials/creating-the-membership-schema-in-sql-server-cs.
These tutorials walk you have to create a login by creating all the relevant username/password text boxes, and creating a database in which to store the user info.
However, when you create a new web application in VWD 2010, it already has a login functionality provided by using a Login control, which does all of this stuff automatically.
I found the following article: http://msdn.microsoft.com/en-us/library/ms178329.aspx, which details the default login control, and noticed that in the "Storing the login information" section it mentions that once you create a user it stores it in the ASPNETDB.mdf
However, I've added users using the login control, but App_Data folder is empty (in the tutorial which shows you how to add the database manually, you can expand the App_Data folder and access the database inside).
Is it possible to access this database? I'm trying to customise the default login functionality, and didn't know whether it was possible to tinker around with the exisitng functionality, or whether I'd need to create my new functionality from scratch like
in the tutorials.
Jun 16, 2010 05:20 PM|LINK
Give a look at some of the videos and tutorials here to help clear your doubts: http://www.asp.net/web-forms/security
By default it should create aspnetdb.mdf under App_Data Folder...try to refresh the folder.
But if you have create it manually using aspnet_regsql.exe, it might not be under app_data folder.
Jun 17, 2010 02:42 PM|LINK
I've looked at those tutorials, and I tried refreshing the folder, and nothing.
But the folder is there. I looked for it using windows explorer, and is has created an ASPNETDB.mdf folder in the App_Data of the project, it's just that this isn't visible in Visual Web Developer like how it is when I manually added the project using right
click on App_Data > Add New Item > SQL Server Database. T
he ASPNETDB database is obviously being accessed by the app as the usernames and passwords I have created are persisting between instances of running the app.
I'm not sure why this folder exists but isn't visible in the App_Data folder in Visual Studio. I've tried right click on App_Data > Add Exisiting Item, I'm able to select the ASPNETDB.mdf and add it, although there is an error icon where the yellowish cylindrical
database icon normally is (I'm not sure what the exact error is, since it doesn't seem to provide any kind of tool tip).
However, I am able to see the contents of the database by going to the database explorer view and right click > show user data on particular tables.
Is there any way to see the default table it creates in VWD (since the way I have just done produces an error), of is the default database that is created for login by the login control not supposed to be accessed by the client programmer by design?
Jun 17, 2010 03:47 PM|LINK
--->I looked for it using windows explorer, and is has created an ASPNETDB.mdf folder in the App_Data of the project, it's just that this isn't visible in Visual Web Developer
Oh i see the file seems to be hidden....use the Show All Files button like shown here:
-->Is there any way to see the default table it creates in VWD (since the way I have just done produces an error), of is the default database that is created for login by the login control not supposed to be accessed by the client programmer by design?
To view the tabels and data you should be using Database Explorer and not the App_Data file.
Jun 17, 2010 04:43 PM|LINK
It appears the files are hidden by default and you need to press the "show all files" button in the solution explorer. I do use the database explorer to look at the files, but you need to show the hidden files before you view them.