S
Swetha
Hello
I have a FormView with InsertItem, EditItem and ItemTemplates.
Depending on from where the page is accessed, the page opens up in
either Insert, Edit or ReadOnly mode. The FormView is databound. The
problem I have is when the page opens up in Insert Mode. I require one
of the fields to be populated with a databound field, but for some some
reason this doesnt happen in the InsertMode.
Following is the FormView:
<asp:FormView ID="FormView1" runat="server"
DataSourceID="SqlDataSource1" >
<EditItemTemplate>
Client Name:
<asp:Label ID="nameLabel" runat="server" Text='<%#
Bind("name") %>'></asp:Label><br />
<asp:LinkButton ID="UpdateButton" runat="server"
CausesValidation="True" CommandName="Update"
Text="Update"></asp:LinkButton
</EditItemTemplate>
<InsertItemTemplate>
Client Name:
<asp:Label ID="nameLabel" runat="server" Text='<%#
Bind("name") %>'></asp:Label><br />
<asp:LinkButton ID="InsertButton" runat="server"
CausesValidation="True" CommandName="Insert"
Text="Insert"></asp:LinkButton>
</InsertItemTemplate>
<ItemTemplate>
Client Name:
<asp:Label ID="nameLabel" runat="server" Text='<%#
Bind("name") %>'></asp:Label><br />
<asp:LinkButton ID="EditButton" runat="server"
CommandName="Edit" Text="Modify"></asp:LinkButton>
</ItemTemplate>
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings
lus32ConnectionString %>"
InsertCommand="addNew" InsertCommandType="StoredProcedure"
SelectCommand="select clientID, name where packageID = @packageID">
<SelectParameters>
<asp:QueryStringParameter Name="packageID"
QueryStringField="packageID" Type="Int32" />
</SelectParameters>
<InsertParameters>
<asp
arameter Name="clientID" Type="Int32" />
</InsertParameters>
</asp:SqlDataSource>
The binding in the InsertItemTemplate does not happen. Can someone
explain why this is happening? And how can I work around this?
I have a FormView with InsertItem, EditItem and ItemTemplates.
Depending on from where the page is accessed, the page opens up in
either Insert, Edit or ReadOnly mode. The FormView is databound. The
problem I have is when the page opens up in Insert Mode. I require one
of the fields to be populated with a databound field, but for some some
reason this doesnt happen in the InsertMode.
Following is the FormView:
<asp:FormView ID="FormView1" runat="server"
DataSourceID="SqlDataSource1" >
<EditItemTemplate>
Client Name:
<asp:Label ID="nameLabel" runat="server" Text='<%#
Bind("name") %>'></asp:Label><br />
<asp:LinkButton ID="UpdateButton" runat="server"
CausesValidation="True" CommandName="Update"
Text="Update"></asp:LinkButton
</EditItemTemplate>
<InsertItemTemplate>
Client Name:
<asp:Label ID="nameLabel" runat="server" Text='<%#
Bind("name") %>'></asp:Label><br />
<asp:LinkButton ID="InsertButton" runat="server"
CausesValidation="True" CommandName="Insert"
Text="Insert"></asp:LinkButton>
</InsertItemTemplate>
<ItemTemplate>
Client Name:
<asp:Label ID="nameLabel" runat="server" Text='<%#
Bind("name") %>'></asp:Label><br />
<asp:LinkButton ID="EditButton" runat="server"
CommandName="Edit" Text="Modify"></asp:LinkButton>
</ItemTemplate>
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings
InsertCommand="addNew" InsertCommandType="StoredProcedure"
SelectCommand="select clientID, name where packageID = @packageID">
<SelectParameters>
<asp:QueryStringParameter Name="packageID"
QueryStringField="packageID" Type="Int32" />
</SelectParameters>
<InsertParameters>
<asp
</InsertParameters>
</asp:SqlDataSource>
The binding in the InsertItemTemplate does not happen. Can someone
explain why this is happening? And how can I work around this?