Saturday, March 24, 2012

TabContainer and FormView

Hello,

I would like to replace our current tab solution with the tab controls found in the ajax control toolkit. I've spent a few days trying to get the tabs to operate in the manner I would like and was wondering if anyone could explain the best way to use TabContainer and FormView controls together.

Basically, I would like to do the following:
<asp:SqlDataSource ... /><asp:FormView ...><EditItemTemplate><ajaxToolkit:TabContainer ...><ajaxToolkit:TabPanel ID="Panel1" ...>...</ajaxToolkit:TabPanel><ajaxToolkit:TabPanel ID="Panel2" ...>...</ajaxToolkit:TabPanel></ajaxToolkit:TabContainer></EditItemTemplate></asp:FormView>

When I build pages based on this - Update and Insert commands fail with "You must declare the scalar variable XXX" errors as the formview cannot find the editing controls inside the TabContainer because it is an INamingContainer. I have tried using multiple FormView controls (one for each tab panel) in concert to update & insert records - however the amount of custom code required is unacceptable.

The solution I choose has to be very reusable as we have hundreds of different pages (like this) in production. At this point I am considering writing my own client side tab control as I would like to come up with a solution as quickly as possible and I've hit a number of dead ends.

Does the ajax control toolkit support using a FormView that contains a TabContainer (am I just missing something)? Are there any good workarounds? Are there plans to add this kind of support in the future?

Any answers or information will greatly help me make my decisions. Thanks in advance,
J. Shane Kunkle

jkunkle@dotnet.itags.org.vt.edu

Any input or advice is appreciated...

Hi Shane,

I think it's not that easy to make works perfectly in your situation now.

Can you try to add a public property on the TabContainer, and take it as a parameter?


I'm sorry - i'm not sure i understand your advice. Are you advising that I should create a class that inherits from TabContainer - what would the new property do?

Thanks again for the assistance,

Shane


Yes, or you can change the its original code since it's provided.

No comments:

Post a Comment