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

UpdateItem on Form Vive, the binding is lost to me. Because the form view tries to call an update method on the ObjectDataSource which does not have any argument called 'title'.

I tried to solve it by implementing the IBindableTemplate that controls are within my user control, directly in the template (like I entered them declaratively did). However, when UpdateItem calls in editing mode, then container gets passed in the ExtractValues ​​ pattern of that template, now it's text Box is not included in the scene mode!

I have found some questions that are related to this problem but they are dated and they do not give any answers which help me in solving this problem.

How can you think that I can solve this problem? It seems that this is a simple requirement but apparently it is anything but ...

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

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -