• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Another ASP.NET question: LinkButton inside a Repeater... help!

notfred

Lifer
Ok, so I have a specific question this time.

You can see my code from my .aspx file below. That code LOOKS like it runs fine. That is, it creates a ButtonLink with the appropriate text from Container.Data.

However, if I attempt to access the Text property of my LinkButton, the value is always null. I get a sueable value if I leave out the <%# code %> block and use plain text, but if I have that block in my code, I always get a null value, even if I put a plain string in it, like this: <%# "bob" %>.

That will draw a ButtonLink with "bob" as its text, but I will not be able to read that text from my program when the next page loads. I hope that makes sense.

Basically, what I'm trying to do is dynamically create the text for a ButtonLink, and then when someone clicks on that ButtonLink, I want to be able to get that text from it, but I'm getting null values instead.
 
Assuming that you are using an array of string to bind the repeater, try this.
Might not be exactly what you want to do, but it is an example of how to pull out a text value from a control in a repeater.
 
Originally posted by: replicator
Assuming that you are using an array of string to bind the repeater, try this.
Might not be exactly what you want to do, but it is an example of how to pull out a text value from a control in a repeater.

That works, thanks a lot 🙂
 
Back
Top