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

Binding a non collection class in ASP.NET

I retreive a class in my code behind and would like to bind it to a
label and some <td>'s.
Idealy I would like to say:
<asp:label .....><%#myClass.publicProperty%></asp:label>
but myClass is retreived in a codebehind sub.
Since the class doesnt implement IEnum or isnt contained in some
container ( its an instance of a single Employee ) I cant use
Label.DataBind().

I have thought to make a sub in my code behind called getEmployee()
then in the asp page say that inherrits from it say:
<%
e = getEmployee()
label1.text = e.name
%>

etc....

but would like to keep with the format of the other data on my page and
bind it.
That being said I would also like to avoid making public properties on
my code behind and and say stuff like <asp:label
....><%#getName()%></asp:label>
or making asignments from my code behind like
Label1.text = e.Name()

Any Ideas?
Thanks

Nov 19 '05 #1
0 867

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

Similar topics

5
by: K | last post by:
I created a collection which is derived from ArrayList and implements IBindingList and ITypedList. Then I bound the DataSource of a data grid into the collection. It could show up the data but...
1
by: | last post by:
Hi I'm sorry for my english... I have a clas that contains a variable number of data stored in a dictionary. The key of the dictionary is a string that defines the name of the field. ( varA ...
2
by: John Sun | last post by:
Hi, Dear gurus, I want to bind my collection to a datagrid. The field names in my object show up in a weird order, and I just wonder how I could reorder those columns . I find some code like...
1
by: Dot net work | last post by:
Hello. I have an interesting data binding scenario: I have a repeater control. It repeats a typical custom web user control. I also have a collection object, and each collection element...
1
by: Demetri | last post by:
Someone posted the following back in June and I am now doing the same thing. I'll just paste what was asked and see if anyone can give us an answer: ...
1
by: Orlando Cavadini | last post by:
Hello I bind a collection of objects with Type AB (Class AB) to a DataGrid control as following: Public Class AB Private m_AA As Integer Private m_AB As Integer Private m_AC As Integer
0
by: Stephajn Craig | last post by:
I've built a customized collection class that has strongly typed objects in it. I have a collection class called LogEntryCollection with LogEntry objects in it. Each LogEntry object has certain...
9
by: Miro | last post by:
VB 2003 and Im still new to vb, so i hope i can explain this as best I can. I have a variable defined as such: ( simple example ) Dim AVariableOfSorts(,) As Object = _ { _ {"Last", "String",...
2
by: Merk | last post by:
I'm new to .NET (using 2.0) and was wondering how to go about binding a collection of custom classes to a DataGrid. The class exposes 5 read-only String properties. I would like for each of...
7
by: Some Bloke | last post by:
I am trying to bind a WPF dependency property to an aggregate of a collection. I've implemented a wrapper around a Dictionary that implements INotifyCollectionChanged to fire the event when items...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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,...
0
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...
0
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...
0
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...
0
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...
0
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,...

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.