|
Hi All
Thanks a lot for this code, it works like a charm!
I had a strange problem. The code worked flawlessly in my local environment, but when i deployed the application to my hosting center the login control behaved strangely. Meaning that the <asp:LoginStatus /> control wouldn’t change from "logon" to "Log off". But i didn’t get any errors when i tried to log in.
After browsing different forums for most of today i found the problem.
I needed to add the following line to my web.config file:
<authentication mode="Forms"/>
It might be obvious to some of you coders out there, but i can see that other people have had the same problem, and no one have provided a solution to this problem.
|
|
|
|
|
Here is a little background regarding my issue. I'm running an asp.net website using vb coding. I have implemented your mysql membership provider utilizing the latest mysql .net connector v6.3. I can run the project fine on my local computer with no problems but the moment i upload it to my Godaddy Windows Shared hosting i get this error below. Please advise. Thanks in advance for your help.
____________________________________________________________________________________________
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: That assembly does not allow partially trusted callers.
Source Error:
Line 1293:
Line 1294: return isValid;
Line 1295: }
Line 1296:
Line 1297:
Source File: d:\hosting\4622657\html\Development-Websites\Threads-N-Inks\App_Code\MySQLMembershipProvider.cs Line: 1295
Stack Trace:
[SecurityException: That assembly does not allow partially trusted callers.]
Andri.Web.MySqlMembershipProvider.ValidateUser(String username, String password) in d:\hosting\4622657\html\Development-Websites\Threads-N-Inks\App_Code\MySQLMembershipProvider.cs:1295
System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +60
System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +119
System.Web.UI.WebControls.Login.AttemptLogin() +115
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +101
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +118
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +166
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242
System.Web.UI.Page.ProcessRequest() +80
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.login_aspx.ProcessRequest(HttpContext context) +37
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
|
|
|
|
|
Hi, do you know a free ASP.Net hoster with MySQL Server? Just to experiment the deployement.
|
|
|
|
|
I just downloaded and installed your provider and it works like a charm !
Thank you so much.
I'm just wondering about how the foreihn keys between users and usersinroles and roles and usersinroles would be necessary like in the original asp .net role manager.
|
|
|
|
|
when I try this sql command
ALTER TABLE 'usersinroles' ADD INDEX ( 'Username', 'Rolename', 'ApplicationName' )
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''usersinroles'
ADD INDEX ( 'Username', 'Rolename', 'ApplicationName')' at line 1
|
|
|
|
|
|
Try using the following statement
ALTER TABLE usersinroles ADD INDEX (Username,Rolename,ApplicationName(255))
Also do it for the next alter table event where you have the application name.
This should sort your problem.
|
|
|
|
|
Hi,
I am new to .NET. How to recompile the .cs files?
Which web.config need to be configured?
Thanks in advance.
|
|
|
|
|
What's wrong?
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not load type 'Andri.Web.MySqlRoleProvider'.
Source Error:
Line 36: <add
Line 37: name="MySqlRoleProvider"
Line 38: type="Andri.Web.MySqlRoleProvider"
Line 39: connectionStringName="ConnString"
Line 40: applicationName="Booking_System_07072009"
|
|
|
|
|
To use these classes, you will need the latest MySQL .NET Connector. You might need to recompile it with the new C# compiler for v2.0 (but the new framework should normally support v1.0 or 1.1 assemblies).
how i do that???
|
|
|
|
|
|
im getting this error
"Provider must implement the class 'System.Web.Security.RoleProvider'"
can help me
|
|
|
|
|
I am getting the same error using the new v6.0.4 connector. Never got this with v5.2.3. Did you find a resolution?
|
|
|
|
|
BTW, I have reverted back to 5.2.3 and the error is gone.
|
|
|
|
|
I built a small website in VS 2008 written in C#. I'm able to view and modify tables within my program using MySQL as a datasource. I'm trying to take it to the next level and use MySQL as a role and membership provider. I followed the above directions to a T. I was able to build the project successfully. Unfortunately, when I go to the ASP.NET Web Application and Admin Tool and click on the "Test" button for MySQLMembershipProvider (or RoleProvider) I am unable to connect. The database is currently hosted online (not localhost). I have created the appropriate tables and tried connection strings known to work, but nothing.
I've been working on this for six hours and I'm about to lose it. Can anyone help?
|
|
|
|
|
OK...As far as I can figure out, the Admin Tool isn't compatible with remote DBs. So, I gotta code everything manually (which is fine). Does anyone have any sample code for login control?
|
|
|
|
|
hello..thanks for the code..its really helpful. I have the folowing issue however, when i create more than one user through the website administration interface, the site goes buzurk..with one user it works fine though. Here is what im doing:
i have a master page with a loginstatus and loginname controls, the login control itself is not on the master page i dont want it to appear everywhere, so its on the default.aspx page. using one user, lets say user1, i can login and logout normally, however if i added another user with the same role, lets say user2, and i login using user1, logging out doesnt work anymore, it keeps me on the same page not going back to default.aspx where the login control resides. Is this issue from the way i wrote the site or is it from integrating mysql with asp membership?
one thing to note is when i press the test button next to the provider it gives me an error that i must create the database, this happens regardless of how many users i created. I am using mysql 4.1. Your help is much appreciated.
Thanks
Mohamed Moubarak
|
|
|
|
|
ok...the logout button doesnt regularly take you back to the page where the login control exists, my mistake..turns out that it was taking me back when i press logout because i have the following in we.config:
<allow users="mam54">
<deny users="*">
but im still facing the problem when creating more than one user...any suggestions?
|
|
|
|
|
|
firstly thanks for this provider... I can use it for add user, login site but ı want to use roles for login same page in my site, But for it ı must create roles and add users in role by use codes. How can ı do it?
thank for your helps
|
|
|
|
|
In case it helps anyone, I've just recently written an article on my blog about implementing ASP.NET Membership using the current version of the MySQL .NET Connector, v5.2.3. That article can be found here.
|
|
|
|
|
Anything for the ASP.net Profile Provider?
- aron
|
|
|
|
|
Hello,
I get a "Could not find any recognizable digits" error when going to the next CreateUserWizard step. Anyone an idea why this happens? I've been cracking my head on it, but no luck...
Regards,
Joep
--
Server Error in '/' Application.
--------------------------------------------------------------------------------
Could not find any recognizable digits.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.FormatException: Could not find any recognizable digits.
Source Error:
Line 1536: byte[] returnBytes = new byte[hexString.Length / 2];
Line 1537: for (int i = 0; i < returnBytes.Length; i++)
Line 1538: returnBytes[i] = Convert.ToByte(hexString.Substring(i * 2, 2), 16);
Line 1539: return returnBytes;
Line 1540: }
Source File: e:\linkedpapers.com\wwwroot\App_Code\MySQLMembershipProvider.cs Line: 1538
Stack Trace:
[FormatException: Could not find any recognizable digits.]
System.ParseNumbers.StringToInt(String s, Int32 radix, Int32 flags, Int32* currPos) +0
System.Convert.ToByte(String value, Int32 fromBase) +41
Andri.Web.MySqlMembershipProvider.HexToByte(String hexString) in e:\linkedpapers.com\wwwroot\App_Code\MySQLMembershipProvider.cs:1538
Andri.Web.MySqlMembershipProvider.EncodePassword(String password) in e:\linkedpapers.com\wwwroot\App_Code\MySQLMembershipProvider.cs:1490
Andri.Web.MySqlMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) in e:\linkedpapers.com\wwwroot\App_Code\MySQLMembershipProvider.cs:453
System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() +305
System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) +105
System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) +453
System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e) +149
System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) +17
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
|
|
|
|
|
hi
can someone pls tell me how to add custom fields and provide the updation using andris mysql membership provider
thanks
|
|
|
|
|
Hi
I am having a problem on my login page with this provider. In the loggedIn event of my login control i am trying to get the currently logged in user with this code
Dim u As MembershipUser = Membership.GetUser
but i am getting the error object not set to instance of object
any help much appreciated
thanks
|
|
|
|