Showing posts with label detailsview. Show all posts
Showing posts with label detailsview. Show all posts

Wednesday, March 28, 2012

UpdatePanel - Triggers - DetailsView

I have a page that contains an UpdatePanel as following

<UpdatePanel>

<ContentTemplate>

<DetailsView>

<Fields>

<TextBox ID=""/>

<DropDownList ID=""/>

</Fields>

</DetailsView>

</ContentTemplate>

<Triggers>

...

</Triggers>

</UpdatePanel>

The triggers refer to the fields of the DetailsView by their IDs, but when viewing the page I get an error that those IDs cannot be found in the UpdatePanel.

How can I reconfigure the triggers in order to make them work?

you get the error, because the trigger cannot see the id of the fields that is inside a detailsview. what you need to do is create a textbox or button outside the detailsview and have the trigger pointing to it.

you need to add some javascript to the field that is inside the detailsview to execute the textbox or button outside the details view.

e.g.

<asp:TextBox ID="txtT1" style="display: none" runat="server" />
<asp:DetailsView ...>
<Fields><asp:TextBox ID="something ..." onchange="JavaScript ...do someothing and call textchange" runat="server" />
</asp:DetailsView
<trigger>pointing to "txtT1" ...enentName="TextChanged" ./>

something like that ... hope it helps


Is there any simpler solution? Creating outside controls for every field + js - seems like a lot of work .


Hi,

Not creating outside controls for every field + js,just ont button.

I think if your detailview is inside the updatepanel and theChildrenAsTriggers property is true, there is no need to set trigger for it.

Best Regards,

Wednesday, March 21, 2012

UpdatePanel and PopupControl inside InsertItemTemplate

Is it posible to use an UpdatePanel with a PopupControlExtender inside a InsertItemTemplate from a DetailsView ?

I want to insert a DateTime field and I want to use a Calendar and a TextBox.

After I insert an UpdatePanel inside an InsertItemTemplate I get an error in design mode "There was an error rendering the control. Object reference not set to an instance of an object."

If you can reproduce this problem following only the steps above on a new page ("After I insert an UpdatePanel inside an InsertItemTemplate I get an error..."), then the Toolkit probably isn't involved and you might consider posting to one of the other Atlas forums?