You will find that a server side control, like a label for instance, renders as a <span></span> tag.
There are (at least) 2 solutions to your answer.
1) Create a panel on your aspx page and name it whatever. In your code behind you can do something like this:
If strName = "test" then
Dim tbl as table
Dim tc as tablecell
Dim tr as tablerow
tr = new tablerow
tc = new tablecell
tc.text = "Whatever"
tr.cells.add(tc)
table.rows.add(tr)
panel1.controls.add(table)
Else
[do something]
End if
If your condition is met a table will be created at runtime, added to the panel and then displayed (and rendered in HTML) as a table.
The old way of doing things (namely code inline with HTML) still works. But what you ahve to do is on your backend you have to define your variable strName and invalidUID with a global scope and give it Public access so:
Public strName as string
Public InvalidUID as string
Private Sub Page_Load.......
End Sub
Then on your front end you do everything just as you have displayed in your post.
"The one language all programmers understand is profanity."
|