Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Wierd datalist behavior

Thread Tools

Wierd datalist behavior

Posts: n/a

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



Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wierd Map Behavior subaruwrx88011 C++ 5 02-20-2006 10:06 PM
wierd threading behavior Qun Cao Python 6 10-18-2005 08:41 PM
Wierd behavior with text box postback =?Utf-8?B?TWljaGFlbCBMb3VnaHJ5?= ASP .Net 3 06-22-2005 02:15 PM
Setting up a datalist control - Item_DataBound for a datalist in a datalist Nevyn Twyll ASP .Net 8 09-09-2004 10:13 PM
Wierd Behavior of __doPostBack paul reed ASP .Net 1 07-08-2003 04:26 PM