Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Dynamic LoginView and AnonymousTemplate?

Reply
Thread Tools

Dynamic LoginView and AnonymousTemplate?

 
 
bradwiseathome@hotmail.com
Guest
Posts: n/a
 
      06-27-2006

I would like to dynamically add a LoginView and an AnonymousTemplate to
my ASP.NET 2.0 page. I can't use the page template at all, just the
code-behind page. I tried to create my own class that implements
ITemplate, and then set that as the AnonymousTemplate for the
LoginView. The class is below, it's not working. Help!

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace test
{
public class AnonTest : TemplateControl , ITemplate , ILocalized
{
private LiteralControl _literalControl;
void ITemplate.InstantiateIn( Control parentContainer )
{
this._literalControl = new LiteralControl();
this._literalControl.DataBinding += new EventHandler(
_literalControl_DataBinding );
parentContainer.Controls.Add( this._literalControl );
}
void _literalControl_DataBinding( object sender , EventArgs e )
{
LiteralControl literalControl = sender as LiteralControl;
literalControl.Text = "future database driven".
}
}
}

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LogInView Password Recovery and Smtp Ian Semmel ASP .Net 1 04-09-2008 12:26 AM
page caching and loginview / membership vespaboy ASP .Net 0 05-04-2007 08:04 AM
LoginView and LoginStatus jsqrd ASP .Net 2 03-19-2007 12:08 AM
LoginView - Roles and Common Stuff =?Utf-8?B?cGFnYXRlcw==?= ASP .Net 0 09-28-2006 07:40 PM
Problems with LoginView and GridView Sean Sims ASP .Net 0 09-01-2006 08:32 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57