Repositioning HTML-table after post

H

Hein de Ruyter

When I delete a row from the bottom of a large gridview (.NET 2.0) (After
scrolling all the way down a page) the page jumps back to the top after the
post. I'd ike to reposition the page to where the row was deleted so I don't
have to scroll all the way down to delete th next row if I should want so.

Is it possible to reposition the window of a page to the position where the
row was deleted? I hope someone can tell me how to accomplish this using
ASP.NET 2.0. Thanks in advance!

Hein.
 
S

Steven Cheng[MSFT]

Hi Hein,

Welcome to ASPNET newsgroup.
Regarding on the keep page's focus position after reposting question, I've
also seen some other members raise such question when developing asp.net
1.x pages. Currently, for this problem, we have the following options in
asp.net page:

1. Using the ASP.NET's SmartNavigation, the SmartNavigation has provide
some features such as:

1) prevent postback requests being added into client browser's history list
2) keep the page focus postion between postback requests
......

2. WE manually inject some cilentside scripts which will use the javascript
object.focus() function to set the focus on the certain html element which
is onfoucs in the last request. For example, when we are editing data row
in DataGrid or GridView(in 2.0), we can output the setting focus script in
the editing/delelting postback event so as to set focus on the correct html
element(through control's clientID).

You can have a look at both ones to see whether they'll help you on the
problem.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| Thread-Topic: Repositioning HTML-table after post
| thread-index: AcWuOZiqJHAXMKnOS5KyJrUMwwdayQ==
| X-WBNR-Posting-Host: 213.10.174.3
| From: "=?Utf-8?B?SGVpbiBkZSBSdXl0ZXI=?=" <[email protected]>
| Subject: Repositioning HTML-table after post
| Date: Wed, 31 Aug 2005 07:38:04 -0700
| Lines: 10
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:10640
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| When I delete a row from the bottom of a large gridview (.NET 2.0) (After
| scrolling all the way down a page) the page jumps back to the top after
the
| post. I'd ike to reposition the page to where the row was deleted so I
don't
| have to scroll all the way down to delete th next row if I should want
so.
|
| Is it possible to reposition the window of a page to the position where
the
| row was deleted? I hope someone can tell me how to accomplish this using
| ASP.NET 2.0. Thanks in advance!
|
| Hein.
|
 
H

Hein de Ruyter

Hi Steven,

Thanks very much for your help. Simply putting 'me.smartnavigation = true'
in the Page_load subroutine does the trick. Very useful. You solved my
problem!

It was difficult for me to search for this solution because I could not
find/think of the right keyword.

Hein.
 
S

Steven Cheng[MSFT]

You're welcome Hein,

Also, the drawback of using SmartNavigation is it'll cause some performance
cost for your page since it provide not only keeping page's focus position,
but also some other features(e.g. prevent the postback request from being
added into the client browser's history list). So when you feel
smartNavigation not quite suitable, you can consider manually emiting
script to set focus() on the page.

Thanks again for your posting. Good luck!

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: Repositioning HTML-table after post
| thread-index: AcWu39XU8tHL84sASmKPXbtCdw/pNg==
| X-WBNR-Posting-Host: 213.10.174.3
| From: "=?Utf-8?B?SGVpbiBkZSBSdXl0ZXI=?=" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: RE: Repositioning HTML-table after post
| Date: Thu, 1 Sep 2005 03:28:03 -0700
| Lines: 90
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:10652
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| Hi Steven,
|
| Thanks very much for your help. Simply putting 'me.smartnavigation =
true'
| in the Page_load subroutine does the trick. Very useful. You solved my
| problem!
|
| It was difficult for me to search for this solution because I could not
| find/think of the right keyword.
|
| Hein.
|
| "Steven Cheng[MSFT]" wrote:
|
| > Hi Hein,
| >
| > Welcome to ASPNET newsgroup.
| > Regarding on the keep page's focus position after reposting question,
I've
| > also seen some other members raise such question when developing
asp.net
| > 1.x pages. Currently, for this problem, we have the following options
in
| > asp.net page:
| >
| > 1. Using the ASP.NET's SmartNavigation, the SmartNavigation has provide
| > some features such as:
| >
| > 1) prevent postback requests being added into client browser's history
list
| > 2) keep the page focus postion between postback requests
| > ......
| >
| > 2. WE manually inject some cilentside scripts which will use the
javascript
| > object.focus() function to set the focus on the certain html element
which
| > is onfoucs in the last request. For example, when we are editing data
row
| > in DataGrid or GridView(in 2.0), we can output the setting focus script
in
| > the editing/delelting postback event so as to set focus on the correct
html
| > element(through control's clientID).
| >
| > You can have a look at both ones to see whether they'll help you on the
| > problem.
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| > --------------------
| > | Thread-Topic: Repositioning HTML-table after post
| > | thread-index: AcWuOZiqJHAXMKnOS5KyJrUMwwdayQ==
| > | X-WBNR-Posting-Host: 213.10.174.3
| > | From: "=?Utf-8?B?SGVpbiBkZSBSdXl0ZXI=?="
<[email protected]>
| > | Subject: Repositioning HTML-table after post
| > | Date: Wed, 31 Aug 2005 07:38:04 -0700
| > | Lines: 10
| > | Message-ID: <[email protected]>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA01.phx.gbl
| > microsoft.public.dotnet.framework.aspnet.webcontrols:10640
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| > |
| > | When I delete a row from the bottom of a large gridview (.NET 2.0)
(After
| > | scrolling all the way down a page) the page jumps back to the top
after
| > the
| > | post. I'd ike to reposition the page to where the row was deleted so
I
| > don't
| > | have to scroll all the way down to delete th next row if I should
want
| > so.
| > |
| > | Is it possible to reposition the window of a page to the position
where
| > the
| > | row was deleted? I hope someone can tell me how to accomplish this
using
| > | ASP.NET 2.0. Thanks in advance!
| > |
| > | Hein.
| > |
| >
| >
|
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top