Templates while using Forms Authentication 
Author Message
 Templates while using Forms Authentication

Hi all,

I plan to use templates in my web project based on the tutorials by
smartisans.com ( http://www.*-*-*.com/ ). I
also want to use forms authentication in web.config since the entire site
will be password protected.

The problem is that I can't find an easy solution for using the
authentication together with the template (one .aspx-page containing a
placeholder for the content). Are there any tutorials on this? Here's my
web.config:

<authentication mode="Forms">
  <forms name="NewsletterFormsAuth"
  loginUrl="login.aspx"
  protection="All"
  timeout="20" />
</authentication>

<authorization>
  <deny users="?" />
</authorization>

Since I want login.aspx to use the template as well, I need to allow
anonymous access to the default.aspx file, which is the template, but that
would also open up the rest of the site since all .ascx files are called
through default.aspx (like default.aspx?page=somepage.aspx)

How should I do this?

Thanks.
/Jonah



Fri, 24 Jun 2005 01:11:04 GMT  
 Templates while using Forms Authentication
Hi Jonah:

 I had the same problem... but i decided to solve this quickly... i wrote an
special LOGIN.ASPX page...that looks very different from the template i
have.

 Hope if you find some way to use the template... advise me ok?
jac



Quote:
> Hi all,

> I plan to use templates in my web project based on the tutorials by
> smartisans.com (http://www.smartisans.com/articles/vb_templates.aspx). I
> also want to use forms authentication in web.config since the entire site
> will be password protected.

> The problem is that I can't find an easy solution for using the
> authentication together with the template (one .aspx-page containing a
> placeholder for the content). Are there any tutorials on this? Here's my
> web.config:

> <authentication mode="Forms">
>   <forms name="NewsletterFormsAuth"
>   loginUrl="login.aspx"
>   protection="All"
>   timeout="20" />
> </authentication>

> <authorization>
>   <deny users="?" />
> </authorization>

> Since I want login.aspx to use the template as well, I need to allow
> anonymous access to the default.aspx file, which is the template, but that
> would also open up the rest of the site since all .ascx files are called
> through default.aspx (like default.aspx?page=somepage.aspx)

> How should I do this?

> Thanks.
> /Jonah



Fri, 24 Jun 2005 01:30:33 GMT  
 Templates while using Forms Authentication
Hi Jac,

Thanks for your quick reply!

I was thinking of that too, but after taking a closer look at the tutorial
and how UI controls are inherited from the ascx files, I might just stick to
register tags on each aspx page and include them as page lets instead. :-/

This because I didn't find any solution to communicate with a web control on
the page since the page class inherits UserControl and not
System.Web.UI.Page. Do you know how to fix that?

/Jonah



Quote:
> Hi Jonah:

>  I had the same problem... but i decided to solve this quickly... i wrote
an
> special LOGIN.ASPX page...that looks very different from the template i
> have.

>  Hope if you find some way to use the template... advise me ok?
> jac



Fri, 24 Jun 2005 01:43:42 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Using Forms Authentication to avoid the Windows Logon Box

2. Opening a form an using function fron an other template

3. Using Form Template

4. Using form as template

5. Forms Authentication with web.config and frames

6. forms based authentication and default.aspx

7. ASP.Net Forms Authentication

8. Forms Authentication with NT security.

9. Form Authentication - Please help

10. Windows Authentication using System.Security.Principal namespace

11. forms authentication

12. Send Mail using .NET with Authentication

 

 
Powered by phpBB® Forum Software