hoe to prevent a control from being executed

  • Thread starter Thread starter bid
  • Start date Start date
B

bid

I have 2 controls on this page as shown below. The first
is a datalist control which contains links to the
particular image gallery (second control) I want to
display. However I only want the datalist to be used
when the page is *not* posted back. I know how to hide
the datalist control and prevent the databinding in the
code behind from being called if the page is not posted
back, but because the control contains code that is
executed at runtime is it not possible to ignore the
control?? Does this make sense?

Many Thanks,

BID


<asp:datalist id=dlVendors runat="server" CssClass="text">
<ItemTemplate>

<%# Container.DataItem("name")%>&nbsp;


<asp:LinkButton ID="lnkbuttonGallery"
CommandName="showGallery" CommandArgument='<%#
Container.DataItem("galleryFolder")%>' Runat="server"
onCommand="linkButton_command">View
Gallery</asp:linkbutton><br />

<ul><li><%# Container.DataItem
("description")%></li></ul>

</ItemTemplate>
</asp:datalist><BR>



<rebex:ImageGallery id="imgGallery" runat="server" />
 
Bid,

One solution is to put the control you want to hide within a panel control
and set the visbilty of the panel control to false.

Reddy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top