Bassel Alkhateeb
Bassel Alkhateeb

Reputation: 1584

is there quick way to generate the markup control in asp.net

I want a method that does as follows:

GenerateMarkup(Label l); ==> output is '>asp:label runat="server" ID="label1"/<' and I'm wondering if there's any of-the-shelf method instead of doing it my self.

Upvotes: 0

Views: 118

Answers (2)

Bassel Alkhateeb
Bassel Alkhateeb

Reputation: 1584

I figured no there's not any and I had to write it

Upvotes: 0

Brian Webster
Brian Webster

Reputation: 30855

Yes, there exists code that helps with this. Basically, you're talking about compiling your input into some sort of output.

In your case, you're compiling some input into an .ASCX file (probably with a code-behind).

This code project covers dynamically generating ASP.NET pages and does a pretty good job of explaining the process.

http://www.codeproject.com/KB/XML/xmlxsltransformer.aspx

Upvotes: 1

Related Questions