ASP.net Delete Code Problems?

  • Thread starter Thread starter Trojita
  • Start date Start date
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:Panel ID="UpdateSelect" runat="server">
Catalog ID: <asp:DropDownList ID="UpdateCatNum" DataTextField="Id" DataValueField="Id" runat="server" />
<asp:Button ID="BtnSelect" runat="server" Text="Select" OnClick="UpdateSetup" />
</asp:Panel>
</td><td>
<asp:Panel 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:Panel><br />
</td></tr>
</table>
<hr style="height:1px" />
<h4>Delete</h4>
<asp:DropDownList 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>
 
Back
Top