After PostBack - back to same place on page

T

tshad

I have some nested DataGrids in my Datalist. There could be 20 datalist
items.

If I scroll down to the 18th item and expand it to show the DataGrid, the
page always goes back to the beginning of the page instead of going back to
the same spot on the page or move the page up to show the grid.

Is there a way to have it go back to the place I left on the page?

Thanks,

Tom
 
J

Jason Bailey

I don't know of any way to do this automatically in .NET.

However, you could capture the mouse position in client-side javascript,
post to the server in a hidden field, let the server handle its
processing then post-render on the client, have the page reposition
itself based on the last mouse position.

--Jason
 
J

Joe Fallon

Here is nice technique that I just implemented.

http://www.wintellect.com/resources/faqs/default.aspx?faq_id=1&page=7

I put it in my Base Page so that every page that needs this functionality
has it if I add the HTML:
<input type="hidden" name="__SCROLLPOS" value="" />

============================================================================
Is it possible to prevent a Web form from scrolling to the top of the page
when it posts back to the server?
============================================================================

One way to do it is to add a SmartNavigation="true" attribute to the page's
@ Page directive. That requires Internet Explorer 5.0 or higher on the
client.
============================================================================
To prevent unwanted scrolling in a wider range of browsers, you can use a
server-side script that generates client-side script.
The first step is to replace the page's <body> tag with the following
statements:
============================================================================

<%
if (Request["__SCROLLPOS"] != null &&
Request["__SCROLLPOS"] != String.Empty) {
int pos = Convert.ToInt32 (Request["__SCROLLPOS"]);
Response.Write ("<body id=\"theBody\" " +
"onscroll=\"javascript:document.forms[0].__SCROLLPOS.value = " +
"theBody.scrollTop;\" " +
"onload=\"javascript:theBody.scrollTop=" + pos + ";\">");
}
else {
Response.Write ("<body id=\"theBody\" " +
"onscroll=\"javascript:document.forms[0].__SCROLLPOS.value =" +
"theBody.scrollTop;\">");
}
%>

============================================================================

Step two is to add the following line somewhere between the <form
runat="server"> and </form> tags:
============================================================================
<input type="hidden" name="__SCROLLPOS" value="" />

============================================================================

How does it work? The server-side script block outputs a <body> tag
containing an onscroll attribute that keeps tabs on the scroll position and
an onload attribute that restores the last scroll position following a
postback. The scroll position is transmitted to the server in a hidden
<input> control named __SCROLLPOS. Note that this technique is compatible
with Internet Explorer but not with Netscape Navigator.
============================================================================
 
B

Brian Hoops

Their solutions are nice, otherwise you could always just enable
SmartNavigation on your pages.

-Brian
 
T

tshad

Joe Fallon said:
Here is nice technique that I just implemented.

http://www.wintellect.com/resources/faqs/default.aspx?faq_id=1&page=7

I put it in my Base Page so that every page that needs this functionality
has it if I add the HTML:
<input type="hidden" name="__SCROLLPOS" value="" />

I tried that as it looks like a pretty good solution.

The problem is I get the following error:
***************************************************************************************
Compiler Error Message: BC30311: Value of type 'System.Web.HttpRequest'
cannot be converted to 'Boolean'.

Source Error:

