Showing posts with label two-way. Show all posts
Showing posts with label two-way. Show all posts

Wednesday, March 21, 2012

Two-way data binding problem with Atlas UpdatePanel

I have an existing ASP 2.0 page which utilizes a SQLDataSouce and a FormView with bound controls. The page has a "save" button which saves the contents of the bound controls to the database. It works fine when not using Atlas.

One of the textboxes on the form is a date field. I want to use Atlas and the .Net Calendar control to provide a popup calendar. I implemented the calander based upon some simple example code I found in the Atlas tutorial. The popup works great and the value from the calendar is correctly placed into the target textbox.

The problem I am having is that wrapping the UpdatePanel around the textbox causes it to lose two-way databinding.It correctly displays the initial value from the current database record but, when attempting to do and update the value is always NULL. Does anyone know what I may be missing. Below is the Atlas markup wrapped around the textbox:

Thanks,

Tony

<atlas:updatepanel id="upCallReportDateTime" runat="server" mode="Conditional" rendermode="Inline"
<triggers>
<atlas:controleventtrigger controlid="calDatePicker" eventname="SelectionChanged" />
</triggers>

<contenttemplate>
<asp:textbox id="txtCallReportDateTime" runat="server"
Width="150px"
Text='<%# Bind("CallReportDateTime") %>'
CssClass="EditTextBox"
ontextchanged="txtCallReportDateTime_TextChanged"
autopostback="true"/>
<asp:imagebutton id="cmdPickDate_CallReportDateTime" runat="server"
onclick="cmdPickDate_CallReportDateTime_Click"
imageurl="graphics/calendar.gif"
height="20px"
width="20px"
CausesValidation="false" />
</contenttemplate>
</atlas:updatepanel>

Were you ever able to solve this problem? I am having the exact same problem.

The only way I've solved it so far is to add the missing parameter in the FormView_ItemInserting event.

This works well but it seems like I shouldn't have to do that.

two-way property synching not working...

I have an ajax extender that was created using the AjaxControlToolkit "ASP.Net AJAX Extender Control" wizard. My extender derives from AjaxControlToolkit.ExtenderControlBase.

My class has a bunch of properties that have the ExtenderControlProperty and ClientPropertyName attributes. These properties sync just fine from server to client, but I can't seem to get them to sync from client to server. Using this.set_ClientState("xyz") on the client gives me a value that is readable in the ClientState property on the server, but that is cheating since it uses a hidden input element.

Yes, I call this.raisePropertyChanged("MyValue") in the client JS when the property changes, and I have ensured that raisePropertyChanged is actually be called (via debugger).

Any ideas?

Nobody has any suggestions?