Showing posts with label templates. Show all posts
Showing posts with label templates. Show all posts

Wednesday, March 28, 2012

Control Extenders inside View Templates?!?

In the previous versions of the toolkit I could place a control extender inside a view template and everything worked just fine but with today's release (10-20-2006) this appears to have broken.

I have verified this to be true with the TextBox Watermark Extender, the Drop Shadow Extender, and the Rounded Corners Extender.

As an example:

<asp:ScriptManager ID="scriptManager" runat="server" />
<asp:LoginView ID="loginView" runat="server">
<AnonymousTemplate>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<ajaxToolkit:TextBoxWatermarkExtender ID="tbw" runat="server" TargetControlID="TextBox1" WatermarkText="WaterMark" />
</AnonymousTemplate>
</asp:LoginView>

This code worked fine in the last version but in this version I do not see the watermark.

Is anyone else experiencing this? If there another way to do this?

Thanks

Sean

The fix is to add the following to your page:

protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
loginView.DataBind();
}

The reason is outlined here:http://forums.asp.net/thread/1441672.aspx.