Tuesday, December 19, 2006

ASP.NET Ajax page method on login page requires setting location in web.config

I have spent quite a while on this one, so I deliver my findings here hoping that it will help.

If you have an ASP.NET web site with forms authentication and your login page has an ASP.NET Ajax extensions page method, this method will not work unless you set:

<location path="login.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>


Otherwise, the call to ~/login.aspx/yourScriptMethod fails because it is not authenticated.

1 comment:

RRave said...

Invitation to new programming Resources Website



Dear Sir,

I hope you are doing well. I got this email address from one of your contribution web site. I have launched a web site www.codegain.com and it is basically aimed C#,JAVA,VB.NET,ASP.NET,AJAX,Sql Server,Oracle,WPF,WCF and etc resources, programming help, articles, code snippet, video demonstrations and problems solving support. I would like to invite you as an author and a supporter.
Looking forward to hearing from you and hope you will join with us soon.