
February 5th, 2003, 04:23 PM
|
|
Junior Member
|
|
Join Date: Jan 2003
Posts: 5
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Assigning Panel control "Visible" attribute within a bound datalist
Hello, I'm working on an article CMS system and have hit a wall. The articles have categories and I'm trying to prevent someone from deleting a category that has articles associated with it.
I've set up a bound datalist, and am attempting to have an EditItemTemplate present one of two options, depending on whether or not the category is "empty" or not. If it is, it will present a delete confirmation. If not, it will present a message telling the user to delete or reassociate the article(s) with another category.
I'm attempting to set this up by using panel controls within the EditItemTemplate of a DataList:
PHP Code:
<EditItemTemplate>
<asp:panel id="pnlConfirmDelete" runat="server">
Confirmation message here.
</asp:panel>
<asp:panel id="pnlDeleteError" runat="server">
Error message here.
</asp:panel>
</EditItemTemplate>
Any idea how to set these panels to be visible or not when the Edit command is requested? I've tried something like this to no avail:
PHP Code:
If intArticleCount > 0 Then
e.Item.FindControl( "pnlConfirmDelete" ).Visible = False
e.Item.FindControl( "pnlDeleteError" ).Visible = True
Else
e.Item.FindControl( "pnlConfirmDelete" ).Visible = True
e.Item.FindControl( "pnlDeleteError" ).Visible = False
End If
|