Wierd datalist behavior

Discussion in 'ASP .Net' started by Steve, Jul 8, 2003.

  1. Steve

    Steve Guest

    Hi,

    I have a datalist with some labels embedded inside.

    When the page loads, I can see all my labels contain text. on my
    datalist_onitemcommand i can even reset their text to something else. What i
    can't do is GET the text from the labels i can access. Code is as follows
    (no error messages)

    Protected Sub test(ByVal source As Object, ByVal e As
    System.Web.UI.WebControls.DataListCommandEventArgs)

    If e.Item.ItemType = ListItemType.Item Or _

    e.Item.ItemType = ListItemType.AlternatingItem Then

    Dim s As String

    Dim title As String

    Dim loc As String

    Dim titlelbl As Label

    titlelbl = CType(e.Item.FindControl("MyTitle"), Label) ' Does not give me
    the labels text even though the page shows text in the label

    title = titlelbl.Text

    'If i try something like (titlelbl.text = "Foo") here, it works as expected

    End Sub



    Thanks

    Steve
     
    Steve, Jul 8, 2003
    #1
    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. paul reed

    Wierd Behavior of __doPostBack

    paul reed, Jul 8, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    563
    Bassel Tabbara [MSFT]
    Jul 8, 2003
  2. Nevyn Twyll
    Replies:
    8
    Views:
    1,889
  3. =?Utf-8?B?TWljaGFlbCBMb3VnaHJ5?=

    Wierd behavior with text box postback

    =?Utf-8?B?TWljaGFlbCBMb3VnaHJ5?=, Jun 21, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    566
    =?Utf-8?B?TWljaGFlbCBMb3VnaHJ5?=
    Jun 22, 2005
  4. Qun Cao

    wierd threading behavior

    Qun Cao, Oct 15, 2005, in forum: Python
    Replies:
    6
    Views:
    296
    dcrespo
    Oct 18, 2005
  5. subaruwrx88011

    Wierd Map Behavior

    subaruwrx88011, Feb 20, 2006, in forum: C++
    Replies:
    5
    Views:
    378
    subaruwrx88011
    Feb 20, 2006
Loading...

Share This Page