.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Forms Authentication Won't Work After Deploying My ASP.NET App to the Hosting Server

Posted By:      Posted Date: October 22, 2010    Points: 0   Category :ASP.Net


I have strange thing here, my ASP.NET app works fine on my development PC, but when I deploy it on the server, the Forms Authentication won't work. The page is being redirected to the "login.aspx" page, but when I enter a valid username/password and hit the login button, it also goes to the login.aspx page (with no errors and no throw, it keeps like this forever).

I am using the default ASP.NET Membership provider, I have setup the hosting server to be exactly as my PC, so both have same settings of IIS, ASP.NET 4.0 Global Configuration (in IIS), and SQL Server 2005 Express Edition.

I searched for this problem in google and tried several suugestion (like removing the clear() in web.config, manually add the membership/role provider in web.config, change security in the physical folders, etc...) but with no luck.

Below is my web.config (which is working fine in my development PC):

Any ideas?

<?xml version="1.0"?>
  For more information on how to configure your ASP.NET application, please visit
    <add key="TermYear" value="2009"/>
		<add name=&q

View Complete Post

More Related Resource Links

ASP.NET Forms Authentication connecting to SQL Server with Windows Authentication

Hi everyone, I am not sure if this is the correct forum - apologies in advance - I could not identify where it should go! I have an ASP.NET Web Application that uses Forms Authentication using System.Web.Security.ActiveDirectoryMembershipProvider for signing on using Windows credentials.  This works nicely and is solid. The problem I have is connecting to SQL Server.  I need to be able to connect to SQL Server using Windows Authentication (trusted_connection=yes or Integrated Security=SSPI).  This is critical so I can record the user that created/last modified specific records and also to collect "Task-based" records that are relevant to the currently authenticated user. I have tried Google and a tonne of variations of web.config entries, using Win API to impersonate etc...  The only way that I could make it happen was to:- 1. Use the web.config entry:   (please entry at the bottom of the post.  For some reason it won't go into the right spot in this post!) 2. Log on specifically as the user specified in the above web.config entry.  If I log on as anyone else (ie Authenticate as anyone else), then SQL server simply gets the ASPNET service account as the Windows user. I have laboured over this for hours upon hours.  I really would appreciate some assistance. Thanks in Advance, Joe     "<identity

how to make forms authentication work accross www.abc.com and aaa.abc.com


Hi all,

       i am using forms authentication for my website www.abc.com, i wanna use the same website authcookie for aaa.abc.com.

What steps i need to follow

WCF over SSL with Forms Authentication on a Sharepoint Server


I want create web services in SP over SSL via Forms Authentication so I can consume them in a WPF app. The services seem fine as I can navigate to them via the browser and they don't throw an error. The SSL is done by a self certificate so I get a warning in my WPF when I create my service reference. However I added some code to override certificate checking as this is a learning exercise and I want to tackle one thing at a time. The web config for the web service is below but when I use this code in my client I get an error :

An error occurred when verifying security for the message.

Here is the stack trace: googling seems to point to resyncing my machines clock but the client and server are on the same machine.


Server stack trace: 

 at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState, TimeSpan timeout)

 at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)

 at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.DoOperation(SecuritySessionOperation operation, EndpointAddress target, Uri via, SecurityToken currentToken, TimeSpan timeout)

 at System.ServiceModel.Security.SecuritySessionSecurit

Explained: Forms Authentication in ASP.NET

This module explains how forms authentication works in ASP.NET version 2.0. It explains how IIS and ASP.NET authentication work together, and it explains the role and operation of the FormsAuthenticationModule class.

Using Forms Authentication in ASP.NET - Part 1

Classic ASP developers often had to "roll their own" authentication scheme, however, in ASP.NET much of the grunt work has been taken out. This article outlines how things have changed and how FormsAuthentication can be used to secure a Web site with a minimal amount of code.

ASP.NET Forms Authentication - Part 1

Often, in legacy Web applications, users authenticate themselves via a Web form. This Web form submits the user's credentials to business logic that determines their authorization level. Upon successful authentication, the application then submits a ticket in the form of a cookie, albeit a hard cookie or session variable. This ticket contains anything from just a valid session identification access token to customized personalization values.

ASP.NET forms authentication with roles

