W
WT
Hello,
I use to adapt skins in codebehind , using OnPreInit to set buttons skins
depending inner parameters.
This works perfectly but not for buttons inside a StartNavigationTemplate, I
find butons, set the skin but the new value I set is not kept and when I
enter in OnInit I can check thta the old original value for my buttons
skinID has come back ???
here is the declaration
<StartNavigationTemplate>
<table cellpadding='0' cellspacing='0' width='100%'>
<tbody>
<tr align='center'>
<td >
<asp:ImageButton ID="StartCancelButton" runat="server" SkinID="cancel_en"
CommandName="Cancel" CausesValidation="False" />
<asp:ImageButton ID="StartNextButton" runat="server" SkinID="setupnext_en"
CommandName="MoveNext" />
</td>
</tr>
</tbody>
</table>
</StartNavigationTemplate>
And codebehind in OnPreInit
Control ctl = FindControlDeep(CreateUserWizard1,"StartCancelButton");
if (ctl != null)
{
Trace2.WriteLine(string.Format("StartCancelButton Skin: {0}",ctl.SkinID ));
ctl.SkinID = "cancel_" + ext;
Trace2.WriteLine(string.Format("after StartCancelButton Skin:
{0}",ctl.SkinID ));
}
What is the mistery with these templates ?
CS
I use to adapt skins in codebehind , using OnPreInit to set buttons skins
depending inner parameters.
This works perfectly but not for buttons inside a StartNavigationTemplate, I
find butons, set the skin but the new value I set is not kept and when I
enter in OnInit I can check thta the old original value for my buttons
skinID has come back ???
here is the declaration
<StartNavigationTemplate>
<table cellpadding='0' cellspacing='0' width='100%'>
<tbody>
<tr align='center'>
<td >
<asp:ImageButton ID="StartCancelButton" runat="server" SkinID="cancel_en"
CommandName="Cancel" CausesValidation="False" />
<asp:ImageButton ID="StartNextButton" runat="server" SkinID="setupnext_en"
CommandName="MoveNext" />
</td>
</tr>
</tbody>
</table>
</StartNavigationTemplate>
And codebehind in OnPreInit
Control ctl = FindControlDeep(CreateUserWizard1,"StartCancelButton");
if (ctl != null)
{
Trace2.WriteLine(string.Format("StartCancelButton Skin: {0}",ctl.SkinID ));
ctl.SkinID = "cancel_" + ext;
Trace2.WriteLine(string.Format("after StartCancelButton Skin:
{0}",ctl.SkinID ));
}
What is the mistery with these templates ?
CS