Erik Funkenbusch wrote:
On 18 Jun 2006 22:58:06 -0700, Ram wrote:
Please help me in solving this problem.
Without seeing your source code, my only guess is that you're using the
wring property to index into your recordset.
Hi Erik,
Thanks for replying. Here is the source code.
sample.aspx
------------------
<asp:GridView id="GV_bookings" DataSourceID="Obj_bookings"
runat="server" allowpaging="True" PageSize="5"
autogeneratecolumns="False" >
<Columns>
<asp:TemplateField HeaderText="Booking Number" >
<ItemTemplate>
<asp:LinkButton ID="lbBookingNo"
runat="server" OnClick="LinkButton_OnClick"
CommandName='<%#
"bookingDetails.aspx?bookingId=" + Eval("bookingId")%>' Text='<%#
Eval("bookingNo") %>'>
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="employeeName"
HeaderText="Employee Name" />
<asp:BoundField DataField="consultantName"
HeaderText="Consultant Name" />
</Columns>
</asp:gridview>
<asp:ObjectDataSource ID="Obj_bookings" runat="server"
SelectMethod="getAllBookings"
TypeName="Bookings"></asp:ObjectDataSource>
sample.aspx.cs
----------------------
protected void LinkButton_OnClick(object sender, EventArgs args)
{
LinkButton lb = (LinkButton)sender;
Server.Transfer(lb.CommandName);
}
I hope u understand this simple code. I haven't written anything more
than this. On clicking the booking number (link button) in the grid
view , the id and bookingno are passed to the "bookingDetails.aspx"
page. This is working fine for the first five records( ie for the first
page of the gridview). But in the second page if I click the link
button , say in the first row , the values in the first row of the
first page is passed to the next page.ie the actual values are not
passed.
Pls revert back with some good suggestions.
Regards,
S.Ramalingam