F
Frank
Hi,
I've been reading a lot's of Q&A on user controls but none seem to
answer my question. Here it is. I need to add dynamically a user
control, in a htmltablecell, in an asp.net page (done in VB). This is
the way, that I thought, was the wright way doing it:
Dim oTable As New HtmlTable()
Dim oRow As New HtmlTableRow()
Dim oCell As New HtmlTableCell()
Dim uc As Control = Page.LoadControl(ControlName)
oTable = New HtmlTable()
oRow = New HtmlTableRow()
oCell = New HtmlTableCell()
oCell.Controls.Add(uc)
oRow.Controls.Add(oCell)
oTable.Controls.Add(oRow)
Return oTable
The control I try to load contain two ASP:TextBox and one ASP:Button,
this is a login user control to access a restricted section of the web
site.
The control loads fine in the asp.net page when I do it that way, but
when I hit the button, the page do not trigger the event and do only a
postback. Can someone tell me what's missing in the control page and
also in the asp.net page ? Do I need also to add something to handle
postback event for the data in the textbox ?
Thanks
Frank
I've been reading a lot's of Q&A on user controls but none seem to
answer my question. Here it is. I need to add dynamically a user
control, in a htmltablecell, in an asp.net page (done in VB). This is
the way, that I thought, was the wright way doing it:
Dim oTable As New HtmlTable()
Dim oRow As New HtmlTableRow()
Dim oCell As New HtmlTableCell()
Dim uc As Control = Page.LoadControl(ControlName)
oTable = New HtmlTable()
oRow = New HtmlTableRow()
oCell = New HtmlTableCell()
oCell.Controls.Add(uc)
oRow.Controls.Add(oCell)
oTable.Controls.Add(oRow)
Return oTable
The control I try to load contain two ASP:TextBox and one ASP:Button,
this is a login user control to access a restricted section of the web
site.
The control loads fine in the asp.net page when I do it that way, but
when I hit the button, the page do not trigger the event and do only a
postback. Can someone tell me what's missing in the control page and
also in the asp.net page ? Do I need also to add something to handle
postback event for the data in the textbox ?
Thanks
Frank