Panel - Dyamic Controls

A

asadikhan

Hi,

I am just studying for MCAD and I came across this piece of code:
-------------------------------------------------
LiteralControl lcExpenseCaption = new LiteralControl();
lcExpenseCaption.Text = String.Format("Travel Expense for Day - {0} ",
i);
TextBox txtExpense = new TextBox();
txtExpense.ID = String.Format("Expense{0}", i);
HtmlControl lcBreak = new HtmlGenericControl("br");
-------------------------------------------------

What I don't know is how to remember or recognize that a break is an
object of the HtmlControl, HtmlGenericControl, the textbox is simply an
object of Textbox class, a literal belongs to a class named
LiteralControl?

I mean these lines essentially create a label, a textbox and a break.
And the way they accomplish these three things are three completely
different methods. Isn't there a general way these things are ordered
and named? Aren't the classes in some form of hierarchy so I don't have
to remember the differences between creating a textbox, a label, a
break, etc. etc.
 
K

Kevin Spencer

Isn't there a general way these things are ordered
and named?

There sure is.
Aren't the classes in some form of hierarchy so I don't have
to remember the differences between creating a textbox, a label, a
break, etc. etc.

Yes they are.

I would recommend downloading, installing, and studying the .Net Framework
SDK:

http://www.microsoft.com/downloads/...A6-3647-4070-9F41-A333C6B9181D&displaylang=en

A certtificate isn't worth much unless you study for it. Even then, the
certificate isn't worth anything; the studying is.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top