Re: Programatically create ASP.NET binding
Dimitrios Toulakis <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.advanced |
|---|---|
| Message-ID | <3683164.776291232953649676.JavaMail.servlet@kundenserver> |
Setting the DataSource first appropriately in your code. There you use the DataTextField property for showing the text, and DataValueField property for the "real" name of your data source. Plus setting the "AutoPostback" to true. Declare also the "SelectedIndexChanged" event and hook this up to your dynamically created control. HTH Dimi >Does anyone know how to programatically create an ASP.net binding? > >What I want to do is bind to the Text property of a programatically created >DropDownList (and ultimately other controls). I need bi-directional binding >so that when the user changes the values it propagates back. > >In the .aspx page I would use something like: >Text="<%#SomeObject.SomeProperty%>" > >Setting that exact string to the Text object in the .aspx.cs file gives an >error and I can't figure out another way to do this. > >Any suggestions are greatly appreciated. > >Thanks, >-Mont > >=================================== >View archives and manage your subscription(s) at >http://peach.ease.lsoft.com/archives =================================== View archives and manage your subscription(s) at http://peach.ease.lsoft.com/archives