create html and .net controls programatically

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi i have a problem.
I want to write html and .net controls dynamically.
Now i do like this:
Response.Write("<html><head>................<td>")
Dim txtBox as New TextBox
txtBox.ID = "myBox"
Me.Controls.Add(myBox)
Response.Write("</td>.......................</html>")

But the textbox is displayed in the bottom of the webform and not between the <td>-tags.

Can someone please solve my problem, I would be very very gratefull

Thanx
 
1) Response.Write, outputs the html when called.

2) Controls do their response.write on thre render event, which is well
after Page_Load, so they appear after your response.writes.

3) generally you cannot mix Response.Write and dynamic controls.

in your case, replace the response.write with dynamic controls.

-- bruce (sqlwork.com)
 
Back
Top