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

How to scroll a web page?

How can I scroll a web page in code?

I need to send the user to a specific page location after a
SelectedIndexChanged RadioButtonList event.
Nov 16 '05 #1
3 2662
Redirect him to http://webpage#index

"Andres Romero" <An**********@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.com...
How can I scroll a web page in code?

I need to send the user to a specific page location after a
SelectedIndexChanged RadioButtonList event.

Nov 16 '05 #2
The problem with this is that, after redirect, the form page loss all
controls values, is there other way?

"MaSTeR" wrote:
Redirect him to http://webpage#index

"Andres Romero" <An**********@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.com...
How can I scroll a web page in code?

I need to send the user to a specific page location after a
SelectedIndexChanged RadioButtonList event.


Nov 16 '05 #3
Hi,

This require the use of javascript in the client and a little code in the
server side

What you do is include a <a> tag where you want to go and then in the
body's onload you change the location to it

The code below was extracted from a page that does it.

aspx code:
<script>
var gotomark = "";
function GotoMark()
{
if ( gotomark !='')
location = "#"+ gotomark;
//document.all[ gotomark].focus();
}
</script>
<body MS_POSITIONING="GridLayout" bottommargin=0 topmargin=0
onload="GotoMark();">

Now in the code behind you give the gotomark variable the value of the <a>
you included in the correct position , in my case it's a row in a datagrid
recordgrid.SelectedIndex = GetSelectedIndex();
//Now set an A element
LiteralControl tag = new LiteralControl("<a id='cometome'
name='cometome'>");

recordgrid.Items[ recordgrid.SelectedIndex].Cells[2].Controls.Add(
tag);
gotomark = new LiteralControl( "<script> var gotomark='';</script>" );
this.Controls.Add( gotomark);

This should solve your problem

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


"Andres Romero" <An**********@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.com...
How can I scroll a web page in code?

I need to send the user to a specific page location after a
SelectedIndexChanged RadioButtonList event.

Nov 16 '05 #4

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

Similar topics

8
by: ergobob | last post by:
Hello, I have two scroll boxes on the same page. The first scroll box is good in IE but the words will not wrap correctly in Firefox. The second scroll box is good in all browsers. You can...
1
by: Tamir Kamara | last post by:
Hi, I have a page with several server controls (textboxes, datagrid, ...) which are positioned absolutely from the right of the page (like RIGHT: 25px; POSITION: absolute;). that works well if...
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....
0
by: Martin Eyles | last post by:
I want to make a pop-up window with a scroll-bar, which a user can select a value with, and send it back to server. this server will then send back a new page containing that value. Also, opening...
1
by: JC | last post by:
I'm sure you've all seen the save scroll position from 4 guys from rolla which can be found here > http://aspnet.4guysfromrolla.com/articles/111704-1.aspx BUT try to get that to work AND still be...
6
by: | last post by:
Hi all, I have a long web form on asp.net 2.0. When I go at the bottom and click on submit, a postback occurs and if there are any validation errors (no client-side checking being done), the...
69
by: RC | last post by:
I know how to do this in JavaScript by window.open("newFile.html", "newTarget", "scrollbars=no,resizable=0,width=200,height=200"); The browser will open a new window size 200x200, not allow...
2
by: Merlin | last post by:
Hi there, I do have a complex problem and wonder if this is possible to solve. Following situation. I do have a page, where you do have a frame inside that page. That frame holds different...
4
by: Link | last post by:
how do i scroll page when i get to a location ... something like : <body onLoad="sl()"> <script languge="javascript"> function sl(){ if (document.stopper.y>50) { window.scroll(0,100); }...
6
by: =?Utf-8?B?U2hhcm9u?= | last post by:
I'm using the VScrollBar and set it as follow: m_vScrollBar.Minimum = -19602; m_vScrollBar.Maximum = 0; m_vScrollBar.SmallChange = 1; m_vScrollBar.LargeChange = 1089; m_vScrollBar.Value =...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.