T
Trojita
Guest
The problem we are having is that we have a delete button on our site with a drop down box that is supposed to populate with items to delete. Nothing is populating in the drop down box and when we hit delete we get an error saying:
System.NullReferenceException: Object reference not set to an instance of an object.
This is what the code looks like at the moment but we cannot find what is wrong with it and it has us stumped.
<hr style="height:1px" />
<h4>Update</h4>
<table>
<tr><td>
<asp
anel ID="UpdateSelect" runat="server">
Catalog ID: <asp
ropDownList ID="UpdateCatNum" DataTextField="Id" DataValueField="Id" runat="server" />
<asp:Button ID="BtnSelect" runat="server" Text="Select" OnClick="UpdateSetup" />
</asp
anel>
</td><td>
<asp
anel ID="UpdateTextBoxes" Visible="false" runat="server">
Category: <asp:TextBox ID="UpdateCategory" runat="server" /><br />
Style: <asp:TextBox ID="UpdateStyle" runat="server" /><br />
Brand: <asp:TextBox ID="UpdateBrand" runat="server" /><br />
Color: <asp:TextBox ID="UpdateColor" runat="server" /><br />
Magnitude: <asp:TextBox ID="UpdateMag" runat="server" /><br />
Size: <asp:TextBox ID="UpdateSize" runat="server" /><br />
Price: <asp:TextBox ID="UpdatePrice" runat="server" /><br />
Link: <asp:TextBox ID="UpdateLink" runat="server" /><br />
<asp:Button ID="UpdateButton" OnCommand="Catalog_Function" CommandName="Update" Text="Update" runat="server" /><br />
<asp:Button ID="CancelUpdateButton" OnClick="UpdateReset" Text="Select Other" runat="server" />
</asp
anel><br />
</td></tr>
</table>
<hr style="height:1px" />
<h4>Delete</h4>
<asp
ropDownList ID="DeleteCatNum" DataTextField="Id" DataValueField="Id" runat="server" /><br />
<asp:Button ID="BtnDelete" OnCommand="Catalog_Function" CommandName="Delete" Text="Delete" runat="server" />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
System.NullReferenceException: Object reference not set to an instance of an object.
This is what the code looks like at the moment but we cannot find what is wrong with it and it has us stumped.
<hr style="height:1px" />
<h4>Update</h4>
<table>
<tr><td>
<asp

Catalog ID: <asp

<asp:Button ID="BtnSelect" runat="server" Text="Select" OnClick="UpdateSetup" />
</asp

</td><td>
<asp

Category: <asp:TextBox ID="UpdateCategory" runat="server" /><br />
Style: <asp:TextBox ID="UpdateStyle" runat="server" /><br />
Brand: <asp:TextBox ID="UpdateBrand" runat="server" /><br />
Color: <asp:TextBox ID="UpdateColor" runat="server" /><br />
Magnitude: <asp:TextBox ID="UpdateMag" runat="server" /><br />
Size: <asp:TextBox ID="UpdateSize" runat="server" /><br />
Price: <asp:TextBox ID="UpdatePrice" runat="server" /><br />
Link: <asp:TextBox ID="UpdateLink" runat="server" /><br />
<asp:Button ID="UpdateButton" OnCommand="Catalog_Function" CommandName="Update" Text="Update" runat="server" /><br />
<asp:Button ID="CancelUpdateButton" OnClick="UpdateReset" Text="Select Other" runat="server" />
</asp

</td></tr>
</table>
<hr style="height:1px" />
<h4>Delete</h4>
<asp

<asp:Button ID="BtnDelete" OnCommand="Catalog_Function" CommandName="Delete" Text="Delete" runat="server" />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>