No two-way databinding

G

Guest

I have a web page with a formview, and a multiview in the formview. When I
databind the values inside the multiview views, there is no option for
two-way databinding. The form populates fine, but when it calls the update
method, it calls it with no parameters.

Is there just no support for two-way databinding inside these controls, or
is there a technique I am missing?
 
B

Brock Allen

Two-Way databinding is supported in ASP.NET 2.0. In 1.1 upon postback you'll
have to map the values yourself manually.
 
G

Guest

Umm, since I am using a formview and a multiview, I am using ASP.Net 2.0
(unless these were added to ASP.Net 1.1 when I wasn't looking). It still
doesn't work in the scenario I described. Their is no option listed, and the
update method on the objecdatasource is called with nothing passed for each
parameter.
 
G

Guest

I am using Bind, which is the default when using Visual Studio. I even tried
setting the bind method in the custom setting. It works fine on a form when
the controls are not in the multiview control. When I use the multiview is
when I run into a problem. There are too many controls for me to display to
the user all at once, which is why I am using the multiview.

I just found it on the bug reports, so aparently this is a bug with ASP.Net
2.0. Any time a control is in a container it does not bind properly. I will
need to code around this until RTM.
 
B

Brock Allen

I just found it on the bug reports, so aparently this is a bug with
ASP.Net 2.0. Any time a control is in a container it does not bind
properly. I will need to code around this until RTM.

Oh yes, this does ring a bell. I think the problem was that FindControl doesn't
work for a MultiView, since the child controls are contained in one of the
views. Thus on postback when trying to find the posted controls it wasn't
able to... ick.
 
G

Guest

On kind of a different subject, it seems a little silly that the controls
added are not accessible in the codebehind like they were in 1.1. I have to
use Formview1.FindControl("Multiview1!View!Textbox1") to find a text box
placed on the view. This is true with any "naming container" including
panels. I still haven't figured out how to rig events to these controls
(AddHandler after finding control maybe?).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top