Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataBinding
Message
De
26/03/2003 00:32:43
 
 
À
25/03/2003 13:37:45
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Divers
Thread ID:
00769841
Message ID:
00770103
Vues:
22
Nevermind ... I decided not to muck with events and I just have a DataPostBack() method on the Page. I created an interface, IMyBindable, that has a DataPostBack() method, which I use (obviously) for Bindable controls. The Page.DataPostBack() method simply spins through all it's controls and calls the DataPostBack() method on controls that are IMyBindable.

So I guess no one needs to reply to this post. =)

~~Bonnie


>Hey gang,
>
>I've got the idea of DataBinding in a Web page down, at least as far as setting the .Text property of a control equal to the bound table's column. I'm trying to figure out how to generically do the opposite of that, to save the user's changes in .Text back to it's bound column in the table.
>
>In the first case, I know that that if I say Page.DataBind(), it fires off a DataBinding event to each child control on the page, which I can then handle in each control's base class to set it's .Text property to the bound column. I'm doing this and it works splendidly.
>
>Now what I'm trying to do is the opposite. I want to have a Page.DataPostBack() method that I can call from the Form's Load(), that will in effect do the same thing ... fire off some kind of event (that I'm sure I'll have to create) for each of the child controls on the page. My question is how does the Page.DataBind() method do this? Is this overkill on my part (to create an event) or should my new Page.DataPostBack() method simply spin through each of the page's child controls and call a method on them? I guess what I'm asking is how is the Page.DataBind() method tied in with the Control.DataBinding event?
>
>I hope this question makes sense (I know, clear as mud probably ... <g>)
>
>~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform