Advertisement

05.08.2008 at 11:17AM PDT, ID: 23387078 | Points: 500
[x]
Attachment Details

AJAX Update Panels inside an ASP Formview Control: Get the "XXX is already declared as XXX" message because of Insert/Edit Templates

Asked by synapse88 in Asynchronous Javascript and XML (AJAX), .NET Framework 2.0, WebApplications

Tags: Javascript, AJAX

So I had a working Formview page, with Edit and Insert modes, each with identical controls (text, labels etc). I decided I wanted to use an Update Panel to update a Text Box with today's date based on the selection of a drop down.

Normally with a FormView I can normally have the same Text Box in both the Edit Template and the Insert Template, with the same ID name (txtDate) and everything with no problem....which is helpful/needed for databinding and code-behind methods.

But now when I place controls inside the 2 update panel in both Edit and Insert Templates, I get a "txtDate is already declared as txtDate" message for each control which is a contained in both (Insert Template, Edit Template)  update panels.

Is there a viable workaround for this? I tried changing the name of the Edit Template txtDate control to txtDate2 (and ALL refrences to it), but the databinding doesn't work when I do that (since after making the change I have two different controls bound to the same data element). Any input would be appreciated.Start Free Trial
[+][-]05.09.2008 at 05:14AM PDT, ID: 21531964

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.22.2008 at 03:44AM PDT, ID: 22057790

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628