Steven,
I am using the Bind expression.
So, are you saying that there is no simple way to retain the entered values
of the controls if the insert fails?
That I must 'find' all the controls and repopulate them myself?
Here is the insert template
<InsertItemTemplate>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td style="width: 15%" valign="top">
Record #</td>
<td style="width: 1%" valign="top">
:</td>
<td style="width: 84%" valign="top">
</td>
</tr>
<tr>
<td style="width: 15%" valign="top">
Entry Date</td>
<td style="width: 1%" valign="top">
:</td>
<td style="width: 84%" valign="top">
<asp:TextBox ID="EntryDateTextBox" runat="server" Text='<%#
Bind("EntryDate") %>' Width="100px"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 15%" valign="top">
Life Areas</td>
<td style="width: 1%" valign="top">
:</td>
<td style="width: 84%" valign="top">
<asp:CheckBoxList ID="LifeAreasCheckBoxList" runat="server"
DataSourceID="odsLifeArea"
DataTextField="LifeAreaDesc" DataValueField="LifeAreaId" RepeatColumns="3">
</asp:CheckBoxList></td>
</tr>
<tr>
<td style="width: 15%" valign="top">
Service</td>
<td style="width: 1%" valign="top">
:</td>
<td style="width: 84%" valign="top">
<asp
ropDownList ID="ServicesDropDownList" runat="server"
DataSourceID="odsServices"
DataTextField="Service" DataValueField="ServiceID" SelectedValue='<%#
Bind("ServiceId") %>' AutoPostBack="True"
OnSelectedIndexChanged="ServicesDropDownList_SelectedIndexChanged">
</asp
ropDownList></td>
</tr>
<tr>
<td style="width: 15%" valign="top">
Service Type</td>
<td style="width: 1%" valign="top">
:</td>
<td style="width: 84%" valign="top">
<asp
ropDownList ID="ddlServiceTypeID" runat="server"
DataSourceID="odsCPN_ServiceType"
DataTextField="ServiceType" DataValueField="ServiceTypeId"
SelectedValue='<%# Bind("ServiceTypeId") %>'>
</asp
ropDownList>
<asp:TextBox ID="txtOtherServiceType" runat="server" Text='<%#
Bind("OtherServiceType") %>' MaxLength="50"
Width="175px"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 15%" valign="top">
Time Spent</td>
<td style="width: 1%" valign="top">
:</td>
<td style="width: 84%" valign="top">
<asp:TextBox ID="txtTimeSpent" runat="server" Text='<%# Bind("TimeSpent")
%>' Width="80px"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 15%; height: 16px" valign="top">
Format</td>
<td style="width: 1%; height: 16px" valign="top">
:</td>
<td style="width: 84%; height: 16px" valign="top">
<asp
ropDownList ID="FormatDropDownList" runat="server" SelectedValue='<%#
Bind("FormatID") %>' AutoPostBack="True"
OnDataBound="FormatDropDownList_DataBound"
OnSelectedIndexChanged="FormatDropDownList_SelectedIndexChanged"
DataSourceID="odsCPN_Format" DataTextField="FormatName"
DataValueField="FormatID">
</asp
ropDownList></td>
</tr>
</table>
<hr />
<asp:GridView ID="gvFormatPartNotes" Width="100%" runat="server"
AutoGenerateColumns="false" DataKeyNames="FormatPartLabel"
BorderColor="Transparent" ShowHeader="false" BorderWidth="0px"
OnRowDataBound ="gvFormatPartNotes_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="Label">
<ItemTemplate>
<asp:Label ID="lblFormatPartLabel" runat="server" Text='<%#
Bind("FormatPartLabel") %>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="15%" />
<HeaderStyle Width="15%" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Notes">
<ItemTemplate>
<asp:TextBox ID="txtFormatPartNotes" runat="server" Text='<%# Bind("Notes")
%>' TextMode="MultiLine" Rows="4" Width="95%"></asp:TextBox>
<asp:RequiredFieldValidator ID="valrFormatPartNotes" runat="server"
ControlToValidate="txtFormatPartNotes"
Display="Dynamic" EnableViewState="False" ErrorMessage="Required"
SetFocusOnError="True"></asp:RequiredFieldValidator>
</ItemTemplate>
<ItemStyle Width="85%" />
<HeaderStyle Width="85%" />
</asp:TemplateField>
</Columns>
</asp:GridView>
<hr />
<asp:Label ID="ClientIdLabel" runat="server" Text='<%# Bind("MemberID") %>'
Visible="False"></asp:Label><br />
<asp:Label ID="EpisodeNumberLabel" runat="server" Text='<%#
Bind("EpisodeNumber") %>' Visible="False"></asp:Label>
<asp:Label ID="AgencyNumberLabel" runat="server" Text='<%#
Bind("AgencyNumber") %>' Visible="False"></asp:Label>
<asp:Label ID="TPIdLabel" runat="server" Text='<%# Bind("TPId") %>'
Visible="False"></asp:Label><br />
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True"
CommandName="Insert"
Text="Insert" OnClick="InsertButton_Click">
</asp:LinkButton>
</InsertItemTemplate>
--
AG
Email: discuss at adhdata dot com