471,582 Members | 1,351 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,582 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 2528
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Marlene A. Roman | last post: by
reply views Thread by Paul Fi | last post: by
2 posts views Thread by Rolf Rosenquist | last post: by
1 post views Thread by usgog | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by Vinnie | last post: by
reply views Thread by lumer26 | last post: by

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.