M
MLibby
My custom control's ID is automatically generated at design time when
dragging the control onto the webform, however it is not generated when the
control is programmatically created in the code behind. Is there a way for a
control to automatically generate a unique id if one has not been assigned to
it?
For example...
private void Page_Load(object sender, System.EventArgs e)
{
MyControl control = new MyControl();
// the control.ID is not assigned. Is there a way for the control
// to automatically generate the ID if not assigned???
Form1.Controls.Add(control);
}
....
Mike
Mike
dragging the control onto the webform, however it is not generated when the
control is programmatically created in the code behind. Is there a way for a
control to automatically generate a unique id if one has not been assigned to
it?
For example...
private void Page_Load(object sender, System.EventArgs e)
{
MyControl control = new MyControl();
// the control.ID is not assigned. Is there a way for the control
// to automatically generate the ID if not assigned???
Form1.Controls.Add(control);
}
....
Mike
Mike