Results 1 to 4 of 4

Thread: Label not visible in the browser

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2003
    Location
    india
    Posts
    273

    Question Label not visible in the browser

    I am tring to create a runtime Label and some text in the label for that i am trying the following code.In the browser the following code display nothing.please tell me the necesssary steps should i follow.

    Label lblError=new Label();
    lblError.Visible=true;
    lblError.Text="Display Error";

    Help



    PPCC
    Last edited by PPCC; Aug 29th, 2003 at 02:05 AM.

  2. #2
    Lively Member
    Join Date
    Jan 2001
    Location
    Worcester, MA
    Posts
    77
    You need to add it to something on the page. Try placing a placeholder where you want it to go then you can just do:

    Label lblError=new Label();
    lblError.Visible=true;
    lblError.Text="Display Error";
    Placeholder1.controls.add(lblError)
    "Find all you need in your mind if you take the time" -DT

  3. #3
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Also, if you do not want to use a placeholder, you can add it to the Form object's control collection. This is because you are adding a server control, which as expects, executes on the server.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    May 2003
    Location
    india
    Posts
    273

    Talking Ya done it

    Thanks Cin03, it works

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width