How can I add HTML tags to aspx file from the code-behind?
When I create new object
Graph MyChart = new Graph();
I want it add a tag for this object
<Graph id="MyChart" runat="server" Height="500px"></Graph>
What is the solution for that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not sure if we are talking about a .NET control or HTML on the fly, I give examples of both.
This will add it to the end of the page, but I suggest you use a
PlaceHolderto control where it gets added:PlaceHolderexample: