Membership Create Users, Logging In Works. But Then It Doesn't?
Feb 14, 2011
I have a application that connects to a remote sql server. I am able to create users and they are stored in the DB. Then I can go to the login page and login. But after a while, I am unable to log in and it just sits at the login page. The user is still in the DB
<configuration>
<connectionStrings>
<add name="LoginSQL" providerName="System.Data.SqlClient"
[code]...
View 1 Replies
Similar Messages:
Sep 2, 2010
I had to upgrade a sites ecuroty from a custom system to .net membership. I created all the users like this.
ds = Wservices.SelectBulkUsers()
If Not ds Is Nothing AndAlso Not ds.Tables(0) Is Nothing AndAlso ds.Tables(0).Rows.Count > 0 Then
For Each dr In ds.Tables(0).Rows
username = dr("username")
password = dr("password")
role = dr("SecurityClearance")
email = dr("email")
Dim newUser As MembershipUser = Membership.CreateUser(username, password, email, "", "", True, status)
Select Case role
Case "1"
Roles.AddUserToRole(username, "normal user")
Case "2"
Roles.AddUserToRole(username, "administrator")
Case "3"
Roles.AddUserToRole(username, "super administrator")
End Select
If newUser Is Nothing Then
errorMsg = username & " - " & status.ToString & "<br />"
End If
Next
litResult.Text = errorMsg
End If
I thought everything was fine and then went through the labourious task of replacing all the usersids used a as a foreign key in all the tables. It was only after doing this and trying to log on I couldnt, and noticed the membership table was empty. I assumed (stupidly) as it had done the users/ roles it must have done the membership. As I have already re-assigned the old user ids I dont want to import again as the userid will chnage. So my question is: Can I create a membership for each of the users in my aspnet_users table? I have the passwords etc in varchar fields at min from old table.
View 3 Replies
Sep 6, 2010
how can I add default users in my web.config to test my asp: login control
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
Jun 2, 2010
I want to migrate users and posts from an existing forum I am using to a ASP.NET membership table without using CreateUser. Basically I want to maintain userIDs so that when I migrate posts they continue to associate with the correct users. Is there a way to do this or would I be better off just using CreateUser and then finding a way to re-assign the post-by-UserIDs to the correct new IDs?
View 3 Replies
Jul 28, 2010
I'm have a doubt using membershipuser to create users in the AD with Membership.CreateUser Method, does any one knows how can i send other attibutes to the AD, such as First Name and Last Name?, besides those ones: username
As String, _
password As String, _
email As String, _
passwordQuestion As String, _
passwordAnswer As String,
View 3 Replies
Jan 2, 2010
I am providing registered members of a website a weekly mailing which contains URLs to private pages on the website.
For usability purposes, I don't want the user to have to provide their credentials after they click on the URL.
I am using the ASP.NET Membership provider model.
Question
How can I implement this so that the user can be logged in by virtue of clicking a specialized URL link?
View 2 Replies
Jul 1, 2010
Im setting up a site with membership.
The db connection seems to work. I can create new users with the new user wizard control. And they show up in the databaser. But i cant log in. I use the log in control and just get "wrong password". I am sure i type the correct password as i made it very easy. here are my webconfig settings.
There is one thing i have no clue how to configure. The APPLICATION NAME. What is it? And what should i set it to?
<authentication mode="Forms">
View 2 Replies
Sep 17, 2010
need to slightly tweak the functionality of the ASP.NET Membership provider to add custom logging functionality. Instead of creating a wrapper class around the methods I wish to modify, I was toying with the idea or creating a custom Membership Provider and override a few of the methods.All the examples I could find would show how to create it from scratch. I don't want to overwrite everything... just override a few methods. Can somebody point me in the right direction?I can simply inherit from SqlMembershipProvider and override the methods. However, how can I get at the connection string?
View 1 Replies
Feb 16, 2011
I have a default page which has the login control, this page is in the main directory. Then I have a bunch of pages that I only want viewable to people that have logged in a "MemberPages" directory. My problem is when I click on login button on the default page, using a username and pass that is not in the DB, it still takes me to all my member pages
I went through the asp.net config and set the "MemberPages directory to deny all not auth users. But it still has the faded one that is inherited from the main that allows all and cant be changed (maybe that is the problem? But I can't delete it) What else?
Here is my web.config from the MemberPages directory.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</configuration>
Here is my main web.config.
<configuration>
<connectionStrings>
<add name="LoginSQL" providerName="System.Data.SqlClient"
connectionString="Data Source=xx.xx.xx.xx;Initial Catalog=xxxx;UID=xxxxxxx ;pwd=xxxxx;"/>
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<authentication mode="Forms">
<forms name="Login" loginUrl="Default.aspx" timeout="20" />
</authentication>
<membership>
<providers>
<add connectionStringName="LoginSQL" applicationName="Login"
enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true"
requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="3"
passwordAttemptWindow="30" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0"
name="MySqlLoginProvider" type="System.Web.Security.SqlMembershipProvider" />
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
</providers>
</profile>
<roleManager cacheRolesInCookie="true" cookieName=".ASPRoles"
cookieTimeout="60">
<providers>
<add connectionStringName="LoginSQL" applicationName="Login"
name="MyRoleProvider" type="System.Web.Security.SqlRoleProvider" />
</providers>
</roleManager>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
View 3 Replies
Jun 29, 2010
When a user logs in into my website I have a custom membership provider that overrides ValidateUser and verifies that the user has sufficient rights etc.
However, when implementing a 'remember me' function through the default forms authentication using RememberMeSet, I also want to validate a user on the first request.
Is there some hook I can attach to that triggers when a user logs in with their persistent cookie?
View 3 Replies
Mar 18, 2011
I recently inherited an asp.net website made up of multiple .aspx and .ascx pages and being rather new to web development and especailly asp.net. I have the site create a cookie upon login to automatically log users back in if the page times out on them while they're entering information.
I need the site to automatically log users out when the site is closed. Obviously using the me.close event on each page won't work because we don't want it to log people out every time they navigate to a new page in the site.
I've tried setting the timeouts in both IIS and in the files of the website to longer but it doesn't seem to have an effect.
Is there an easy way to automatically log users out when they leave the site but not when they navigate from page to page.
View 1 Replies
Jul 17, 2010
I am implementing strightforward membership provider. I do not want new users to be able to login without being approved.
I have tried the setting on the registration wizard called DisableCreatedUser="True" and this does not work.
I also set LoginCreatedUser to False, and the user still gets logged in.
If I look in the SQL membership table, 'IsApproved' is set to 0 for the account, but they can still login.
View 9 Replies
Jul 6, 2010
I'm debugging some unexpected behavior and while tracing in to the .NET framework I see a bunch of stuff like this:
if (Logging.On) {
Logging.PrintInfo(Logging.Web, this, SR.GetString(SR.net_log_n_certs_after_filtering, filteredCerts.Count));
...
}
But (as expected by default) the execution steps right over these. Is there some way to turn on the logging? Or is that just something that the framework developers can do while making special builds of the framework?
View 1 Replies
Sep 20, 2010
We use windows authentication. User opens our website in tab1 and does some action but with out clicking on save he opens a new tab tab2 and opens the same website again. Now, if the user session in tab1 is active i need to warn users that the he is already logged on to application in some other browser and go to some log out page. But if the user session in tab1 is timed out then he must be able to continue with the website in tab2 as usual, but if he tries to do anything in tab1 he should go to session expired page.
I tried implementing it in following way.
I have a hidden field in each page which will be set to unique Id using GUID.NewID().
when user requests for a page the following code is executed.
[Code]....
View 1 Replies
Mar 27, 2010
I'd like to know how membership providers works under the hood, if it uses cookies, session, the principal and identity thread objects, etc.. etc.. where can I find information?
View 3 Replies
Nov 2, 2010
I am pulling my hair on this one..
I have Active Directory Memebership Provider configured like this:
[code]....
The provider is instantiated correctly but when I call this:
var user = Membership.Providers["myDomain"].GetUser("myUser", false);
the call always returns null, except the case when I pass "Administrator" into the call... I have run out of ideas on how to make it work.
View 2 Replies
Apr 16, 2010
I understand that probably this is not good forum for asking this question, but I'm a bit dissapointed, and I don't know where I can found answer to my question. Here is my problem. I've got a page that has dynamically loaded content with innerHTML like below:
[Code]....
Everything works fine .. since I wanted to have gif shown when page content is loading. But now I would like to after loading innerHTML content to execute javascript function to create pieChart of something. The problem is that I have to use document.getElementById()function, but it does not works with content loaded dynamically. I mean, Lets say that inside page loaded by innerHTML we've got a form which id="A" when instead pieChart() in above code i will use document.getElementById('A') it does not return my form. I've checked this in IE7 with no effect, ffox also does not seems to work. The only one browser that works at the moment is Chrome.
View 1 Replies
Nov 3, 2010
I'm trying to make some calls to a WebService I did exactly what is described in this article [URL] Looking at the console of firebug I could see that my function was executed and returned the expected data, but my callback functions (OnComplete, OnError, OnTimeOut) are never executed. Whats wrong? Here is the code (same code of the article)
Service.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
[WebService(Namespace = "[URL]")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
[System.Web.Script.Services.ScriptService()]
public class Service : System.Web.Services.WebService
{
public Service () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public string HelloWorld(string strNoOfData)
{
return strNoOfData;
}
}
Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL]">
<html xmlns="[URL]">
<head runat="server">
<title></title>
<script type="text/javascript" language="javascript">
function CallService() {
Service.HelloWorld(document.getElementById('Textbox1').value,
OnComplete, OnError, OnTimeOut);
}
function OnComplete(Text) {
alert(Text);
}
function OnTimeOut(arg) {
alert("timeOut has occured");
}
function OnError(arg) {
alert("error has occured: " + arg._message);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="~/Service.asmx" />
</Services>
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<fieldset>
<asp:TextBox ID="Textbox1" runat="server"></asp:TextBox>
<br />
<asp:Button ID="Button1" runat="server" Text="Call Service" OnClientClick="CallService()" />
</fieldset>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
View 2 Replies
Mar 29, 2010
I have strange problem with the membership provider on my mvc application.
I have a webforms page inside admin folder which calls the following code in the models directory.
public int SaveUploadedFile(HttpPostedFileBase fileBase)
View 2 Replies
Feb 9, 2010
I have an asp.net web app that uses forms-based authentication, a SqlMembershipProvider (using an encrypted password format), and a SqlRoleProvider. I need to know if it's possible to administer the users (create new users, assign them to roles, etc.) from a windows application - the powers that be don't want any administrative functionality in the web app itself.
Here is the membership provider definition from web.config:
[code]....
So, obviously, I have a Sql Server database that contains the users and roles for the web app. I'd like to create a separate windows app that references the web app assembly, and use the configured MembershipProvider, RoleProvider, and machineKey to create users, assign users to roles, etc. If that's not possible, I can duplicate the configuration settings from web.config within the windows app. But I don't know how to do this either.
View 3 Replies
Dec 6, 2010
[Code]....
after successful creation of 3 users on my web site now cannot create users
View 9 Replies
Jan 9, 2011
I've this set:
AutoCompleteExtender (4.1.4.0) in update panel in user control (ascx) and webservice under his ascx.vb and doesn't works.
So I've tested the same markup and webservice method in a simple aspx page and works, so I've some doubt:
- AutoCompleteExtender works in ascx file with webservice function under his code?
- AutoCompleteExtender works in an update panel?
I've always problem to create webservice method using wizard on the control, it return always: Cannot create page method GetCompletionList because no CodeBehind or CodeFile was found! - but I've CodeBehind file..sure!
View 1 Replies
Jan 15, 2010
i have a problem with ToolkitScriptManager:
I have an asp web app contains ajaxtoolkit's controls. Everything is working fine on VS Development Server, but doesn't on IIS7 (win 2008).
The AjaxToolkit's scriptcombine sometimes is not working (resulted http 404 status code on browser). Maybe causes by long TSM_HiddenField query string on complex toolkit's controls.
the code:
[Code]....
View 1 Replies
Apr 7, 2010
This is the grid
<asp:GridView ID="annonceView" runat="server" AutoGenerateColumns="False" DataKeyNames="Id" DataSourceID="dataSourceAnnoncer">
<Columns>
<asp:BoundField DataField="Productname" HeaderText="Productname" />
<asp:buttonfield buttontype="Link" commandname="Delete" text="Delete"/>
<asp:TemplateField HeaderText="Administration">
<ItemTemplate>
<asp:LinkButton ID="lnkBtnDelete" runat="server" Text="Delete" CausesValidation="False" CommandName="Delete" OnClientClick="return confirm('Delete?')" />
/ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:LinqDataSource ID="dataSourceAnnoncer" runat="server" ContextTypeName="Namespcae.TheContext"
EnableDelete="True" TableName="Annoncer">
</asp:LinqDataSource>
Clicking the buttonfield deletes the record just fine. Clicking the LinkButton doesn't work. I get a postback and the grid is shown as empty and no record is deleted. Seems like an empty databinding. I have tried to create a custom OnClick, OnCommand event for the LinkButton, but neither are fired. The OnRowCommand isn't fired either.
I don't manually DataBind in the codebehind.
View 2 Replies