Making the page scroll down

  • Thread starter Thread starter MacKenzieMouse
  • Start date Start date
M

MacKenzieMouse

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
 
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 said:
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,
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?
 
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 said:
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?
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 said:
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.
 
Back
Top