473,804 Members | 4,288 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamically writing Templates for DataList

stb
Hi.
Is it possible to write inline Templates for a DataList dynamically in the
HTML code, based on the DataSet that is bound to the DataList?

Anyone know how?
Nov 18 '05 #1
2 1315
Hi,

You can dynamically load templates from files based on the conditions, using
LoadTemplate(). Please refer to http://tinyurl.com/5e2xr for an example.

"stb" <si***@intisi.f snet.co.uk> wrote in message
news:ek******** *****@tk2msftng p13.phx.gbl...
Hi.
Is it possible to write inline Templates for a DataList dynamically in the
HTML code, based on the DataSet that is bound to the DataList?

Anyone know how?

Nov 18 '05 #2
stb
Is there any way of doing it without writing and loading a file, maybe
using the ItemTemplate property and the TemplateBuilder class?

"Shiva" <sh******@onlin e.excite.com> wrote in message
news:eG******** *****@TK2MSFTNG P12.phx.gbl...
Hi,

You can dynamically load templates from files based on the conditions, using LoadTemplate(). Please refer to http://tinyurl.com/5e2xr for an example.

"stb" <si***@intisi.f snet.co.uk> wrote in message
news:ek******** *****@tk2msftng p13.phx.gbl...
Hi.
Is it possible to write inline Templates for a DataList dynamically in the
HTML code, based on the DataSet that is bound to the DataList?

Anyone know how?

Nov 18 '05 #3

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

Similar topics

39
6570
by: Randell D. | last post by:
Folks, I'm sure this can be done legally, and not thru tricks of the trade - I hope someone can help. I'm writing a 'tool' (a function) which can be used generically in any of my projects. When it completes, it can call a success, or a failure function. The names of these success, or failure functions will differ, and I'd like to know how I can pass the name of a function to my tool, and how my tool can call the function, using that...
2
424
by: Andrew Wied | last post by:
Hello Please excuse me if this come in as a duplicate. Here is the situation that I am having: I am pulling data from a database and writing it out as a list. Next to each item that I write, I want to make a linkbutton control which will allow you to invalidate the database record. Since I don't know how many records will be present, I need to have all of the linkbuttons access the same event. The trick is to know WHICH linkbutton was...
0
1222
by: Gaurav Gargate | last post by:
Hi Group, I am creating a ASP.NET (C#) project. I am creating a datalist with some dynamically generated text boxes in the edit template. I have the datalist control on the form. The text box is written on the form at run time. Using Response.Write() on the EditTemplate I write the HTML code required for the text box along with the data and the ID for the text box.
2
1354
by: Nathan Sokalski | last post by:
I have a page on which I want to display several sections each of which contain a list of names. I have two database tables, one of which contains the section headings, and the other contains the names and which section they belong to. I would like to use databinding to display this information, preferably using DataLists. However, because the number of sections will vary, the DataLists will need to be added dynamically. But because...
3
1705
by: Jon Paal | last post by:
how do I load controls to the templates for the DataList control. <asp:datalist id="dl1" runat="server" > <ItemTemplate> " how to load control(s) here ????" </ItemTemplate> </asp:datalist>
7
2154
by: Nathan Sokalski | last post by:
I have a page which I dynamically add several usercontrols (*.ascx files) to using the following code: Public Sub Refresh() For Each section As DataRow In Me.GetSections().Rows CType(Me.FindControl("admin" & CStr(section("buttontext")).Replace(" ", "")), adminsection2).RefreshSection() Next End Sub
4
2206
by: .Net Sports | last post by:
I need to dynamically assign a datalist attribute upon a helper function receiving data from a querystring. If a user picks a certain region, i need the datalist to display its back color, or any of its other objects , as a certain color or css style <HeaderStyle BackColor="<%= ssponcont %>"</HeaderStyle> ....doesnot work as a Parser error renders: Content ('<HeaderStyle
3
5821
by: Peter | last post by:
I have a datalist and I want the datalist to grow from no records to fill the screen, but not go beyond the screen height. How do I do that? I've implemented the scroll bars but it works only for the fixed height. I want the datalist to grow and shrink and never go beyond the current screen height, if the data can not fit in one screen I want to implement scroll bars, but only scroll the datalist not any other parts. Thank You
2
4365
by: djnokturnal | last post by:
Hey guys / gals, First time posting and of course I am sure it is something that has been answered 100 times but for some reason I just cant find the answer :) First off here is the structure of the xml: <Stats> <Structure> <Column DisplayName="GP" FieldName="GamesPlayed" Priority="1" /> <Column DisplayName="G" FieldName="Goals" Priority="2" />
0
9589
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10593
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10340
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
10329
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
10085
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
9163
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
5527
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3830
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3000
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.