thanks for posting in my thread.
I've just tried using the FindControl, but it didn't work
I tried FindControl 3 different ways, and all give NULL:
public partial class Controls_CreateUserBox : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Controls_EditUserBox custom =
(Controls_EditUserBox)this.FindControl("Eub1");
Controls_EditUserBox custom1 =
(Controls_EditUserBox)CreateUserWizardStep1.FindControl("Eub1");
Controls_EditUserBox custom2 =
(Controls_EditUserBox)cuwNewUser.FindControl("Eub1");
}
}
Here is the code of CreateUserWizard:
<WizardSteps>
<asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server"
Title="Initial step">
<ContentTemplate>
<div style="margin-left:auto; margin-right:auto; width:400px;
border:solid 2px black; background-color:#eeddcc; position:relative;">
<div class="sectiontitle" style="text-align:center;">Opprett ny bruker</div>
<asp:Table ID="tblEditUser" runat="server" Width="100%" BorderWidth="1"
BorderColor="Black">
<asp:TableRow>
<asp:TableCell HorizontalAlign="Right"
Width="120">Brukernavn:</asp:TableCell>
<asp:TableCell Width="240" ><asp:TextBox ID="UserName"
runat="server" Width="100%"></asp:TextBox></asp:TableCell>
<asp:TableCell>
<asp:RequiredFieldValidator ID="valRequireUserName"
runat="server"
ErrorMessage="Username is required"
ControlToValidate="UserName"
SetFocusOnError="false" Display="Dynamic"
ValidationGroup="cuwNewUser">*
</asp:RequiredFieldValidator>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell HorizontalAlign="Right">Passord:</asp:TableCell>
<asp:TableCell><asp:TextBox ID="Password" TextMode="Password"
runat="server" Width="100%"></asp:TextBox></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell HorizontalAlign="Right">Bekreft
Passord:</asp:TableCell>
<asp:TableCell><asp:TextBox ID="ConfirmPassword"
TextMode="Password" runat="server"
Width="100%"></asp:TextBox></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell HorizontalAlign="Right">E-post:</asp:TableCell>
<asp:TableCell><asp:TextBox ID="Email" runat="server"
Width="100%"></asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell HorizontalAlign="Right">Spørsmål:</asp:TableCell>
<asp:TableCell><asp:TextBox ID="Question" runat="server"
Width="100%"></asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell HorizontalAlign="Right">Svar:</asp:TableCell>
<asp:TableCell><asp:TextBox ID="Answer" runat="server"
Width="100%"></asp:TextBox></asp:TableCell>
</asp:TableRow>
</asp:Table>
<mb:Eub ID="Eub1" runat="server" />
<asp:ValidationSummary ID="ValidationSummary1"
ValidationGroup="cuwNewUser"
ShowSummary="false"
ShowMessageBox="false"
runat="server" />
</div>
</ContentTemplate>
</asp:CreateUserWizardStep>
<asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server"
Title="Completed">
<ContentTemplate>
<div class="sectiontitle">Success</div>
A confirmation email is being sent to you.<br />
This email contain a link you need to click on to
activate your profile <br />
To continue click <asp:HyperLink ID="hlRedirect"
runat="server" NavigateUrl="~/Admin/ManageUsers.aspx">here</asp:HyperLink>
</ContentTemplate>
</asp:CompleteWizardStep>
</WizardSteps>
</asp:CreateUserWizard>
******************************************************
Here is some code from the custom web control which is used the above code:
public partial class Controls_EditUserBox : System.Web.UI.UserControl
{
private bool _display = true;
public bool Display
{
get { return _display; }
set { _display = value; }
}
********************************************************
Here is the first tag in the control that uses the custom control:
<%@ Control Language="C#" AutoEventWireup="true"
CodeFile="CreateUserBox.ascx.cs" Inherits="Controls_CreateUserBox" %>
<%@ Register Src="~/Controls/EditUserBox.ascx" TagName="Eub" TagPrefix="mb"
%>
************************************************
This webcontrol I have trouble accessing is placed on another custom web
control.
The purpose of the display property is that the web control contains a row I
sometimes want to hide.
any suggestions?