asp.net - Two-way data binding of controls in a user control nested inside a FormView doesn't work -
I am trying to bind two-way data in my user control, which is a FormView template:
and asp: objectDataSource runat = "server" id = "objectdatasource" typename = "web applications 1.data" selectionMedual = "gate item" update Matthew = "updatem" & gt; & Lt; / ASP: ObjectDataSource & gt; & Lt; ASP: formview runat = "server" id = "formview" datasource id = "object datasource" & gt; & Lt; ItemTemplate & gt; & Lt; Uc: WebUserControl1 runat = "server" & gt; & Lt; / UK: WebUser Control1 & gt; & Lt; / ItemTemplate & gt; & Lt; EditItemTemplate & gt; & Lt; Uc: WebUserControl1 runat = "server" & gt; & Lt; / UK: WebUser Control1 & gt; & Lt; / EditItemTemplate & gt; & Lt; / ASP: FormView & gt;
Web user controls:
<% @ Control language = "C #" ...%> & Lt; ASP: Text Box Runat = "Server" id = "Heading Textbox" text = '& lt;% # Bind ("Title")% & gt; & Gt; & Lt; / ASP: text box & gt;
The formview is in visual mode when the binding works fine, but when I call calling
My current solution is, however, cumbersome, however, to use the FormView class in the sub-category and sub-coded controls, & lt;% #% & gt; Instead of using it, implement your own data compulsive logic (taking a data field name from a new property);
The syntax is obvious, the latter code that generates the code is the real culprit because it does not support the nested control scenario.
Comments
Post a Comment