Dynamic LoginView and AnonymousTemplate?

Discussion in 'ASP .Net Security' started by bradwiseathome@hotmail.com, Jun 27, 2006.

  1. Guest

    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".
    }
    }
    }
    , Jun 27, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sean  Sims

    Problems with LoginView and GridView

    Sean Sims, Sep 1, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    2,969
    Sean Sims
    Sep 1, 2006
  2. =?Utf-8?B?cGFnYXRlcw==?=

    LoginView - Roles and Common Stuff

    =?Utf-8?B?cGFnYXRlcw==?=, Sep 28, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    1,600
    =?Utf-8?B?cGFnYXRlcw==?=
    Sep 28, 2006
  3. jsqrd

    LoginView and LoginStatus

    jsqrd, Mar 18, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    1,030
    jsqrd
    Mar 19, 2007
  4. vespaboy
    Replies:
    0
    Views:
    308
    vespaboy
    May 4, 2007
  5. Ian Semmel

    LogInView Password Recovery and Smtp

    Ian Semmel, Apr 8, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    353
    Ian Semmel
    Apr 9, 2008
Loading...

Share This Page