Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic controls with asp table

Status
Not open for further replies.

andyUK

Programmer
Dec 19, 2000
39
0
0
GB
I am writing a simple application to dynamically generate a form. I have created a user control to handle the date options i need. But when i try to call this in the code it seems fine until runtime. It seems to have problems with the events inside the custome control. Does anyone know away round this?


code to load the custome date control:

public class rbsDate
{
public System.Web.UI.WebControls.TableRow BuildControl(string sLabel, string sID)
{
TableRow r = new TableRow();
TableCell c = new TableCell();

Label NewLabel = new Label();
NewLabel.ID = sLabel;
NewLabel.Text = sLabel;
c.CssClass = "question";
c.Controls.Add(NewLabel);
r.Cells.Add(c);

TableCell cAns = new TableCell();

a1.DateControl NewDate = new DateControl();

NewDate.ID = sID;

//calc the values for the formelement

cAns.CssClass = "answer";
cAns.Controls.Add(NewDate);

r.Cells.Add(cAns);

return r;
}


}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top