471,075 Members | 916 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,075 software developers and data experts.

hoe to prevent a control from being executed

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" />
Nov 17 '05 #1
1 1514
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
"bid" <bi****@hotmail.com> wrote in message
news:00****************************@phx.gbl...
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" />

Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Ryu | last post: by
10 posts views Thread by goscottie | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.