473,385 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 1575
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: modemer | last post by:
Question is as in subject. For example: class BaseClass { public: void func() { do something; } // I don't want this function being overloaded in its inherited class };
3
by: Tony Maresca | last post by:
Hi. I have a class derived from a UserControl, that I want to allow others to derive controls from. I don't want them to design the base class (which is derived from a UserControl). I know that...
3
by: Ryu | last post by:
Hi, May I know how to prevent Javascript from being dlownloaded when the user saves at "View Source"? I have added "js" at IIS's application configuration's mapping and i have added the...
1
by: Stephen Adam | last post by:
Hi there, I have written a custom validation control which checks to see of an input field is not empty and contains only numeric data. I was using a regular expression validation control but...
7
by: Fabio Cannizzo | last post by:
How can I prevent a few lines of code contained in the constructor of a Form from being executed by the Designer? Thanks, Fabio
5
by: EqDev | last post by:
I have a class that is a control derived from UserControl. I want to use serialization and deserialization with this calss but I get an exception "Cannot serialize member...
3
by: sowencheung | last post by:
I attach an Event in document.onkeyup and another event in document.onbeforeunload in onkeyup event, if the condition is satisfied, i will activate sth, then i don't want the onbeforeunload...
10
by: goscottie | last post by:
Hi, Simply put, I have a control in MasterPage and another in content. When the control in content fires off post back, MasterPage also runs and returns post back. I want to control these where...
3
by: Qu0ll | last post by:
In browsers which utilise a JIT JavaScript compiler, are there any factors that may prevent a script from being compiled before it is executed? I don't see any reason why this would be so but I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.