VB.NET Dynamic creation of Details View with a web panel
Every time i enter set of values like Group Name,Group Abbreviation,URL in the text boxes and click the save button automatically its saves in the database and for each set of values a new details view has to be generate开发者_StackOverflow中文版d dynamically with a web panel and the header of the web panel should have the value of Group Name. Example:
Group1
Name Group1
Abbreviation G1
URL http://stackoverflow.com
Group2
Name Group2
Abbreviation G2
URL http://stackoverflow.com
A new details view with web panel like the above has to be generated every time the save button is clicked.
Thanks in Advance.
This solution assumes each group is a single database record.
- Use a datasource which pulls all of the IDs for the groups that should be displayed on the page.
- Create a repeater control and set its datasource to the datasource created in step 1
- Add a hidden input field to the content template for the repeater control. Bind it's value to the group's id.
- Add a details view control to the repeater control template.
- Add a datasource to the repeater control template that returns a group record filtered on the hidden input control.
When you submit a new group, make sure to rebind the data on the repeater control created in step 2.
Alternatively, it would be much easier to just use a listview if possible.
精彩评论