GridView inside UserControl does not update

H

HaukiDog

Hi,

I am using the following simple code inside a user control. Everything
works fine, except that the postback never gets fired when I click
update within the gridview. If I paste the code in to a webform then it
works like a champ.

Any idea?

<asp:GridView ID="GridView1" DataKeyNames="Id" EnableViewState="true"
DataSourceID="ObjectDataSource1" AutoGenerateColumns="false"
runat="server" CssClass="table_dt">
<Columns>
<asp:CommandField ShowEditButton="True"></asp:CommandField>
<asp:BoundField DataField="Title" HeaderText="Title" />
<asp:BoundField DataField="Text" HeaderText="Text" />
</Columns>
</asp:GridView>
<asp:Button ID="Button1" runat="server" Text="Add new item" />
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
TypeName="HelpGroupNews" OldValuesParameterFormatString="Original_{0}"
SelectMethod="FindAllByGroupId" UpdateMethod="UpdateWrapper">
<SelectParameters>
<asp:ControlParameter ControlID="HiddenFieldHelpGroupId"
Name="HelpGroupId" Type="Int32" />
</SelectParameters>
<UpdateParameters>
<asp:parameter Name="Title" Type="String" />
<asp:parameter Name="Text" Type="String" />
</UpdateParameters>
</asp:ObjectDataSource>
<asp:HiddenField ID="HiddenFieldHelpGroupId" Value="0" runat="server"
/>

Thanks,
Dave
 

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

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top