Click here to Skip to main content
15,913,027 members
Home / Discussions / C#
   

C#

 
Questiona public class... for what? Pin
Rickard Andersson2031-Jan-02 22:41
Rickard Andersson2031-Jan-02 22:41 
AnswerRe: a public class... for what? Pin
Peter Stephens1-Feb-02 8:06
Peter Stephens1-Feb-02 8:06 
GeneralProblem/bug in .net class library Pin
Mikael Edlund31-Jan-02 10:13
Mikael Edlund31-Jan-02 10:13 
GeneralRe: Problem/bug in .net class library Pin
James T. Johnson31-Jan-02 10:39
James T. Johnson31-Jan-02 10:39 
GeneralRe: Problem/bug in .net class library Pin
31-Jan-02 22:52
suss31-Jan-02 22:52 
GeneralRe: Problem/bug in .net class library Pin
31-Jan-02 23:37
suss31-Jan-02 23:37 
QuestionHow do I use ParseControl? Pin
31-Jan-02 10:04
suss31-Jan-02 10:04 
AnswerRe: How do I use ParseControl? Pin
James T. Johnson31-Jan-02 10:36
James T. Johnson31-Jan-02 10:36 
ParseControl is a method of TemplateControl which is an abstract class that Page inherits from. You use ParseControl when you want to add a new ASP.NET server control to the page.

void Page_Load(object sender, System.EventArgs e)
{
  Button myButton = (Button)ParseControl("<asp:button runat = \"server\"/>");
  myButton.Text = "Hello World!";
  Controls.Add(myButton);
}


A literal control is used when you wish to insert HTML into your page, not ASP.NET server controls.

If you want to put HTML in your website, use Controls.Add(new LiteralControl(myHTML));

If you want to add a new server control (all server controls have runat="server" in the HTML for them) use the first code example.

HTH,

James


Sonork ID: 100.11138 - Hasaki
"Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. Big Grin | :-D " - Michael P Butler Jan. 18, 2002
GeneralRe: Thanks but... Pin
31-Jan-02 10:58
suss31-Jan-02 10:58 
GeneralRe: Thanks but... Pin
James T. Johnson31-Jan-02 11:10
James T. Johnson31-Jan-02 11:10 
GeneralRe: Thanks but... Pin
31-Jan-02 11:33
suss31-Jan-02 11:33 
GeneralRe: Thanks but... Pin
James T. Johnson31-Jan-02 14:36
James T. Johnson31-Jan-02 14:36 
GeneralThank you!! Pin
1-Feb-02 11:09
suss1-Feb-02 11:09 
GeneralJag Arrays again, sorry Pin
31-Jan-02 0:25
suss31-Jan-02 0:25 
GeneralRe: Jag Arrays again, sorry Pin
James T. Johnson31-Jan-02 9:15
James T. Johnson31-Jan-02 9:15 
GeneralJag Arrays Pin
30-Jan-02 1:54
suss30-Jan-02 1:54 
GeneralRe: Jag Arrays Pin
rchiav30-Jan-02 5:17
rchiav30-Jan-02 5:17 
GeneralRe: Jag Arrays Pin
James T. Johnson30-Jan-02 9:36
James T. Johnson30-Jan-02 9:36 
GeneralRe: Jag Arrays Pin
rchiav30-Jan-02 9:54
rchiav30-Jan-02 9:54 
GeneralRe: Jag Arrays Pin
30-Jan-02 20:45
suss30-Jan-02 20:45 
GeneralSockets Pin
rchiav29-Jan-02 17:48
rchiav29-Jan-02 17:48 
GeneralRe: Sockets Pin
James T. Johnson30-Jan-02 9:38
James T. Johnson30-Jan-02 9:38 
GeneralRemove title bar Pin
paulb29-Jan-02 13:54
paulb29-Jan-02 13:54 
GeneralRe: Remove title bar Pin
James T. Johnson29-Jan-02 17:45
James T. Johnson29-Jan-02 17:45 
GeneralThe Final Version Pin
Fayez Al-Naddaf29-Jan-02 10:14
Fayez Al-Naddaf29-Jan-02 10:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.