473,386 Members | 1,679 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,386 software developers and data experts.

WebForm scroll position after PostBack

In the case of a long Webform, when a PostBack event occurrs, is there a
technique to position the Form at where it was when the event fired?

Similar to using an anchor tag in html to go to a specific location in a
page.

Thanks!
Nov 17 '05 #1
3 2236
Try setting the SmartNavigation property = true

"Steve Covert" <st****@katolight.com> wrote in message
news:uJ**************@TK2MSFTNGP12.phx.gbl...
In the case of a long Webform, when a PostBack event occurrs, is there a
technique to position the Form at where it was when the event fired?

Similar to using an anchor tag in html to go to a specific location in a
page.

Thanks!

Nov 17 '05 #2
You can render html to the browser that uses the Anchor
tag to go to a specific location.
the following code writes out an <A> tag to the browser
(you'll need to insert it in the appropriate place), and
runs a script that positions the form at that spot.

[C#]
string Arg = Request.Form["__EVENTARGUMENT"];
n.Text += "<A name='#" + Arg + "'></A>";
string script = "<SCRIPT
language='javascript'>location.href='#" + Arg
+ "';</SCRIPT>";
Page.RegisterStartupScript("posForm",script);

You don't need to use Request.Form["__EVENTARGUMENT"],
any string will do here but it can help if you're trying
to determine which event that caused the postback

alex
-----Original Message-----
In the case of a long Webform, when a PostBack event occurrs, is there atechnique to position the Form at where it was when the event fired?
Similar to using an anchor tag in html to go to a specific location in apage.

Thanks!
.

Nov 17 '05 #3
http://authors.aspalliance.com/jimro...ScrollPos.aspx

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"Steve Covert" <st****@katolight.com> wrote in message
news:uJ**************@TK2MSFTNGP12.phx.gbl...
In the case of a long Webform, when a PostBack event occurrs, is there a
technique to position the Form at where it was when the event fired?

Similar to using an anchor tag in html to go to a specific location in a
page.

Thanks!

Nov 17 '05 #4

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

Similar topics

8
by: ed | last post by:
Does anyone know if ASP.NET 2.0 is going to incorporate "maintain scroll position on postback" in non-IE browsers like Firefox? This seems like an often requested feature on these newsgroups...
4
by: ojorus | last post by:
Hi! I just wonder how I can save a page's scroll position with javascript. (i'm not a javascript developer) I have a PHP-page with two columns; the left contains a lot of thumbnails, and the right...
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....
4
by: Emmanuel | last post by:
Hi, I have placed a DataList control inside a panel control to obtain a scrollable list using the overflow:auto attribute. The rows in the data list contains and edit LinkButton to enable...
3
by: rmunson8 | last post by:
I have added Panel control to a web page which contains a GridView. The Panel's ScrollBars property is set to auto. When I select the Select CommanField button for a row (which obviously causes a...
0
by: Keithb | last post by:
The maintain scroll position on postback feature works as expected with my site running under localhost on the development machine. When the files are posted to an IIS 6.0 web server running on a...
5
by: RobertK | last post by:
I have a table that displays one row of images (thumbnails). When a user clicks on an image it opens up a bigger image below it. The row has about 20 cells. I have a <divtag which allows the user...
7
by: Lit | last post by:
Hi, How can I capture the vertical scroll bar position for a Listbox. I have a Listbox of 100 items + when I click on it I post back remove the item selected. After returning to the client...
1
by: wmbrae | last post by:
I trying to make a javascript document reader in 2 frames. The left frame displays the document, the right frame shows a list of document links. This is as far as I got ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.