473,327 Members | 2,012 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,327 software developers and data experts.

Making the page scroll down

Is there an easy way to have the page scroll to the next button?
When I populate a drop down list box, I have to use the arrow key or the
mouse to scroll down. I would like for the page to be positioned at or
near the bottom. I have turned smart navigation on. That helps, but
still isn't enough.

Thanks
Nov 17 '05 #1
5 2610
Hi,

You may use Marks <a>, then set location to #YourMark ,
This piece of code does a similar thing, it's only a fragment but will give
you the idea, In my case it's dynamic, if you need it static you can declare
the <a> where needed.

In the code behind:
if ( SomeStuffHere )
{
//Now set an A element
LiteralControl tag = new LiteralControl("<a id='cometome'
name='cometome'>");
int pos = recordgrid.SelectedIndex;
pos = pos>1?pos-1:pos;
recordgrid.Items[ pos].Cells[2].Controls.Add( tag);
gotomark = new LiteralControl( "<script> var
gotomark='cometome';</script>" );
}
else
gotomark = new LiteralControl( "<script> var gotomark='';</script>" );
this.Controls.Add( gotomark);

In the page :
<body MS_POSITIONING="GridLayout" bottommargin=0 topmargin=0
onload="GotoMark();">

function GotoMark()
{
if ( gotomark !='')
location = "#"+ gotomark;

}
Cheers,

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


"MacKenzieMouse" <no************@yahoo.com> wrote in message
news:1f********************@comcast.com...
Is there an easy way to have the page scroll to the next button?
When I populate a drop down list box, I have to use the arrow key or the
mouse to scroll down. I would like for the page to be positioned at or
near the bottom. I have turned smart navigation on. That helps, but
still isn't enough.

Thanks

Nov 17 '05 #2
Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

You may use Marks <a>, then set location to #YourMark ,
This piece of code does a similar thing, it's only a fragment but will give
you the idea, In my case it's dynamic, if you need it static you can declare
the <a> where needed.

In the code behind:
if ( SomeStuffHere )
{
//Now set an A element
LiteralControl tag = new LiteralControl("<a id='cometome'
name='cometome'>");
int pos = recordgrid.SelectedIndex;
pos = pos>1?pos-1:pos;
recordgrid.Items[ pos].Cells[2].Controls.Add( tag);
gotomark = new LiteralControl( "<script> var
gotomark='cometome';</script>" );
}
else
gotomark = new LiteralControl( "<script> var gotomark='';</script>" );
this.Controls.Add( gotomark);

In the page :
<body MS_POSITIONING="GridLayout" bottommargin=0 topmargin=0
onload="GotoMark();">

function GotoMark()
{
if ( gotomark !='')
location = "#"+ gotomark;

}
Cheers,

Nov 17 '05 #3
Ignacio,
Thanks for the help.

The page can start at the top, but as the form grows, I would want it to
position to the end. This would have to happen about 5 times. Would
this code do this?

Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

You may use Marks <a>, then set location to #YourMark ,
This piece of code does a similar thing, it's only a fragment but will give
you the idea, In my case it's dynamic, if you need it static you can declare
the <a> where needed.

In the code behind:
if ( SomeStuffHere )
{
//Now set an A element
LiteralControl tag = new LiteralControl("<a id='cometome'
name='cometome'>");
int pos = recordgrid.SelectedIndex;
pos = pos>1?pos-1:pos;
recordgrid.Items[ pos].Cells[2].Controls.Add( tag);
gotomark = new LiteralControl( "<script> var
gotomark='cometome';</script>" );
}
else
gotomark = new LiteralControl( "<script> var gotomark='';</script>" );
this.Controls.Add( gotomark);

In the page :
<body MS_POSITIONING="GridLayout" bottommargin=0 topmargin=0
onload="GotoMark();">

function GotoMark()
{
if ( gotomark !='')
location = "#"+ gotomark;

}
Cheers,

Nov 17 '05 #4
Hi,

You could make it do so, the idea is that you set the location to what you
want to make visible, you can add <a> tags in code as the form grows, then
you can keep the last mark with a variable in the same way I do. so yes, you
can do a similar thing
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"MacKenzieMouse" <no************@yahoo.com> wrote in message
news:43**************@yahoo.com...
Ignacio,
Thanks for the help.

The page can start at the top, but as the form grows, I would want it to
position to the end. This would have to happen about 5 times. Would this
code do this?

Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

You may use Marks <a>, then set location to #YourMark ,
This piece of code does a similar thing, it's only a fragment but will
give you the idea, In my case it's dynamic, if you need it static you can
declare the <a> where needed.

In the code behind:
if ( SomeStuffHere )
{
//Now set an A element
LiteralControl tag = new LiteralControl("<a id='cometome'
name='cometome'>");
int pos = recordgrid.SelectedIndex;
pos = pos>1?pos-1:pos;
recordgrid.Items[ pos].Cells[2].Controls.Add( tag);
gotomark = new LiteralControl( "<script> var
gotomark='cometome';</script>" );
}
else
gotomark = new LiteralControl( "<script> var
gotomark='';</script>" );
this.Controls.Add( gotomark);

In the page :
<body MS_POSITIONING="GridLayout" bottommargin=0 topmargin=0
onload="GotoMark();">

function GotoMark()
{
if ( gotomark !='')
location = "#"+ gotomark;

}
Cheers,

Nov 17 '05 #5
Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

You could make it do so, the idea is that you set the location to what you
want to make visible, you can add <a> tags in code as the form grows, then
you can keep the last mark with a variable in the same way I do. so yes, you
can do a similar thing
cheers,

Thanks,
I will try this.
Nov 17 '05 #6

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

Similar topics

7
by: Noozer | last post by:
I am able to place values on forms that load into my webbrowser control, but I'd like to be able to scan the page for data. I know to use the HTMLDocument object. Basically I'm hoping to find an...
36
by: spence | last post by:
Hi All How do I make it so that when a user clicks in a search text field, the default entry (in this case "Search") is removed automatically - they are then faced with a blank search box and...
4
by: Marlene A. Roman | last post by:
Is there a way that when I show some fields below that don't fit in the screen, it automatically makes a scroll down event so the user doesn't have to scroll down the page by his own? Thanks in...
0
by: Paul Fi | last post by:
when i scroll up and down a page i want the panel inside to move as well so that it doesnt disppear when scrolling the page: now i have this javascript code, that does that, but it's not so...
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...
1
by: davidr | last post by:
Hi, I am using Divs with CSS to setup a layout for a site. I am using the <Div>s and style sheets below. I want the TopMenu to go across the entire top of the browser. It does go across the...
2
by: Rolf Rosenquist | last post by:
I have an asp page, where under special circumstances, I want the page to scroll down a bit. I know how to set up the conditions, but how do I get the page to scroll down to an anchor further down...
1
by: usgog | last post by:
I have a div close to the bottom of the HTML page, and it is not displayed by default. I also have a link to toggle this div at the top of the page. So after I click the link, the div will show up....
2
by: sdevgray | last post by:
Is it possible to make the scroll bar larger on a Combo Box ? The reason I want to do this is so it can be used on a touch screen. I have a list of names linked to the Combo Box, I want a large...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.