accessing an asp:label from inside a .dll

Discussion in 'ASP .Net' started by Will, Aug 13, 2003.

  1. Will

    Will Guest

    I'm building a component and I want to access the .Text
    property of an asp:label that is on the asp.net page from
    a method in my assembly file. Can someone tell me how to
    do this? Thanks


    Will
    Will, Aug 13, 2003
    #1
    1. Advertising

  2. Will

    Natty Gur Guest

    Hi,

    if your class is called when request arrive to the server.

    Get the page (the page is the HTTPHandler)
    Page s = ((Page)HttpContext.Current.Handler);
    Get the lable text
    string ss = ((Label)s.FindControl("Label1")).Text;


    Natty Gur, CTO
    Dao2Com Ltd.
    34th Elkalay st. Raanana
    Israel , 43000
    Phone Numbers:
    Office: +972-(0)9-7740261
    Fax: +972-(0)9-7740261
    Mobile: +972-(0)58-888377


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Natty Gur, Aug 13, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kristoffer Arfvidson

    Accessing label inside headertemplates

    Kristoffer Arfvidson, Jan 30, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    330
    Kristoffer Arfvidson
    Jan 30, 2004
  2. bredal Jensen
    Replies:
    2
    Views:
    355
    bredal Jensen
    Apr 22, 2004
  3. CSharpner
    Replies:
    0
    Views:
    1,023
    CSharpner
    Apr 9, 2007
  4. Ashish Bandi via .NET 247

    Accessing TextBox/Label controls inside a Repeater control

    Ashish Bandi via .NET 247, May 14, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    736
    Scott Mitchell [MVP]
    May 14, 2004
  5. Knut Krueger
    Replies:
    8
    Views:
    265
    Knut Krueger
    Aug 20, 2013
Loading...

Share This Page