Line 198:</head>
Line 199:<%
Line 200: if (Request["__SCROLLPOS"] != null &&
Line 201: Request["__SCROLLPOS"] != String.Empty) {
Line 202: int pos = Convert.ToInt32 (Request["__SCROLLPOS"]);

***************************************************************************************

Here is the piece I just cut out of the linked page put in place of the
<body> statement:
****************************************************************************************
<%
if (Request["__SCROLLPOS"] != null &&
Request["__SCROLLPOS"] != String.Empty) {
int pos = Convert.ToInt32 (Request["__SCROLLPOS"]);
Response.Write ("<body id=\"theBody\" "
"onscroll=\"javascript:document.forms[0].__SCROLLPOS.value = "
"theBody.scrollTop;\" "
"onload=\"javascript:theBody.scrollTop=" pos ";\">");
}
else {
Response.Write ("<body id=\"theBody\" "
"onscroll=\"javascript:document.forms[0].__SCROLLPOS.value ="
"theBody.scrollTop;\">");
}
%>
*****************************************************************************************

and here is the hidden object which I put right after the <form
runat="server"> line:

<input type="hidden" name="__SCROLLPOS" value="" />

Am I missing something?

Thanks,

Tom
============================================================================
Is it possible to prevent a Web form from scrolling to the top of the page
when it posts back to the server?
============================================================================

One way to do it is to add a SmartNavigation="true" attribute to the
page's
@ Page directive. That requires Internet Explorer 5.0 or higher on the
client.
============================================================================
To prevent unwanted scrolling in a wider range of browsers, you can use a
server-side script that generates client-side script.
The first step is to replace the page's <body> tag with the following
statements:
============================================================================

<%
if (Request["__SCROLLPOS"] != null &&
Request["__SCROLLPOS"] != String.Empty) {
int pos = Convert.ToInt32 (Request["__SCROLLPOS"]);
Response.Write ("<body id=\"theBody\" " +
"onscroll=\"javascript:document.forms[0].__SCROLLPOS.value = " +
"theBody.scrollTop;\" " +
"onload=\"javascript:theBody.scrollTop=" + pos + ";\">");
}
else {
Response.Write ("<body id=\"theBody\" " +
"onscroll=\"javascript:document.forms[0].__SCROLLPOS.value =" +
"theBody.scrollTop;\">");
}
%>

============================================================================

Step two is to add the following line somewhere between the <form
runat="server"> and </form> tags:
============================================================================
<input type="hidden" name="__SCROLLPOS" value="" />

============================================================================

How does it work? The server-side script block outputs a <body> tag
containing an onscroll attribute that keeps tabs on the scroll position
and
an onload attribute that restores the last scroll position following a
postback. The scroll position is transmitted to the server in a hidden
<input> control named __SCROLLPOS. Note that this technique is compatible
with Internet Explorer but not with Netscape Navigator.
============================================================================

--
Joe Fallon




tshad said:
I have some nested DataGrids in my Datalist. There could be 20 datalist
items.

If I scroll down to the 18th item and expand it to show the DataGrid, the
page always goes back to the beginning of the page instead of going back
to the same spot on the page or move the page up to show the grid.

Is there a way to have it go back to the place I left on the page?

Thanks,

Tom
 
T

tshad

Saravana said:

This looks like a pretty good solution, but I get the following error trying
to execute it:
*************************************************************************
Compiler Error Message: BC30451: Name 'BindData' is not declared.

Source Error:

Line 30:
Line 31: if not IsPostBack then
Line 32: Call BindData()
Line 33: else
Line 34: Dim startUpScript As String
*******************************************************************

I found that the setting of the string is what is causing it. I pared down
the line to only:

startUpScript = "<script language=Javascript></script>"

And I still get the error. I get the error if I take out the
Me.RegisterStartupScript line also.

Here is the code now:

********************************************************************
if not IsPostBack then
Call BindData()
else
Dim startUpScript As String
startUpScript = "<script language=Javascript></script>"
end if
*********************************************************************************

If I change it to something like:

startUpScript = "This is a test"

It works fine.

I am getting the error on the initial load of the page, so the string setup
isn't even done yet.

What am I missing???

Thanks,

Tom.
 
J

Joe Fallon

OK - here is the VB.Net code I use:

If Not (Request("__SCROLLPOS") Is Nothing) AndAlso Request("__SCROLLPOS")
<> String.Empty Then
Dim pos As Integer = Convert.ToInt32(Request("__SCROLLPOS"))
.Attributes("onscroll") =
"javascript:if(document.forms[0].__SCROLLPOS)document.forms[0].__SCROLLPOS.value
= Body.scrollTop;"
.Attributes("onload") = "javascript:Body.scrollTop=" & pos & ";"
Else
.Attributes("onscroll") =
"javascript:if(document.forms[0].__SCROLLPOS)document.forms[0].__SCROLLPOS.value
= Body.scrollTop;"
End If

--
Joe Fallon




tshad said:
Joe Fallon said:
Here is nice technique that I just implemented.

http://www.wintellect.com/resources/faqs/default.aspx?faq_id=1&page=7

I put it in my Base Page so that every page that needs this functionality
has it if I add the HTML:
<input type="hidden" name="__SCROLLPOS" value="" />

I tried that as it looks like a pretty good solution.

The problem is I get the following error:
***************************************************************************************
Compiler Error Message: BC30311: Value of type 'System.Web.HttpRequest'
cannot be converted to 'Boolean'.

Source Error:

Line 198:</head>
Line 199:<%
Line 200: if (Request["__SCROLLPOS"] != null &&
Line 201: Request["__SCROLLPOS"] != String.Empty) {
Line 202: int pos = Convert.ToInt32 (Request["__SCROLLPOS"]);

***************************************************************************************

Here is the piece I just cut out of the linked page put in place of the
<body> statement:
****************************************************************************************
<%
if (Request["__SCROLLPOS"] != null &&
Request["__SCROLLPOS"] != String.Empty) {
int pos = Convert.ToInt32 (Request["__SCROLLPOS"]);
Response.Write ("<body id=\"theBody\" "
"onscroll=\"javascript:document.forms[0].__SCROLLPOS.value = "
"theBody.scrollTop;\" "
"onload=\"javascript:theBody.scrollTop=" pos ";\">");
}
else {
Response.Write ("<body id=\"theBody\" "
"onscroll=\"javascript:document.forms[0].__SCROLLPOS.value ="
"theBody.scrollTop;\">");
}
%>
*****************************************************************************************

and here is the hidden object which I put right after the <form
runat="server"> line:

<input type="hidden" name="__SCROLLPOS" value="" />

Am I missing something?

Thanks,

Tom
============================================================================
Is it possible to prevent a Web form from scrolling to the top of the
page
when it posts back to the server?
============================================================================

One way to do it is to add a SmartNavigation="true" attribute to the
page's
@ Page directive. That requires Internet Explorer 5.0 or higher on the
client.
============================================================================
To prevent unwanted scrolling in a wider range of browsers, you can use a
server-side script that generates client-side script.
The first step is to replace the page's <body> tag with the following
statements:
============================================================================

<%
if (Request["__SCROLLPOS"] != null &&
Request["__SCROLLPOS"] != String.Empty) {
int pos = Convert.ToInt32 (Request["__SCROLLPOS"]);
Response.Write ("<body id=\"theBody\" " +
"onscroll=\"javascript:document.forms[0].__SCROLLPOS.value = " +
"theBody.scrollTop;\" " +
"onload=\"javascript:theBody.scrollTop=" + pos + ";\">");
}
else {
Response.Write ("<body id=\"theBody\" " +
"onscroll=\"javascript:document.forms[0].__SCROLLPOS.value =" +
"theBody.scrollTop;\">");
}
%>

============================================================================

Step two is to add the following line somewhere between the <form
runat="server"> and </form> tags:
============================================================================
<input type="hidden" name="__SCROLLPOS" value="" />

============================================================================

How does it work? The server-side script block outputs a <body> tag
containing an onscroll attribute that keeps tabs on the scroll position
and
an onload attribute that restores the last scroll position following a
postback. The scroll position is transmitted to the server in a hidden
<input> control named __SCROLLPOS. Note that this technique is compatible
with Internet Explorer but not with Netscape Navigator.
============================================================================

--
Joe Fallon




tshad said:
I have some nested DataGrids in my Datalist. There could be 20 datalist
items.

If I scroll down to the 18th item and expand it to show the DataGrid,
the page always goes back to the beginning of the page instead of going
back to the same spot on the page or move the page up to show the grid.

Is there a way to have it go back to the place I left on the page?

Thanks,

Tom
 
T

tshad

Joe Fallon said:
OK - here is the VB.Net code I use:

If Not (Request("__SCROLLPOS") Is Nothing) AndAlso Request("__SCROLLPOS")
<> String.Empty Then
Dim pos As Integer = Convert.ToInt32(Request("__SCROLLPOS"))
.Attributes("onscroll") =
"javascript:if(document.forms[0].__SCROLLPOS)document.forms[0].__SCROLLPOS.value
= Body.scrollTop;"
.Attributes("onload") = "javascript:Body.scrollTop=" & pos & ";"
Else
.Attributes("onscroll") =
"javascript:if(document.forms[0].__SCROLLPOS)document.forms[0].__SCROLLPOS.value
= Body.scrollTop;"
End If

My mistake.

I hadn't realized it wasn't VB.Net (brain fade).

However, I am still getting an error on the ".Attributes". It is
complaining that their is no "With" statement.

Tom
--
Joe Fallon




tshad said:
Joe Fallon said:
Here is nice technique that I just implemented.

http://www.wintellect.com/resources/faqs/default.aspx?faq_id=1&page=7

I put it in my Base Page so that every page that needs this
functionality
has it if I add the HTML:
<input type="hidden" name="__SCROLLPOS" value="" />

I tried that as it looks like a pretty good solution.

The problem is I get the following error:
***************************************************************************************
Compiler Error Message: BC30311: Value of type 'System.Web.HttpRequest'
cannot be converted to 'Boolean'.

Source Error:

Line 198:</head>
Line 199:<%
Line 200: if (Request["__SCROLLPOS"] != null &&
Line 201: Request["__SCROLLPOS"] != String.Empty) {
Line 202: int pos = Convert.ToInt32 (Request["__SCROLLPOS"]);

***************************************************************************************

Here is the piece I just cut out of the linked page put in place of the
<body> statement:
****************************************************************************************
<%
if (Request["__SCROLLPOS"] != null &&
Request["__SCROLLPOS"] != String.Empty) {
int pos = Convert.ToInt32 (Request["__SCROLLPOS"]);
Response.Write ("<body id=\"theBody\" "
"onscroll=\"javascript:document.forms[0].__SCROLLPOS.value = "
"theBody.scrollTop;\" "
"onload=\"javascript:theBody.scrollTop=" pos ";\">");
}
else {
Response.Write ("<body id=\"theBody\" "
"onscroll=\"javascript:document.forms[0].__SCROLLPOS.value ="
"theBody.scrollTop;\">");
}
%>
*****************************************************************************************

and here is the hidden object which I put right after the <form
runat="server"> line:

<input type="hidden" name="__SCROLLPOS" value="" />

Am I missing something?

Thanks,

Tom
============================================================================
Is it possible to prevent a Web form from scrolling to the top of the
page
when it posts back to the server?
============================================================================

One way to do it is to add a SmartNavigation="true" attribute to the
page's
@ Page directive. That requires Internet Explorer 5.0 or higher on the
client.
============================================================================
To prevent unwanted scrolling in a wider range of browsers, you can use
a
server-side script that generates client-side script.
The first step is to replace the page's <body> tag with the following
statements:
============================================================================

<%
if (Request["__SCROLLPOS"] != null &&
Request["__SCROLLPOS"] != String.Empty) {
int pos = Convert.ToInt32 (Request["__SCROLLPOS"]);
Response.Write ("<body id=\"theBody\" " +
"onscroll=\"javascript:document.forms[0].__SCROLLPOS.value = "
+
"theBody.scrollTop;\" " +
"onload=\"javascript:theBody.scrollTop=" + pos + ";\">");
}
else {
Response.Write ("<body id=\"theBody\" " +
"onscroll=\"javascript:document.forms[0].__SCROLLPOS.value =" +
"theBody.scrollTop;\">");
}
%>

============================================================================

Step two is to add the following line somewhere between the <form
runat="server"> and </form> tags:
============================================================================
<input type="hidden" name="__SCROLLPOS" value="" />

============================================================================

How does it work? The server-side script block outputs a <body> tag
containing an onscroll attribute that keeps tabs on the scroll position
and
an onload attribute that restores the last scroll position following a
postback. The scroll position is transmitted to the server in a hidden
<input> control named __SCROLLPOS. Note that this technique is
compatible
with Internet Explorer but not with Netscape Navigator.
============================================================================

--
Joe Fallon




I have some nested DataGrids in my Datalist. There could be 20 datalist
items.

If I scroll down to the 18th item and expand it to show the DataGrid,
the page always goes back to the beginning of the page instead of going
back to the same spot on the page or move the page up to show the grid.

Is there a way to have it go back to the place I left on the page?

Thanks,

Tom
 
J

Joe Fallon

I use code to find the HTML body.
That is what the .Attributes are added to.

With HTML_Body
--
Joe Fallon




tshad said:
Joe Fallon said:
OK - here is the VB.Net code I use:

If Not (Request("__SCROLLPOS") Is Nothing) AndAlso Request("__SCROLLPOS")
<> String.Empty Then
Dim pos As Integer = Convert.ToInt32(Request("__SCROLLPOS"))
.Attributes("onscroll") =
"javascript:if(document.forms[0].__SCROLLPOS)document.forms[0].__SCROLLPOS.value
= Body.scrollTop;"
.Attributes("onload") = "javascript:Body.scrollTop=" & pos & ";"
Else
.Attributes("onscroll") =
"javascript:if(document.forms[0].__SCROLLPOS)document.forms[0].__SCROLLPOS.value
= Body.scrollTop;"
End If

My mistake.

I hadn't realized it wasn't VB.Net (brain fade).

However, I am still getting an error on the ".Attributes". It is
complaining that their is no "With" statement.

Tom
--
Joe Fallon




tshad said:
Here is nice technique that I just implemented.

http://www.wintellect.com/resources/faqs/default.aspx?faq_id=1&page=7

I put it in my Base Page so that every page that needs this
functionality
has it if I add the HTML:
<input type="hidden" name="__SCROLLPOS" value="" />


I tried that as it looks like a pretty good solution.

The problem is I get the following error:
***************************************************************************************
Compiler Error Message: BC30311: Value of type 'System.Web.HttpRequest'
cannot be converted to 'Boolean'.

Source Error:

Line 198:</head>
Line 199:<%
Line 200: if (Request["__SCROLLPOS"] != null &&
Line 201: Request["__SCROLLPOS"] != String.Empty) {
Line 202: int pos = Convert.ToInt32 (Request["__SCROLLPOS"]);

***************************************************************************************

Here is the piece I just cut out of the linked page put in place of the
<body> statement:
****************************************************************************************
<%
if (Request["__SCROLLPOS"] != null &&
Request["__SCROLLPOS"] != String.Empty) {
int pos = Convert.ToInt32 (Request["__SCROLLPOS"]);
Response.Write ("<body id=\"theBody\" "
"onscroll=\"javascript:document.forms[0].__SCROLLPOS.value = "
"theBody.scrollTop;\" "
"onload=\"javascript:theBody.scrollTop=" pos ";\">");
}
else {
Response.Write ("<body id=\"theBody\" "
"onscroll=\"javascript:document.forms[0].__SCROLLPOS.value ="
"theBody.scrollTop;\">");
}
%>
*****************************************************************************************

and here is the hidden object which I put right after the <form
runat="server"> line:

<input type="hidden" name="__SCROLLPOS" value="" />

Am I missing something?

Thanks,

Tom
============================================================================
Is it possible to prevent a Web form from scrolling to the top of the
page
when it posts back to the server?
============================================================================

One way to do it is to add a SmartNavigation="true" attribute to the
page's
@ Page directive. That requires Internet Explorer 5.0 or higher on the
client.
============================================================================
To prevent unwanted scrolling in a wider range of browsers, you can use
a
server-side script that generates client-side script.
The first step is to replace the page's <body> tag with the following
statements:
============================================================================

<%
if (Request["__SCROLLPOS"] != null &&
Request["__SCROLLPOS"] != String.Empty) {
int pos = Convert.ToInt32 (Request["__SCROLLPOS"]);
Response.Write ("<body id=\"theBody\" " +
"onscroll=\"javascript:document.forms[0].__SCROLLPOS.value = "
+
"theBody.scrollTop;\" " +
"onload=\"javascript:theBody.scrollTop=" + pos + ";\">");
}
else {
Response.Write ("<body id=\"theBody\" " +
"onscroll=\"javascript:document.forms[0].__SCROLLPOS.value ="
+
"theBody.scrollTop;\">");
}
%>

============================================================================

Step two is to add the following line somewhere between the <form
runat="server"> and </form> tags:
============================================================================
<input type="hidden" name="__SCROLLPOS" value="" />

============================================================================

How does it work? The server-side script block outputs a <body> tag
containing an onscroll attribute that keeps tabs on the scroll position
and
an onload attribute that restores the last scroll position following a
postback. The scroll position is transmitted to the server in a hidden
<input> control named __SCROLLPOS. Note that this technique is
compatible
with Internet Explorer but not with Netscape Navigator.
============================================================================

--
Joe Fallon




I have some nested DataGrids in my Datalist. There could be 20
datalist items.

If I scroll down to the 18th item and expand it to show the DataGrid,
the page always goes back to the beginning of the page instead of
going back to the same spot on the page or move the page up to show
the grid.

Is there a way to have it go back to the place I left on the page?

Thanks,

Tom
 
T

tshad

Joe Fallon said:
I use code to find the HTML body.
That is what the .Attributes are added to.

With HTML_Body

You lost me on that one.

Tom.
--
Joe Fallon




tshad said:
Joe Fallon said:
OK - here is the VB.Net code I use:

If Not (Request("__SCROLLPOS") Is Nothing) AndAlso
Request("__SCROLLPOS") <> String.Empty Then
Dim pos As Integer = Convert.ToInt32(Request("__SCROLLPOS"))
.Attributes("onscroll") =
"javascript:if(document.forms[0].__SCROLLPOS)document.forms[0].__SCROLLPOS.value
= Body.scrollTop;"
.Attributes("onload") = "javascript:Body.scrollTop=" & pos &
";"
Else
.Attributes("onscroll") =
"javascript:if(document.forms[0].__SCROLLPOS)document.forms[0].__SCROLLPOS.value
= Body.scrollTop;"
End If

My mistake.

I hadn't realized it wasn't VB.Net (brain fade).

However, I am still getting an error on the ".Attributes". It is
complaining that their is no "With" statement.

Tom
--
Joe Fallon




Here is nice technique that I just implemented.

http://www.wintellect.com/resources/faqs/default.aspx?faq_id=1&page=7

I put it in my Base Page so that every page that needs this
functionality
has it if I add the HTML:
<input type="hidden" name="__SCROLLPOS" value="" />


I tried that as it looks like a pretty good solution.

The problem is I get the following error:
***************************************************************************************
Compiler Error Message: BC30311: Value of type 'System.Web.HttpRequest'
cannot be converted to 'Boolean'.

Source Error:

Line 198:</head>
Line 199:<%
Line 200: if (Request["__SCROLLPOS"] != null &&
Line 201: Request["__SCROLLPOS"] != String.Empty) {
Line 202: int pos = Convert.ToInt32 (Request["__SCROLLPOS"]);

***************************************************************************************

Here is the piece I just cut out of the linked page put in place of the
<body> statement:
****************************************************************************************
<%
if (Request["__SCROLLPOS"] != null &&
Request["__SCROLLPOS"] != String.Empty) {
int pos = Convert.ToInt32 (Request["__SCROLLPOS"]);
Response.Write ("<body id=\"theBody\" "
"onscroll=\"javascript:document.forms[0].__SCROLLPOS.value = "
"theBody.scrollTop;\" "
"onload=\"javascript:theBody.scrollTop=" pos ";\">");
}
else {
Response.Write ("<body id=\"theBody\" "
"onscroll=\"javascript:document.forms[0].__SCROLLPOS.value ="
"theBody.scrollTop;\">");
}
%>
*****************************************************************************************

and here is the hidden object which I put right after the <form
runat="server"> line:

<input type="hidden" name="__SCROLLPOS" value="" />

Am I missing something?

Thanks,

Tom
============================================================================
Is it possible to prevent a Web form from scrolling to the top of the
page
when it posts back to the server?
============================================================================

One way to do it is to add a SmartNavigation="true" attribute to the
page's
@ Page directive. That requires Internet Explorer 5.0 or higher on the
client.
============================================================================
To prevent unwanted scrolling in a wider range of browsers, you can
use a
server-side script that generates client-side script.
The first step is to replace the page's <body> tag with the following
statements:
============================================================================

<%
if (Request["__SCROLLPOS"] != null &&
Request["__SCROLLPOS"] != String.Empty) {
int pos = Convert.ToInt32 (Request["__SCROLLPOS"]);
Response.Write ("<body id=\"theBody\" " +
"onscroll=\"javascript:document.forms[0].__SCROLLPOS.value =
" +
"theBody.scrollTop;\" " +
"onload=\"javascript:theBody.scrollTop=" + pos + ";\">");
}
else {
Response.Write ("<body id=\"theBody\" " +
"onscroll=\"javascript:document.forms[0].__SCROLLPOS.value ="
+
"theBody.scrollTop;\">");
}
%>

============================================================================

Step two is to add the following line somewhere between the <form
runat="server"> and </form> tags:
============================================================================
<input type="hidden" name="__SCROLLPOS" value="" />

============================================================================

How does it work? The server-side script block outputs a <body> tag
containing an onscroll attribute that keeps tabs on the scroll
position and
an onload attribute that restores the last scroll position following a
postback. The scroll position is transmitted to the server in a hidden
<input> control named __SCROLLPOS. Note that this technique is
compatible
with Internet Explorer but not with Netscape Navigator.
============================================================================

--
Joe Fallon




I have some nested DataGrids in my Datalist. There could be 20
datalist items.

If I scroll down to the 18th item and expand it to show the DataGrid,
the page always goes back to the beginning of the page instead of
going back to the same spot on the page or move the page up to show
the grid.

Is there a way to have it go back to the place I left on the page?

Thanks,

Tom
 

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

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top