How to bind a class property to a textbox

C

cbtechlists

I have a person class that has a 'name' property. I want to bind that
property to a textbox on an ASP.NET form.

In a winform, I can do something like this:

dim nameBinding as binding = new binding("text", me.person, "name",
true)
me.nameTB.databindings.add(nameBinding)

Is there an equivalent in ASP.NET?

Thanks,

Chris
 
C

cbtechlists

Thanks, Eliyahu! Is there any way to do this in the code behind?



<asp:textbox runat="server" text=<%# person.Name %> />

Look here for details:http://msdn2.microsoft.com/en-us/library/bda9bbfx(VS..71).aspx

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]http://msmvps.com/blogs/egoldinhttp://usableasp.net




I have a person class that has a 'name' property. I want to bind that
property to a textbox on an ASP.NET form.
In a winform, I can do something like this:
dim nameBinding as binding = new binding("text", me.person, "name",
true)
me.nameTB.databindings.add(nameBinding)
Is there an equivalent in ASP.NET?

Chris- Hide quoted text -

- Show quoted text -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top