473,651 Members | 2,538 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

at runtime creating of itemtemplates with buttons, text, links, .... in datalist

I am studying the book ASP.NET Data Web Controls. Very interesting, and
I try to put everything in runtime (VB.NET) code instead of in the
page. I got very far but now I am stuck.
I found examples of how to create a TemplateColumn in a DataGrid with a
hyperlink with two parameters at runtime
(http://www.c-sharpcorner.com/Code/20...namically.asp).
But now I want to create a templatecolumn in a datalist with some
htmltext, a dataitem (datafield), an imagebutton and a seperator.
Googling didn't provide me with an answer, apperently when you want to
do this kind of stuff you have to resort to messing around in asp.

The code for the asp-page is:
<form runat="server">
<asp:DataList runat="server" id=dlTitles">
<ItemTemplate >
<strong>Title :</strong<%# DataBinder.Eval (Container.Data Item,
"title") %>
<br />
<asp:ImageButto n runat="server" id="btnDetails "
AlternateText=" View Book Details" ImageUrl="detai ls.gif" />
</ItemTemplate>
<SeparatorTempl ate>
<hr />
</SeparatorTempla te>
<asp:DataList >
</form>

but I want to transorm this into VB.NET runtime code.

Reason is I am learning to make webpages with VB.NET, not with asp. I
think it is better to keep your code together. I am using Visual Studio
2002. I hope it is possible, if it ain't it doesn't give a very mature
impression of VB.NET as webdevelopment environment when you have to
resort to asp occasionally.

Pugi!

Oct 17 '06 #1
0 1088

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

Similar topics

0
1541
by: darkelf | last post by:
Hello I have a aspx page with a two datalist controls. Inside them I have some radio buttons that are created with data binding for the user to choose. It displays a question and user has to choose one of the radio buttons <asp:datalist id="studentList1" runat="server"><ItemTemplate><%# DataBinder.Eval(Container.DataItem, "cQtext") %><asp:RadioButton id="Radio1" Text="0 (Καθόλου)" Checked="False" GroupName='<%#...
6
1391
by: freddy | last post by:
I would like to add a to z buttoms at runtime
4
2928
by: Martin | last post by:
I want to build a data entry form for creating and updating info on something. When I'm first creating an item all the fields need to be editable. There after some fields become readonly. Most of these fields are text based, and I really want to have them appear as a label rather than a text box that is read only. I really want different behaviour for creation, edit and view. I guess I need to write a templated data-bound control.
3
1398
by: ree32 | last post by:
I am creating a page with the usual feature to access a DB and edit. I have the common delete command in the datalist. But I need to create a prompt to display and ask the user again if they really want to delete this record. But I am a bit puzzled as to how to go about this when you are dealing with a datalist delete command. As I don't want to lose the details, of the selected to be deleted item on page reload. Would I need to use...
3
3143
by: Fao, Sean | last post by:
I have a DataGrid that I'm adding CheckBox controls to at runtime (in the code behind) and I'm not sure if I'm doing it correctly. First of all, I noticed that the MyDataGrid.Columns.Add() method expects a DataGridColumn so I instantiated an object of type TemplateColumn that I had hoped I could add a CheckBox to. I soon discovered that the ItemTemplate property of the TemplateColumn class returned an object that had implemented the...
4
1409
by: Ron | last post by:
I want to create 10 buttons on a form at runtime, the code below is only creating one button labeled 1. Any idea what I am doing wrong? Public Class Form1 Public code(10) As String Public buttons(10) As Button Const buttonwh As Integer = 30 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
7
11343
by: Matt | last post by:
Hi all, I'm trying to create a system where it reads a number of records from a database and then creates a row in the GUI that contains a single field from the database and a button that has a reference to the record. This way, once the task has been accomplished, the button can be pressed next to the field and a time-stamp is placed into the database. Can anyone point me in the direction of either a tutorial or
0
930
by: No Master | last post by:
Hi I want to create a dropdownlist at runtime, add it to my datatable in my dataset, then pass the whole dataset in to a session and display it in my datalist. The dropdownlist will be unique for each row in the table of the dataset. Using .NET for web development One problem is I don't know how to refer to the Row within the asp:DropDownList - as shown below .aspx code <datalist> <datatemplate> <asp:DropDownList id=ddl...
8
10817
by: GaryDean | last post by:
I have a Wizard page and need to affect the next and previous buttons from my code-behind. I've googled around and found two solutions, and neither appear to work. I can access the SideBarList steps successfully with the following code... Control myContainer = (Control)Wizard1.FindControl("SideBarContainer"); DataList mySideBarList = (DataList)myContainer.FindControl("SideBarList");
0
8275
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
8792
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
7294
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...
1
6157
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5605
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
4143
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...
0
4280
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1905
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1585
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.