Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 3rd, 2011, 12:46 PM
Registered User
Points: 33, Level: 1
Points: 33, Level: 1 Points: 33, Level: 1 Points: 33, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2011
Posts: 5
Thanks: 2
Thanked 2 Times in 2 Posts
Default Successful ASP.NET Login not recognised

I have been using the standard login/register facilities provided by VWD in a “production” environment using IIS 7.5 and .Net 4 while continuing with SQL Server Express. I installed SSMSE and attached the aspnet database and after some initial problems with the Connection String (discussed on another thread) everything was fine.

I don’t know what I may have done but "out of the blue" a login or register request continues to be honoured in that the User and Membership table entries are updated, and the Login control's OnLoggedIn event is triggered without error. However the user is not recognised as being logged in as the LoginView control continues to show the Anonymous Template and a request to obtain the MemberShipUser via Membership.GetUser(false) returns "nothing".

The problem is still there after uninstalling SQL Server Express then re-installing (without SSMSE) and using a User Instance. Login/Register actions work but the login is not recognised by other components.

Any suggestions on how to identify the problem would be much appreciated!
Reply With Quote
  #2 (permalink)  
Old November 3rd, 2011, 03:27 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

Can you post the code for the web.config file and the page? In addition can you describe your setup (where you run this site, how you configured the server and so on)? Also, what happens when you look at User.Identity in the code behind of a page while debugging?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
Peter T Roberts (November 4th, 2011)
  #3 (permalink)  
Old November 4th, 2011, 03:17 PM
Registered User
Points: 33, Level: 1
Points: 33, Level: 1 Points: 33, Level: 1 Points: 33, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2011
Posts: 5
Thanks: 2
Thanked 2 Times in 2 Posts
Smile Successful ASP.NET Login not recognised

Imar - Many thanks for your reply.

I'm afraid I have to confess to an own goal. I hadn't appreciated that logged-in status was indicated by a cookie and that there was no further reference to the database once the login had been completed.

I followed the recommendations in your excellent book to the letter particularly Chapter 19 and Appendix B. Apart from a slight problem with the connection string after attaching the database using SSMSE everything worked fine until login stopped working for no apparent reason.

I have just realised that the problem is due to my changing to an invalid URL address (one including '_' rather than '-' to access my Website. It appears that IE (or ASP.NET?) won't handle cookies associated with such names. After correcting the URL, login is now working once again without problem.

Thank you once more for your reply as it encouraged me to redouble my efforts to solve the problem which I had struggled with for some time!

Regards
Peter
Reply With Quote
The Following User Says Thank You to Peter T Roberts For This Useful Post:
Imar (November 5th, 2011)
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET 4 Login timeout R4VEN ASP.NET 4 General Discussion 13 October 30th, 2010 08:32 AM
asp.net login error akshay144 ASP.NET 3.5 Basics 1 August 3rd, 2009 08:18 PM
asp.net login control kulkarnimonica ASP.NET 2.0 Professional 6 September 25th, 2007 05:22 PM
Windows Login via ASP.net rwalker VS.NET 2002/2003 9 June 20th, 2007 03:27 PM
ASP.net login page in C# in 2.0 debjanib ASP.NET 2.0 Basics 4 March 23rd, 2007 08:46 AM



All times are GMT -4. The time now is 05:07 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.