Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > GridView inside UserControl does not update

Reply
Thread Tools

GridView inside UserControl does not update

 
 
HaukiDog@hotmail.com
Guest
Posts: n/a
 
      09-13-2006
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>
<asparameter Name="Title" Type="String" />
<asparameter Name="Text" Type="String" />
</UpdateParameters>
</asp:ObjectDataSource>
<asp:HiddenField ID="HiddenFieldHelpGroupId" Value="0" runat="server"
/>

Thanks,
Dave

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Event not firing in usercontrol inside usercontrol vatech1993@yahoo.com ASP .Net Building Controls 1 12-11-2004 01:28 PM
Event not firing in usercontrol inside usercontrol vatech1993@yahoo.com ASP .Net Building Controls 0 12-10-2004 02:21 PM
Event not firing in usercontrol inside usercontrol vatech1993@yahoo.com ASP .Net Building Controls 0 12-10-2004 02:20 PM
Access a control inside an usercontrol from another control inside another usercontrol nail ASP .Net 0 09-15-2004 03:55 PM
Can we use a usercontrol inside a usercontrol Rajesh Tiwari ASP .Net 0 08-12-2003 03:56 PM



Advertisments