473,385 Members | 1,409 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.

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.DataItem,
"title") %>
<br />
<asp:ImageButton runat="server" id="btnDetails"
AlternateText="View Book Details" ImageUrl="details.gif" />
</ItemTemplate>
<SeparatorTemplate>
<hr />
</SeparatorTemplate>
<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 1073

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

Similar topics

0
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...
6
by: freddy | last post by:
I would like to add a to z buttoms at runtime
4
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...
3
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...
3
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...
4
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...
7
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...
0
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...
8
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...

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.