GridView inside UserControl does not update

Discussion in 'ASP .Net Web Controls' started by HaukiDog@hotmail.com, Sep 13, 2006.

  1. Guest

    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
     
    , Sep 13, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rajesh Tiwari

    Can we use a usercontrol inside a usercontrol

    Rajesh Tiwari, Aug 12, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    444
    Rajesh Tiwari
    Aug 12, 2003
  2. nail
    Replies:
    0
    Views:
    1,581
  3. Event not firing in usercontrol inside usercontrol

    , Dec 10, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    207
  4. Event not firing in usercontrol inside usercontrol

    , Dec 10, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    210
    vatech1993
    Dec 11, 2004
  5. Event not firing in usercontrol inside usercontrol

    , Dec 10, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    181
Loading...

Share This Page