4.0 Website With Membership And With A Lot Of Data?
Feb 2, 2011
ve a more general question on what would be the best approach for a website with a lot of data (with ASP.NET 4.0) ?To be more specific :What would be the best way to represent the data (what UI controls) datalist , gridview, ... ? There is no need for data manipulation only displaying.What would be the best way to fetch the data (which data sources ? LINQ to sql , ASP.NET database entity model, ...) from a SQL database ? Should I use stored procedures ?
View 1 Replies
Similar Messages:
Jan 28, 2011
I'm currently developing a web application where everything works fine in the visual studio web server. It authenticates the user, access the database, writes to it, etc.
After I wrestled yesterday to publish it to my local iis, a subject I admit I have little to no experience of doing, suddenly the membership of the website started to not authenticate the users.
At first I suspected maybe the app wasn't accessing SQLServer, or that the data with the users I had in the asp.net membership database was erased when I uploaded the website.
So I stopped iis, i attached the db file to my local sql server, and I can see that all the users are there just like I uploaded them. I also can see the website can access another database with micellaneous contents just fine.
The loging controls don't tell me there's any problem either, they just show a message telling the user that the login attempt wasn't successful.
So, here's what I remember I did to make the app work as it wasn't even doing that when I first uploaded it.
I used the asp.net_regiis tool to copy website scripts to the website.
aspnet_regiis -sn <path>
then I deleted the website, uploaded again from VS. this time it shows in the browser but it doesn't authenticate the users.
The application isn't precompiled, I just uploaded it.
View 6 Replies
Oct 27, 2010
i have to build a ASPNET website on which some functionalities will be available to logged in users.I'm trying to understand the right thing to to in building my pages.
I've found the following code in Page_PreInit:
protected void Page_PreInit(object sender, EventArgs e)
{
if (Membership.GetUser() == null) //check the user.. Weather user is logged in or not
{
this.Page.MasterPageFile = "~/General.master";
}
if (Membership.GetUser() == "ADMIN") //check the ADMIN.. Weather ADMIN is logged in or not
{
this.Page.MasterPageFile = "~/ADMIN.master";
}
else
{
this.Page.MasterPageFile = "~/Member.master";
}
}
..but i don't' know if this is the right approach in designing an app.Is it right to switch at runtime Master page according to username/role?
View 1 Replies
Mar 9, 2010
The title says it all. We had a working website built on framework 2.0 with membership. After we converted it to framework 3.5 using the Visual Studio automated conversion mechanism by opening it in Visual Studio 2008 and following the prompts, the membership system is now broken. Dammit, all we wanted was some newer AJAX. The rest of the site appears to be functioning fine, but when it comes to logging in or managing security on the site, it fails.
So the errors we receive when trying to manage security via the built-in admin pages, seem pseudorandom; everything from 'user cannot log in to database' to 'this file is being used by another process' to 'there's a problem with your datastore'.
View 2 Replies
Jan 18, 2010
I have an existing ASP.NET web application that is for public use and any anonymous user can access it. I would like to implement mechanism for users to sign up. The first thought that crossed my mind is to use the ASP.NET membership API.
So, If I use the Membership API:
[code]...
View 2 Replies
Jul 3, 2010
I have a web aaplication which currently has a bunch of users and use Asp.net Membership to create and manage users.
I want to add OAuth functionality to my application and want to still using Asp.net Membership (login , etc ). ( and I also want my user login to application with any public social network ID , if that network use a OAuth membership.
How can I use Asp.net and OAuth (open ID) beside each other ?
I also want to add a new page for users to create a profile for themeselve.
View 1 Replies
Feb 20, 2010
Is it possible to have an ASP.NET website which allows users to register and login, without using a MembershipProvider?
And instead just work directly towards custom database tables which stores user information?
View 3 Replies
Feb 2, 2010
If I am currently using membership as a localhost, what will happen when I "publish" and "build" my website and upload it? Do I have to follow specific steps, how would I connect to the "ASP.NET Administration Tools"?
View 3 Replies
Oct 1, 2010
I am in the initial stage of implementing a new webstie, which will use only twitter and facebook to login and use. So my approach is not use any Default memberhip database, just simple store the user data in my created "membership" database. I will set cookies and use sessions to restrict and grant access to various parts of the sites. So for example, the user creates an account and I set a cookie allowing him or her to traverse the site. And on each page request from the client browser check to see if my website cookie is there in the browser and if it has expired or not.
View 1 Replies
Mar 2, 2010
Environment: W2K8R2 x64 +SPn..., Office 2007 +SPn..., Visual Studio 2008 + SP1+ SPn..., SqlExpress2005 +SPn..., SQL Std 2008 +SPn...
2 Problems...
1) No matter how I try Default.aspx never shows up as the StartPage even though I've told it to, the Login.aspx Page shows up first, so the rest of the walkthrough seems strange....
2) I'm a dummy when it comes to SMTP so I can not seem to get the SMTP to send a message to the User supplied e-mail address....
I want to use this methodology for many Web-Sites I have planned, but if it doesn't work then perhaps not....
View 1 Replies
Mar 11, 2010
I created a database with aspnet_regsql, the database was created in sql sever 2008 and not in data folder in my project (do I need to move it to the folder manually?). Next, in Web Site Administration Tool I went to provider section and clicked don Test button.
I got an error:
Could not establish a connection to the database. If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider.
Maybe I need to set something in a web.config, like membership settings or connection strings (or ASP.NET Website Administrator Tool should create those settings for me)?
Update: Maybe it happens because I am using SQL server 2008 full and not express?
Update 2:
After setting membership section and connection string to my aspnetdb database in Web Site Administration Tool I've opened security->Security Setup Wizard->Define Roles (stage 4) I got this error:
An error was encountered. Please return to the previous page and try again.
The following message may help in diagnosing the problem: Unable to connect to SQL Server database. at
System.Web.Administration.WebAdminPage.CallWebAdminHelperMethod(Boolean is Membership, String methodName, Object[] parameters, Type[]
paramTypes) at ASP.security_wizard_wizardpermission_ascx.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control
namingContainer)
View 2 Replies
Aug 14, 2010
I have attempted to deploy my first WEB application and needed to include the Membership for Internet login. Application works fine when I use Visual Web Developer, but when I deploy to my provider when I attempt to Login, I eventually get the error message (this was after I turned on the debug="true" - full message is
[Code]....
When I copied the application to the WebSite, I assumed that the ASPNETDB.MDF needed to be copied too with everything that I defined for users and roles. Looked at the WEB.CONFIG and expected to see something defined here as to where it is located, etc. Do not see anything in my project with the name.
View 3 Replies
Jan 3, 2011
since installing VS2010 I have problems with configuring membership. Using a online sql database what I prepared with the aspnet_regsql tool tables are there connection string is ok! when I open the ASP net config tool, I do not manage to select the membership provider. Underneath my web config file. can sombody tell me what is wrong??
[Code]....
View 3 Replies
Aug 10, 2010
I'm about to roll out my web site soon, and was just wondering if there's a way to roll out the db I'm working with on my dev computer, or if I have to recreate everything on the production server. If I can roll out my dev db, will the uids be the same?
View 1 Replies
Oct 13, 2015
I am taking MSDN's walkthrough on Creating a Web Site with Membership and User Login. I have some free time and am taking a look at some topics I'm not 100% clear on. So this isn't for a live site; just for my own edification. I set up a user in the web site administration tool then another one in the CreateUserWizard control. I was surprised that in the control it let me create the 2nd user with the same email id as the 1st so I was looking around at how to prevent this. I found requiresUniqueEmail="true" that goes in web.config, in this block:
Code:
<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="20">
<providers>
<add name="SqlProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="SqlServices"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
passwordFormat="Hashed"
requiresUniqueEmail="true"
applicationName="MyApplication" />
</providers>
</membership>
Which I believe would be the solution. Is that right? My problem is what do I set all those other attributes to in the block? All I really want is requiresUniqueEmail but it seems I have to specify a connectionstring also but I don't know what this would be. The website is using ASPNETDB.MDF which got created in App_Data after I ran the administration tool for the first time (I believe). So I need to explicitly define a connectionstring to that DB now that I want to require a unique email?
View 9 Replies
Apr 26, 2010
WARNING - Absolute beginner here with VS. I'm expecting a steep learning curve, but I'm up to it! I'm trying to create a website with membership/login. Followed the above walkthrough MANY time, and been very careful with the username and password entered, but I keep getting the message that the loging failed. The asp application name is "Membership" This is the whole thing, automatically created following the walkthrough, apart from adding 2 members - yes, did go to the memberpages folder at the set rules page.
Solution Explorer:
Solution 'membership' (1 project)
- //localhost/membership/
- App_Data
- ASPNETDB.MDF
aspnetdb_lpg.LDF
- MemberPages
web.config
- Default.aspx
Default.aspx.vb
- Login.aspx
Login.aspx.vb
webconfig
aspnet_Membership: (2 members)
PasswordFormat = 1
The ApplicationId for the 2 members is different - should it be?..........
View 2 Replies
Mar 29, 2010
I am using Membership.DeleteUser("username",true) method to delete the user from DataBase. This works fine in my local machine. When i publish the same code, i am not able to delete the user..... it throws an javascript error saying..... "Login failed for user NT AUTHORITY/NETWORK SERVICE"
View 5 Replies
Jan 16, 2010
I have a client asp.net website that uses ASP.Net Membership, Roles and Profile providers and Login controls. I need to expand the application so was going to use WCF Workflows, the ASP.Net website will be hosted on a different server than the WCF Services so what I want to do is get the ASP.Net Website to auth via the WCF Service. So process will go:
ASP.Net Website ------------------> WCF Service ------------------> SQL Database (Membership, Roles, Profile, Workflow Persistence Data and Business Data)
I tried creating a custom Membership and Role providers but I have had problems managing the users (Membershipuser class) saying null when a vaild user has been return by the WCF Service as can access the properies but not the methods.
View 5 Replies
Jun 13, 2012
I have a website and a SQL Server Database. I want to use ASP.Net Membership for login and roles.
View 1 Replies
Jun 22, 2010
I set up a really simple custom membership provider for my website, it is on shared hosting with 123reg which operate in medium trust mode. Due to this the membership provider throws an error. how it would work on medium trust on shared hosting? The hosting doesnt allow me to set the applications trust mode either.
View 2 Replies
Jul 27, 2010
I have been asigned task of creating website which display data in Website on basis of other Website's data.
For e.g. I need to display BSE Sensex data from its website into my customized website.
I searched online and found that by HttpWebRequest and HTTPWebResponse it is possible but not upto level which I need.
I just want some particular pieces of data from tables and much more. And then I need to display those data in website.
View 2 Replies
Jan 5, 2011
This is my first membership provider; I converted the sample provider [URL] to SQL. I created a vb class provider and put it into the App_Code folder. After it was created I tried to modify my webconfig but the error pops up. I don't know what else to try, I don't know if I have missed something
webconfig:
[code]....
View 1 Replies
Mar 15, 2011
We have a ASP.NET application working on our staging server/DB. The application works fine. We are using ASP.NET Memebership/Roles, etc.
Now it's time to deploy the application to production. As part of the deployment, we want to copy/migrate the ASP.NET Memebership database to the production servers.
Can we simply do this via SQL Server's export/import functions? Will the applications IDs and role IDs that move to the production DB make sense when the ASP.NET application is deployed on the new boxes?
View 3 Replies
Jul 14, 2010
give me an example (or point me in the right direction) on how to store custom data in an ASP.NET Membership cookie? I need to add some custom properties like UserID and URLSlug to the cookie and be able to retrieve the information in the same way one would retrieve the Username.
Edit:
I used Code Poet's example and came up with the following.
When I set a breakpoint at Dim SerializedUser As String = SerializeUser(userData) the value of userData is right. It has all the properties I expect it to have.
The problem I'm now running into is that when I get to Dim userdata As String = authTicket.UserData (breakpoint), the value is "". I'd love to figure out what I'm doing wrong.
Here's the code.
Imports System
Imports System.Web
Imports System.Web.Security
Namespace Utilities.Authentication
Public NotInheritable Class CustomAuthentication
Private Sub New()
End Sub
Public Shared Function CreateAuthCookie(ByVal userName As String, ByVal userData As Domain.Models.UserSessionModel, ByVal persistent As Boolean) As HttpCookie
Dim issued As DateTime = DateTime.Now
''# formsAuth does not expose timeout!? have to hack around the
''# spoiled parts and keep moving..
Dim fooCookie As HttpCookie = FormsAuthentication.GetAuthCookie("foo", True)
Dim formsTimeout As Integer = Convert.ToInt32((fooCookie.Expires - DateTime.Now).TotalMinutes)
Dim expiration As DateTime = DateTime.Now.AddMinutes(formsTimeout)
Dim cookiePath As String = FormsAuthentication.FormsCookiePath
Dim SerializedUser As String = SerializeUser(userData)
Dim ticket = New FormsAuthenticationTicket(0, userName, issued, expiration, True, SerializedUser, cookiePath)
Return CreateAuthCookie(ticket, expiration, persistent)
End Function
Public Shared Function CreateAuthCookie(ByVal ticket As FormsAuthenticationTicket, ByVal expiration As DateTime, ByVal persistent As Boolean) As HttpCookie
Dim creamyFilling As String = FormsAuthentication.Encrypt(ticket)
Dim cookie = New HttpCookie(FormsAuthentication.FormsCookieName, creamyFilling) With { _
.Domain = FormsAuthentication.CookieDomain, _
.Path = FormsAuthentication.FormsCookiePath _
}
If persistent Then
cookie.Expires = expiration
End If
Return cookie
End Function
Public Shared Function RetrieveAuthUser() As Domain.Models.UserSessionModel
Dim cookieName As String = FormsAuthentication.FormsCookieName
Dim authCookie As HttpCookie = HttpContext.Current.Request.Cookies(cookieName)
Dim authTicket As FormsAuthenticationTicket = FormsAuthentication.Decrypt(authCookie.Value)
Dim userdata As String = authTicket.UserData
Dim usersessionmodel As New Domain.Models.UserSessionModel
usersessionmodel = DeserializeUser(userdata)
Return usersessionmodel
End Function
Private Shared Function SerializeUser(ByVal usersessionmodel As Domain.Models.UserSessionModel) As String
Dim bf As New Runtime.Serialization.Formatters.Binary.BinaryFormatter()
Dim mem As New IO.MemoryStream
bf.Serialize(mem, usersessionmodel)
Return Convert.ToBase64String(mem.ToArray())
End Function
Private Shared Function DeserializeUser(ByVal serializedusersessionmodel As String) As Domain.Models.UserSessionModel
Dim bf As New Runtime.Serialization.Formatters.Binary.BinaryFormatter()
Dim mem As New IO.MemoryStream(Convert.FromBase64String(serializedusersessionmodel))
Return DirectCast(bf.Deserialize(mem), Domain.Models.UserSessionModel)
End Function
End Class
End Namespace
Here's where I create all the magic. This method is in a "BaseController" class that inherits System.Web.Mvc.Controller
Protected Overrides Function CreateActionInvoker() As System.Web.Mvc.IActionInvoker
If User.Identity.IsAuthenticated Then ''# this if statement will eventually also check to make sure that the cookie actually exists.
Dim sessionuser As Domain.Models.UserSessionModel = New Domain.Models.UserSessionModel(OpenIdService.GetOpenId(HttpContext.User.Identity.Name).User)
HttpContext.Response.Cookies.Add(UrbanNow.Core.Utilities.Authentication.CustomAuthentication.CreateAuthCookie(HttpContext.User.Identity.Name, sessionuser, True))
End If
End Function
And here's how I try and retrieve the info.
Dim user As Domain.Models.UserSessionModel = CustomAuthentication.RetrieveAuthUser
View 2 Replies
Mar 27, 2010
I'm using the ASP.NET SQL Membership Provider. So, there's an aspnet_Users table that has details of each of my users. (Actually, the aspnet_Membership table seems to contain most of the actual data). I now want to store some per-user information in my database, so I thought I'd just create a new table with a UserId (GUID) column and an FK relationship to aspnet_Users. However, I then discovered that I can't easily get access to the UserId since it's not exposed via the membership API. (I know I can access it via the ProviderUserKey, but it seems like the API is abstracting away the internal UserID in favor of the UserName, and I don't want to go too far against the grain).
So, I thought I should instead put a LoweredUserName column in my table, and create an FK relationship to aspnet_Users using that. Bzzzt. Wrong again, because while there is a unique index in aspnet_Users that includes the LoweredUserName, it also includes the ApplicationId - so in order to create my FK relationship, I'd need to have an ApplicationId column in my table too. At first I thought: fine, I'm only dealing with a single application, so I'll just add such a column and give it a default value. Then I realised that the ApplicationId is a GUID, so it'd be a pain to do this. Not hard exactly, but until I roll out my DB I can't predict what the GUID is going to be. I feel like I'm missing something, or going about things the wrong way. What am I supposed to do?
View 3 Replies