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

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top