473,379 Members | 1,312 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,379 software developers and data experts.

Custom DataList Control

I 've managed a workaround for the following problem but that in turn has
caused more problems so i'm looking for a better answer if possible.

Currently i have a data list which is required to display two table cells of
information. The first one being the first Field of a dataset and the second
with a textbox of the name of the second field (on the same row)

For example "select names, hobby from tblPeople"
would display

Bobby (a textbox named ASP)
Joe (a textbox named Java)

The main problem i've faced is when i use the following code an error is
returned stating "Container" not declared for the second DataBinder() line.

Code:

<itemtemplate>
<%# "<b>" _
& DataBinder.Eval(Contain.DataItem, "names") _
& "</b>"
%>
<input type = "textbox" name = "<%DataBinder.Eval(Contain.DataItem,
"hobby")%>">
</itemtemplate>
Using the following workaround i've managed to bypass this but encouter
another issue:

Code:

<itemtemplate>
<%# "<b>" _
& DataBinder.Eval(Container.DataItem, "Address Line") _
& "</td><td><input type=textbox name=" _
& DataBinder.Eval(Container.DataItem, "Address Value") _
& ">"
%>
</b>
</itemtemplate>
The problem is that i need to be able to custom validate these fields and as
they are dynamically drawn out VS 2003 kicks up a fuss when i try too(as
they haven't been created yet).

Hope thats not too confusing a description.

TIA
Matt
Nov 19 '05 #1
0 951

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

Similar topics

2
by: Ken R. | last post by:
Hello all, I am relatively new to python but I am having an issue with custom sort functions.. I am trying to sort a list of lists or tuples with arbitrary ascending or descending sorts. For...
1
by: | last post by:
Hi, I posted a message a while ago about programatically databinding and got a response that did not make sense to me. Here's a brief description of what I want to do. If I create a regular...
1
by: Barry | last post by:
I have a DataList in which I need to dynamically load a SelectedItemTemplate. However, I ended up turning the template into a User Control because I needed code behind. The reason I did this was...
5
by: Richard Payne | last post by:
Hi This is probably a newbie question but I can't seem to find a clear answer to the problem I have. I have created a Custom Validator control on my webform that works fine, but when I put...
10
by: Bharat | last post by:
Hi Folks, Suppose I have two link button on a page (say lnkBtn1 and lnkBtn2). On the click event of the lnkbtn1 I have to add a dynamically created control. And On the click event of the lnkBtn2 I...
6
by: tshad | last post by:
I need to get to a status label I have on my footer section of my datalist. There is no event happening that would go to the footer. I am just doing some processing and want to update the label...
1
by: Pavan | last post by:
Hi All, I have created a custom DataList web custom control, which populates data from a dataset. This dataset is available at runtime and exposed as property by my custom control. During...
2
by: Hans Merkl | last post by:
Hi, I am trying to use a user control as EditItemTemplate in a DataList. It loads fine but I can't figure out how to bind to the data of the DataList. Here is what I have got so far: ...
3
by: Adam | last post by:
I cannot figure out what I'm doing wrong, can someone shed some light on this for me? I have the following code inside a working user control (MyControl): Public Event SubmitClick(ByVal sender...
2
by: Charlie | last post by:
Hi: When using templated columns in DataList, ASP.net server controls can be inserted. Rather than using the base ASP.net server controls, I would like to use one of my own custom server...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.