473,397 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Lose position in datagrid

Ady
I have a datagrid with about ten items on one page (I'd
like more).

One of the columns in the datagrid contains a hyperlink
rendered as an image which then fires some code which
alters the record (and therefore posts back)

<asp:TemplateColumn>
<ItemTemplate>
<asp:HyperLink Runat="server" NavigateUrl='<%
# "javascript:IncludeMess(" & DataBinder.Eval
(Container.DataItem, "Id") & ")" %>' Text="<img border=0
Alt='Include this item in reports' src=./Images/OK.gif>"
ID="IncludeMess"/>
</ItemTemplate>
</asp:TemplateColumn>

When the page posts back it always goes to the top of the
page. Can I get the form to post back to the position it
was before? If so how, or what are my options?

Many Thanks

Ady
Nov 17 '05 #1
3 1132
Put SmartNavigation="true" in your Page directive.

http://msdn.microsoft.com/library/de...ationtopic.asp

SmartNavigation isn't perfect and not well documented either, so if you
start experiencing a lot of weirdness on that page, turn SmartNavigation off
and see if it still happens.

"Ady" <ad***********@360software.co.uk> wrote in message
news:00****************************@phx.gbl...
I have a datagrid with about ten items on one page (I'd
like more).

One of the columns in the datagrid contains a hyperlink
rendered as an image which then fires some code which
alters the record (and therefore posts back)

<asp:TemplateColumn>
<ItemTemplate>
<asp:HyperLink Runat="server" NavigateUrl='<%
# "javascript:IncludeMess(" & DataBinder.Eval
(Container.DataItem, "Id") & ")" %>' Text="<img border=0
Alt='Include this item in reports' src=./Images/OK.gif>"
ID="IncludeMess"/>
</ItemTemplate>
</asp:TemplateColumn>

When the page posts back it always goes to the top of the
page. Can I get the form to post back to the position it
was before? If so how, or what are my options?

Many Thanks

Ady

Nov 17 '05 #2
You can use anchor tags.
Here's an example that should show you everything you need to know:
http://www.dotnetjunkies.com/tutoria...tutorialid=681

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com


"Ady" <ad***********@360software.co.uk> wrote in message
news:00****************************@phx.gbl...
I have a datagrid with about ten items on one page (I'd
like more).

One of the columns in the datagrid contains a hyperlink
rendered as an image which then fires some code which
alters the record (and therefore posts back)

<asp:TemplateColumn>
<ItemTemplate>
<asp:HyperLink Runat="server" NavigateUrl='<%
# "javascript:IncludeMess(" & DataBinder.Eval
(Container.DataItem, "Id") & ")" %>' Text="<img border=0
Alt='Include this item in reports' src=./Images/OK.gif>"
ID="IncludeMess"/>
</ItemTemplate>
</asp:TemplateColumn>

When the page posts back it always goes to the top of the
page. Can I get the form to post back to the position it
was before? If so how, or what are my options?

Many Thanks

Ady

Nov 17 '05 #3
Many Thanks
-----Original Message-----
You can use anchor tags.
Here's an example that should show you everything you need to know:http://www.dotnetjunkies.com/tutoria...tutorialid=681

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able- consulting.com

"Ady" <ad***********@360software.co.uk> wrote in message
news:00****************************@phx.gbl...
I have a datagrid with about ten items on one page (I'd
like more).

One of the columns in the datagrid contains a hyperlink
rendered as an image which then fires some code which
alters the record (and therefore posts back)

<asp:TemplateColumn>
<ItemTemplate>
<asp:HyperLink Runat="server" NavigateUrl='<%
# "javascript:IncludeMess(" & DataBinder.Eval
(Container.DataItem, "Id") & ")" %>' Text="<img border=0
Alt='Include this item in reports' src=./Images/OK.gif>"
ID="IncludeMess"/>
</ItemTemplate>
</asp:TemplateColumn>

When the page posts back it always goes to the top of the page. Can I get the form to post back to the position it
was before? If so how, or what are my options?

Many Thanks

Ady

.

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: GrantS | last post by:
I am trying to convert the VB.Net code example povided by http://authors.aspalliance.com/JimRoss/Articles/MaintainScrollPos.aspx into C# (ASP.Net)without success. No errors are thrown in the VB...
0
by: Frnak McKenney | last post by:
I have a (small) multi-table database application which allows edits, print reports, and has two scrolling screen displays which show information merged from multiple tables. I'm having trouble...
3
by: tomi | last post by:
Hi I have following problem. I have a datatable filled with some data. Each row holds its ID (column named "Row_ID") DataTable dtTable; I have a datagrid to which I assign this datatable....
3
by: Kenneth | last post by:
Hi, In a webform I have a datagrid in a certain position using gridlayout. <asp:DataGrid id="dgrdSkada" style="Z-INDEX: 107; LEFT: 16px; POSITION: absolute; TOP: 200px" runat="server"...
5
by: JezB | last post by:
There are a few references on the net about how to restore a page's scroll position over a postback. This is a simple one which works for me: eg....
1
by: Tor Inge Rislaa | last post by:
Rearranging the row position in a datagrid Hi I have a datagrid that I fill from a dataset. When the data is displayed in the grid I want the user to be able to move the position of a row. E.g....
1
by: karups | last post by:
Hi I have binded a dataset to my datagrid. Datagrid is present inside a >DIV></DIVtag of specific height. Only 5 records will be visible at a time when i edit the 10th record, the page...
0
by: karups | last post by:
Hi I have binded a dataset to my datagrid. Datagrid is present inside a >DIV></DIVtag of specific height. Only 5 records will be visible at a time when i edit the 10th record, the page...
4
by: Blackbrand | last post by:
I'll start off with what i'm trying to do: i want to search my data programmatically and then jump to the row in the datagrid. My data will almost allways go out of the datagrids bounds so if the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.