.A timeout is specified in minutes. This is "time since last request" not the "time since login". If a login is indicated to be persistent (described later) this is ignored.
.A protection method is specified for the cookie.
Next I wanted to specify a folder to which access is restricted to people who have logged in. To do this I entered the following code in the web.config file (beneath

Forms Authentication in ASP.NET

In this tutorial you will learn about Forms Authentication in ASP.NET 2.0 - Forms Authentication class, Cookie Domain, Forms Cookies, The Login Control, Signin, Signout, Authenticate, Redirect, Login Status, Login Name and Login View Controls.

Determine whether Forms Server is installed on a server

Check whether the Microsoft.Office.InfoPath.Server.dll and FormServer.aspx files are installed on the server.

deploying to msdeploy does not support a proxy server


I am trying to deploy through webmatrix but my system Proxy server configuration is not being used. I assume that webmatrix would detect the proxy server settings and use that for the msdeploy calls under the hood. Can anyone confirm this is a know issue? 

Problems with Forms Authentication in DD 4 site


Hello,  I am seeing a strange problem with Forms Authentication in my DD site.   A user logs into and can view/edit/delete data all day, but when they execute a Custom Filter against data (for example , a control DynamicData/Filters/CustomerLastNameSearch.ascx ) then the site auth fails, and redirects to the log in screen.

in web.config I have

     <authentication mode="Forms">
            <forms name=".Star" loginUrl="~/Login.aspx" protection="All" defaultUrl="~/Default.aspx" path="/" timeout="43200" cookieless="UseCookies" />     

Offhand, I am thinking two things : that DynamicData/Filters path requires some special handling for some reason, or the control extension ascx is causing auth to get confused.   Has anyone else experienced this or have any suggestions?  Thanks!

Word Automation Issue in Windows Server 2008 Hosting



The problem I am posting here is that I was facing nearly 2 weeks around. Any body comes with this stuff please help.

Word Automation in sample ASP.NET(C#) application.

I am using Microsoft.Office.Inetrop.Word Assembly for automation. Here I am reading a XXX.dot template file and fill the contents with dynamic data.

When i am executing my code in localhost:someportnumber the automation is working fine and I could get expected result and when I am hosting in my inetmgr(Windows XP is my OS) it is also working fine.

But the problem is that when I am hosting in my production server(Windows Server 2008 Standard Edition) I am not able to perform automation and results in the following error.

Data: System.Collections.ListDictionaryInternal
Message: Word has encountered a problem.
Source: Microsoft Word

The code gets failed in the following line:

ApplicationClass wordApp = new Microsoft.Office.Interop.Word.ApplicationClass();

Document wordDoc = wordApp.Documents.Add(ref oTemplate, ref oFalse, ref oMissing, ref oMissing); // Error in this line

I cannot able to proceed further. Can anybody please help me in solving this issue?

Thank you.

With Regards,


Forms based users being prompted for windows authentication login for My Sites photos in user lists

Here's an issue I didn't see coming for our forms based authentication users. 

We have a web application extended to an external url to handle forms based authentication for users outside of our domain. Our setup looks like this...

Internal Users/Windows Authentication - moss.domain.com
External Users/Forms Based - mossext.domain.com
My Site for Internal Users - mysites.domain.com

When our forms based users are accessing user lists, or discussion pages that display user pictures, they are getting a windows authentication login for our internal users (mysites.domain.com) who have populated their my site with personal photo.

How do we fix this? 

403 Forbidden - Forms Authentication


Form template has cascading dropdown lists.  When item selected from first list, form code executes a FileQueryConnection to retrieve data from a list to populate 2nd listbox.  Getting 403 forbidden when explicitely attempting to retrieve data from code.  Form is using connections from a data connection library.  The template works perfectly when deployed to a windows authenticated site.  Fails when executed from the forms authenticated site.


Deploying custom Web Parts on SharePoint 2007 production server

I would like to develop a custom SharePoint 2007 Web Part for a client. Currently I'm using Visual Studio to deploy my solution to a test environment (since it's a SharePoint Project I choose just Build -> Deploy from the menu). What are the appropriate steps to deploy it to the production server?

I'd like keep it simple and safe (i.e. use the principle of least privilege). Therefore (if possible) avoid using stsadm, achieve this through web interface, or avoid using administrative rights.

Also, can I specify the scope of my Web Part, i.e. choose on which Web Application or Site Collection will it be installed?

AsyncPostBackTrigger doesn't work on server..


 I am new to asp.net and ajax. I have a problem while using update panel.
I have a tabcontainer with 3-4 tab panels. Inside one tab panel there is a cancel button. What i want to do is to when i hit cancel button in code behind i change active tab index to 0 so that tabcontainer shows first tab panel. I have update panel around tab container. This works at my localhost. But on server its behavior is very random. Sometimes it works sometime it doesn't. Unfortunately I am not able to debug it also. I don't know how to debug code on server. As on localhost it works correctly so I am kind of stuck. 

Issue with Forms Authentication


 I'm in the middle of converting an intranet application to use forms authentication. The authentication process works fine for the core application and all the nested classic asp pages. However, my nested asp.net applications do not work. I have mapped their web.configs to the correct login url. If I attempt to access them after logging in, I am automatically redirected to the homepage of the intranet application. If I try to access them directly, I am redirected to the login screen, as I should be, and then the intranet homepage after the login process, instead of the page I need to access.

At first, I thought there might be some remnant of the security processes in the nested applications, but it does it for applications that have no security processes other than the one for the core intranet.

Since this is my first crack at using forms authentication, I'm assuming I've missed some step. Any ideas?

Here is the section of my web.config:

<authentication mode="Forms">

      <forms loginUrl="~/folder/loginpage.aspx" name="Cookie Name"></forms>


      <deny users="?" />
      <allow users="*"/>

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend