hi i need help
i need to get a control from with using method FindControl(id);
but in my control is in HTML and it have 2-ID because he is custom controll
this is how i create the control
protected override void Render(HtmlTextWriter writer)
{
for(int i = 0 ; i < 3; i++)
{
writer.AddAttribute(HtmlTextWriterAttribute.Type, "checkbox");
writer.AddAttribute(HtmlTextWriterAttribute.Id , "ch"+i.ToString());
this.AddAttributesToRender(writer);
writer.RenderBeginTag(HtmlTextWriterTag.Input);
writer.RenderEndTag();
}}
and this is how i call the control in my asp.net page
<CC:ServerControl1 ID="ServerControl" runat="server" />
this is how it looks in pagesoure
<input type="checkbox" id="ch0" id="ServerControl" />
<input type="checkbox" id="ch1" id="ServerControl" />
<input type="checkbox" id="ch2" id="ServerControl" />
this is how i use the Method
FineControl(id)
for (int i = 0; i < 3; i++)
{
CheckBox cb = this.FindControl("ch"+i.ToString()) as CheckBox;
if (cb != null)
{
if (cb.Checked == true)
{
ss[pom] = i;
pom++;
}
}
}
and all time the finecontrol give me null never dont give me that what i need?
can some one give me any sugestion how to do it???
thnx for help and sorry for my bad english!