How to bind a class property to a textbox

  • Thread starter Thread starter cbtechlists
  • Start date Start date
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
 
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 -
 
Back
Top