| | |
Problem with datakey in datagrid while paging
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Aug 2007
Posts: 2
Reputation:
Solved Threads: 0
I have a forum where the threads are showing in a datagrid with paging. The paging works fine and show the right result on the next pages.
My problem is in the column which contains a link to the page where the client can read the thread. The link includes the datakey, but the datakey is showing the keys from the first page.
This is the column:
The datagrid contains this line:
Here is the sub where the site is redirected to the wrong post:
Viewstate is disabled
My problem is in the column which contains a link to the page where the client can read the thread. The link includes the datakey, but the datakey is showing the keys from the first page.
This is the column:
VB.NET Syntax (Toggle Plain Text)
<asp:Templatecolumn ItemStyle-Width="356" ItemStyle-CssClass="bg_forumTema" > <itemtemplate> <asp:linkbutton ID="lbTema" runat="server" CssClass="formal_blue_bold" CommandName="Select" Text='<%#Container.DataItem("tema")%>' /> </itemtemplate> </asp:templatecolumn>
The datagrid contains this line:
VB.NET Syntax (Toggle Plain Text)
OnSelectedIndexChanged="vis_indlaeg"
Here is the sub where the site is redirected to the wrong post:
VB.NET Syntax (Toggle Plain Text)
Sub vis_indlaeg(obj as object, e as EventArgs) response.Redirect("forum_vis_indlaeg.aspx?id=" & Datagrid1.DataKeys(Datagrid1.SelectedIndex)) end sub
Viewstate is disabled
![]() |
Similar Threads
- Problem in writing from a datagrid to Excel.. (ASP.NET)
- How can we populate a datagrid in VB.NET? (VB.NET)
- problem in VB.NET? (VB.NET)
- Datagrid - no value at index ### error when scroll and sort (VB.NET)
- Print Datagrid issue (ASP.NET)
- Paging goes to wrong page (ASP.NET)
- How will I Capture this Dynamic Data (ASP.NET)
- ASP.NET Tutorial: Caching in ASP.NET (ASP.NET)
- How to sort the rows in the datagrid and update it successfully? (VB.NET)
Other Threads in the VB.NET Forum
- Previous Thread: Automate Web Browser
- Next Thread: DataGridView populate
Views: 1827 | Replies: 0
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net .net2008 2008 access advanced application array basic beginner browser button buttons center class click client code combo convert cuesent data database datagrid datagridview date datetimepicker design designer dissertation dissertations dissertationtopic eclipse excel exists fade filter forms function html images lib listview map mobile module msaccess net number objects open panel pdf picturebox picturebox2 port position print printing problem read refresh regex richtextbox right-to-left save search serial settings shutdown socket sorting sqldatbase sqlserver studio temperature textbox timer timespan transparency txttoxmlconverter usercontol validation vb vb.net vb2008 vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web webbrowser winforms winsock wpf wrapingcode xml year





