A
Arpan
Consider the following code:
<form runat="server">
<asp
ataList ID="dlUsers" OnCancelCommand="CancelList"
OnDeleteCommand="DeleteList" OnEditCommand="EditList"
OnItemCommand="ItemList" OnUpdateCommand="UpdateList"
RepeatDirection="horizontal" RepeatLayout="table" runat="server">
<ItemTemplate>
<asp:LinkButton ID="lnkButton" CommandName="Edit" runat="server"><%#
Container.DataItem("FirstName") %></asp:LinkButton>
</ItemTemplate>
<EditItemTemplate>
<asp:LinkButton ID="lnkCancel" CommandName="Cancel" Text="Cancel"
runat="server"/>
<asp:LinkButton ID="lnkUpdate" CommandName="Update" Text="Update"
runat="server"/>
<asp:LinkButton ID="lnkDelete" CommandName="Delete" Text="Delete"
runat="server"/>
</EditItemTemplate>
</asp
ataList>
</form>
The event handlers for the different events are not shown here. As such
the above code works fine but if I add a TextBox control immediately
after the opening <form> tag & keep the rest of the code as it is
<form runat="server">
<asp:TextBox ID="txtFName" Text=<%# Container.DataItem("FirstName") %>
runat="server"/>
<%-- rest of the code comes here as shown above --%>
then the VWD 2005 IDE generates the following error:
'DataItem' is not a member of 'System.Web.UI.Page'
pointing to the line
<asp:LinkButton ID="lnkButton" CommandName="Edit" runat="server"><%#
Container.DataItem("FirstName") %></asp:LinkButton>
but when I run the page in IE6, the same error gets generated but this
time pointing to the line
<asp:TextBox ID="txtValue" Text=<%# Container.DataItem("FirstName") %>
runat="server"/>
First of all, what's causing the above error? Secondly, why is the VWD
IDE & the .NET compiler pointing to 2 different code lines though both
of them are generating the same error?
Thanks,
Arpan
<form runat="server">
<asp

OnDeleteCommand="DeleteList" OnEditCommand="EditList"
OnItemCommand="ItemList" OnUpdateCommand="UpdateList"
RepeatDirection="horizontal" RepeatLayout="table" runat="server">
<ItemTemplate>
<asp:LinkButton ID="lnkButton" CommandName="Edit" runat="server"><%#
Container.DataItem("FirstName") %></asp:LinkButton>
</ItemTemplate>
<EditItemTemplate>
<asp:LinkButton ID="lnkCancel" CommandName="Cancel" Text="Cancel"
runat="server"/>
<asp:LinkButton ID="lnkUpdate" CommandName="Update" Text="Update"
runat="server"/>
<asp:LinkButton ID="lnkDelete" CommandName="Delete" Text="Delete"
runat="server"/>
</EditItemTemplate>
</asp

</form>
The event handlers for the different events are not shown here. As such
the above code works fine but if I add a TextBox control immediately
after the opening <form> tag & keep the rest of the code as it is
<form runat="server">
<asp:TextBox ID="txtFName" Text=<%# Container.DataItem("FirstName") %>
runat="server"/>
<%-- rest of the code comes here as shown above --%>
then the VWD 2005 IDE generates the following error:
'DataItem' is not a member of 'System.Web.UI.Page'
pointing to the line
<asp:LinkButton ID="lnkButton" CommandName="Edit" runat="server"><%#
Container.DataItem("FirstName") %></asp:LinkButton>
but when I run the page in IE6, the same error gets generated but this
time pointing to the line
<asp:TextBox ID="txtValue" Text=<%# Container.DataItem("FirstName") %>
runat="server"/>
First of all, what's causing the above error? Secondly, why is the VWD
IDE & the .NET compiler pointing to 2 different code lines though both
of them are generating the same error?
Thanks,
Arpan