M
Mike Lowery
I have an ASP.Net page that simply generates a dynamic page using
Response.Write() statements to generate the HTML. This works great except that
one of the things I want to generate is a LinkButton. I know this can be done
by creating a Panel and adding it using Panel.Controls.Add(LinkButton) but the
problem is there are no controls on the page--I want to dynamically add
everything using simple Response.Write statements. But it doesn't look like I
can add a LinkButton this way.
This is an example of what I'm trying to do:
Response.Write("<br>")
Response.Write("This is some text. Next ")
Response.Write("<asp:LinkButton text=""Click"" onclick=""LinkButton_Click()""
/>")
The above doesn't actually create a LinkButton control, which is not entirely
surprising. Controls.Add(LinkButton) doesn't work either because it has to be
within the <Form> area which is why a Panel control is used.
So is there a way to generate a dynamic page like this without having to place
controls on the blank page beforehand?
Response.Write() statements to generate the HTML. This works great except that
one of the things I want to generate is a LinkButton. I know this can be done
by creating a Panel and adding it using Panel.Controls.Add(LinkButton) but the
problem is there are no controls on the page--I want to dynamically add
everything using simple Response.Write statements. But it doesn't look like I
can add a LinkButton this way.
This is an example of what I'm trying to do:
Response.Write("<br>")
Response.Write("This is some text. Next ")
Response.Write("<asp:LinkButton text=""Click"" onclick=""LinkButton_Click()""
/>")
The above doesn't actually create a LinkButton control, which is not entirely
surprising. Controls.Add(LinkButton) doesn't work either because it has to be
within the <Form> area which is why a Panel control is used.
So is there a way to generate a dynamic page like this without having to place
controls on the blank page beforehand?