473,725 Members | 2,295 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Abstract code from HTML

I'm going through some samples in a book of mine about Data controls. Some
of the examples though contain code embedded within the html, something I'd
like to avoid.

Can someone look at this and tell me how I could do this from a codebehind
page, not the HTML

<asp:datalist id="test" runat="server">
<ItemTemplate >
<%# Container.DataI tem %>
</ItemTemplate>
</asp:datalist>

As you can see the line I'm interested in getting rid of is <%#
Container.DataI tem %>

Any thoughts?

--Michael
Nov 18 '05 #1
2 1050
Any reason you would like to avoid that? That's one of the most powerful
features of the DataControls - the main reason to use them. Otherwise you
end up doing everything manually...

"Michael" <raterus@localh ost> wrote in message
news:eN******** ******@TK2MSFTN GP12.phx.gbl...
I'm going through some samples in a book of mine about Data controls. Some of the examples though contain code embedded within the html, something I'd like to avoid.

Can someone look at this and tell me how I could do this from a codebehind
page, not the HTML

<asp:datalist id="test" runat="server">
<ItemTemplate >
<%# Container.DataI tem %>
</ItemTemplate>
</asp:datalist>

As you can see the line I'm interested in getting rid of is <%#
Container.DataI tem %>

Any thoughts?

--Michael

Nov 18 '05 #2
Well I do not want to do away with that capability, I'm just wondering if
there is a way I can do it from my codebehind pages. It is kind of like the
old asp way of doing things, and doesn't really separate code from html.
"Marina" <nospam> wrote in message
news:O$******** ******@tk2msftn gp13.phx.gbl...
Any reason you would like to avoid that? That's one of the most powerful
features of the DataControls - the main reason to use them. Otherwise you
end up doing everything manually...

"Michael" <raterus@localh ost> wrote in message
news:eN******** ******@TK2MSFTN GP12.phx.gbl...
I'm going through some samples in a book of mine about Data controls.

Some
of the examples though contain code embedded within the html, something

I'd
like to avoid.

Can someone look at this and tell me how I could do this from a codebehind page, not the HTML

<asp:datalist id="test" runat="server">
<ItemTemplate >
<%# Container.DataI tem %>
</ItemTemplate>
</asp:datalist>

As you can see the line I'm interested in getting rid of is <%#
Container.DataI tem %>

Any thoughts?

--Michael


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
4646
by: Anon Email | last post by:
Hi people, I'm learning about header files in C++. The following is code from Bartosz Milewski: // Code const int maxStack = 16; class IStack
8
2578
by: Pete C | last post by:
In this section of the FAQ: http://www.parashift.com/c++-faq-lite/pointers-to-members.html#faq-33.10 an abstract destructor is given a definition with the cryptic comment "It's faster this way, trust me". Why? Is it faster to type? I notice that the derived classes in that example seem mysteriously not to require a destructor.
4
1662
by: C.E.O. Gargantua | last post by:
I want to have a member property that is common to a set of classes. I designed an abstract class, but when I try to add it to the abstract class, it flags an error in VS.NET. The design ( summarized is like this ) : interface interfaceA { string myMeth();
1
3705
by: Murray Gill | last post by:
Our current solution has a number of ASP.NET pages with very similar functionality. We would like to move the common functions into a base class that inherits from System.Web.UI.Page, and then force the child classes to override certain functions of that class. The best way to do this is to define the base class as "MustInherit" and put "MustOverride" on the functions that must be overridden. However, when we do this, whenever we...
4
1871
by: Eric | last post by:
I was wondering what people thought about the information found at: http://g.oswego.edu/dl/mood/C++AsIDL.html Specifically, I am interested in the following recommendation: ---- Since interface classes cannot be directly instantiated, yet serve as virtual base classes for implementations, the constructors should take no arguments and should be listed as protected. Also, for similar
0
8889
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9179
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9116
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8099
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3228
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.