create html and .net controls programatically

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
 
B

bruce barker

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top