Jump to content
  • Advertisement
Sign in to follow this  

[web] [asp.NET] dynamic controls help

This topic is 4255 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Okay I just asked a question about adding newlines between controls that I'm adding dynamically, but it turns out that I need more help than just putting newlines between them. Let me give you a better run-down of what I'm trying to accomplish. I want to load an xml file containing nodes with two child nodes, a title and some text. I want to make a list of linkbuttons to represent these nodes, and when you click the linkbutton it displays the text from that node. I have already tried a few ways of doing this, but all of them lead to some kind of an error. What I've figured so far: Each linkbutton needs to know what node it represents, so that when the OnClick event is called it can display the correct node. I tried making a class inheriting from the linkbutton class and adding an nodeID variable that it can use to index the array of nodes. Then in the OnClick method I cast the sender object to my new class, and use the nodeID variable. But when I do that it gives me an invalid cast exception. I'm sure theres an easy way to do this that I'm just not seeing. Sounds like it would be a pretty common necessity for sites such as forums, blogs etc. Well any help will be appreciated. Bender Edit: I think the functionality I'm looking for might be in the <asp:repeater> control. Looking into that now. [Edited by - glBender on April 19, 2007 9:24:31 PM]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!