Generating ASP.NET Code From Code

rcombs4

Well-known member
Joined
Aug 6, 2008
Messages
189
Programming Experience
3-5
Does anyone have any insight on how to systematically generate ASP.NET code for WebControls objects?

I would love the ability to take the following following
VB.NET:
Dim lblTest As New Label
        lblTest.ID = "lblTest"
        lblTest.Text = "Some Text Here"
        lblTest.CssClass = "myCSSClass"

Then have a function that would generate:
VB.NET:
<asp:Label id="lblTest" runat="server" CssClass="myCSSClass" Text="Some Text Here" />

I know I can make the function output the desired result, but it just seems like there would be functionality similar to RendorControl() but instead of generating the HTML it would generate the ASP.NET.

Thanks
 
Back
Top