469,626 Members | 880 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,626 developers. It's quick & easy.

does anyone knows how to move the bottom of current page, after i press the "button"

Cheers~
Nov 19 '05 #1
15 2028
You could try using the window.scrollTo() method in JavaScript.

"Alan Ho" <gt*********@yahoo.com.hk> wrote in message
news:ui**************@TK2MSFTNGP09.phx.gbl...
Cheers~

Nov 19 '05 #2
Hello Peter,

try this:

<script language="javascript">
function doscroll(){
x=document.body.scrollHeight;
x=x+99999
window.scrollTo(0,x);
}
</script>

then in your button's tag add onclick="doscroll()"
You could try using the window.scrollTo() method in JavaScript.

"Alan Ho" <gt*********@yahoo.com.hk> wrote in message
news:ui**************@TK2MSFTNGP09.phx.gbl...
Cheers~


Nov 19 '05 #3
thx
"Peter Rilling" <pe***@nospam.rilling.net> 秎ン
news:%2****************@TK2MSFTNGP10.phx.gbl い级糶...
You could try using the window.scrollTo() method in JavaScript.

"Alan Ho" <gt*********@yahoo.com.hk> wrote in message
news:ui**************@TK2MSFTNGP09.phx.gbl...
Cheers~


Nov 19 '05 #4
cheers~
"Martin Carolan" <mc******@gmail.com> 秎ン
news:17*********************@news.cable.ntlworld.c om い级糶...
Hello Peter,

try this:

<script language="javascript">
function doscroll(){
x=document.body.scrollHeight;
x=x+99999
window.scrollTo(0,x);
}
</script>

then in your button's tag add onclick="doscroll()"
You could try using the window.scrollTo() method in JavaScript.

"Alan Ho" <gt*********@yahoo.com.hk> wrote in message
news:ui**************@TK2MSFTNGP09.phx.gbl...
Cheers~


Nov 19 '05 #5
i would like to know how can i use this script in Asp:Button?
thanks
"Martin Carolan" <mc******@gmail.com> 秎ン
news:17*********************@news.cable.ntlworld.c om い级糶...
Hello Peter,

try this:

<script language="javascript">
function doscroll(){
x=document.body.scrollHeight;
x=x+99999
window.scrollTo(0,x);
}
</script>

then in your button's tag add onclick="doscroll()"
You could try using the window.scrollTo() method in JavaScript.

"Alan Ho" <gt*********@yahoo.com.hk> wrote in message
news:ui**************@TK2MSFTNGP09.phx.gbl...
Cheers~


Nov 19 '05 #6
Hello Alan,

in your code just add

button1.Attributes.Add("onclick", "doscroll()");

That should work.
i would like to know how can i use this script in Asp:Button?
thanks
"Martin Carolan" <mc******@gmail.com> 秎ン
news:17*********************@news.cable.ntlworld.c om い级糶...
Hello Peter,

try this:

<script language="javascript">
function doscroll(){
x=document.body.scrollHeight;
x=x+99999
window.scrollTo(0,x);
}
</script>
then in your button's tag add onclick="doscroll()"
You could try using the window.scrollTo() method in JavaScript.

"Alan Ho" <gt*********@yahoo.com.hk> wrote in message
news:ui**************@TK2MSFTNGP09.phx.gbl...

Cheers~


Nov 19 '05 #7
i tried it...
but it seems still not work........
"Martin Carolan" <mc******@gmail.com> 秎ン
news:17*********************@news.cable.ntlworld.c om い级糶...
Hello Alan,

in your code just add

button1.Attributes.Add("onclick", "doscroll()");

That should work.
i would like to know how can i use this script in Asp:Button?
thanks
"Martin Carolan" <mc******@gmail.com> 秎ン
news:17*********************@news.cable.ntlworld.c om い级糶...
Hello Peter,

try this:

<script language="javascript">
function doscroll(){
x=document.body.scrollHeight;
x=x+99999
window.scrollTo(0,x);
}
</script>
then in your button's tag add onclick="doscroll()"

You could try using the window.scrollTo() method in JavaScript.

"Alan Ho" <gt*********@yahoo.com.hk> wrote in message
news:ui**************@TK2MSFTNGP09.phx.gbl...

> Cheers~
>


Nov 19 '05 #8
Hello Alan,

What error do you get (if any) when trying that method?

Martin.
i tried it...
but it seems still not work........
"Martin Carolan" <mc******@gmail.com> 秎ン
news:17*********************@news.cable.ntlworld.c om い级糶...
Hello Alan,

in your code just add

button1.Attributes.Add("onclick", "doscroll()");

That should work.
i would like to know how can i use this script in Asp:Button?
thanks
"Martin Carolan" <mc******@gmail.com> 秎ン
news:17*********************@news.cable.ntlworld.c om い级糶...
Hello Peter,

try this:

<script language="javascript">
function doscroll(){
x=document.body.scrollHeight;
x=x+99999
window.scrollTo(0,x);
}
</script>
then in your button's tag add onclick="doscroll()"
> You could try using the window.scrollTo() method in JavaScript.
>
> "Alan Ho" <gt*********@yahoo.com.hk> wrote in message
> news:ui**************@TK2MSFTNGP09.phx.gbl...
>
>> Cheers~
>>


Nov 19 '05 #9
Dear Martin,
I put the Button2.Attributes.Add("onClick", "doscroll()"); in
webForm2.aspx.cs as below

private void Button2_Click(object sender, System.EventArgs e)
{
Button2.Attributes.Add("onClick", "doscroll()");

}

and in html

<script language="javascript">
function doscroll(){
x=documen.body.scrollHeight;
x=x+999;
self.scrollTo(0,100);}</script>
<h2>
<asp:Button id="Button2" style="Z-INDEX: 101; LEFT: 352px; POSITION:
absolute; TOP: 912px" runat="server" Text="Button"
onClick="doscroll()"></asp:Button></h2>
after i try to run it...show the error message
"CS0117: 'ASP.WebForm2_aspx' not include 'doscroll' define / declare
"Martin Carolan" <mc******@gmail.com> 秎ン
news:20*********************@news.cable.ntlworld.c om い级糶...
Hello Alan,

What error do you get (if any) when trying that method?

Martin.
i tried it...
but it seems still not work........
"Martin Carolan" <mc******@gmail.com> 秎ン
news:17*********************@news.cable.ntlworld.c om い级糶...
Hello Alan,

in your code just add

button1.Attributes.Add("onclick", "doscroll()");

That should work.

i would like to know how can i use this script in Asp:Button?
thanks
"Martin Carolan" <mc******@gmail.com> 秎ン
news:17*********************@news.cable.ntlworld.c om い级糶...
> Hello Peter,
>
> try this:
>
> <script language="javascript">
> function doscroll(){
> x=document.body.scrollHeight;
> x=x+99999
> window.scrollTo(0,x);
> }
> </script>
> then in your button's tag add onclick="doscroll()"
>> You could try using the window.scrollTo() method in JavaScript.
>>
>> "Alan Ho" <gt*********@yahoo.com.hk> wrote in message
>> news:ui**************@TK2MSFTNGP09.phx.gbl...
>>
>>> Cheers~
>>>


Nov 19 '05 #10
Hello Alan,

In your html you need to change

<asp:Button id="Button2" style="Z-INDEX: 101; LEFT: 352px; POSITION:
absolute; TOP: 912px" runat="server" Text="Button"
onClick="doscroll()"></asp:Button>

to

<asp:Button id="Button2" style="Z-INDEX: 101; LEFT: 352px; POSITION:
absolute; TOP: 912px" runat="server" Text="Button"></asp:Button>

Martin.
Dear Martin,
I put the Button2.Attributes.Add("onClick", "doscroll()"); in
webForm2.aspx.cs as below
private void Button2_Click(object sender, System.EventArgs e)
{
Button2.Attributes.Add("onClick", "doscroll()");
}

and in html

<script language="javascript">
function doscroll(){
x=documen.body.scrollHeight;
x=x+999;
self.scrollTo(0,100);}</script>
<h2>
<asp:Button id="Button2" style="Z-INDEX: 101; LEFT: 352px;
POSITION:
absolute; TOP: 912px" runat="server" Text="Button"
onClick="doscroll()"></asp:Button></h2>
after i try to run it...show the error message
"CS0117: 'ASP.WebForm2_aspx' not include 'doscroll' define / declare
"Martin Carolan" <mc******@gmail.com> 秎ン
news:20*********************@news.cable.ntlworld.c om い级糶...
Hello Alan,

What error do you get (if any) when trying that method?

Martin.
i tried it...
but it seems still not work........
"Martin Carolan" <mc******@gmail.com> 秎ン
news:17*********************@news.cable.ntlworld.c om い级糶...
Hello Alan,

in your code just add

button1.Attributes.Add("onclick", "doscroll()");

That should work.

> i would like to know how can i use this script in Asp:Button?
> thanks
> "Martin Carolan" <mc******@gmail.com> 秎ン
> news:17*********************@news.cable.ntlworld.c om い级糶...
>> Hello Peter,
>>
>> try this:
>>
>> <script language="javascript">
>> function doscroll(){
>> x=document.body.scrollHeight;
>> x=x+99999
>> window.scrollTo(0,x);
>> }
>> </script>
>> then in your button's tag add onclick="doscroll()"
>>> You could try using the window.scrollTo() method in JavaScript.
>>>
>>> "Alan Ho" <gt*********@yahoo.com.hk> wrote in message
>>> news:ui**************@TK2MSFTNGP09.phx.gbl...
>>>
>>>> Cheers~
>>>>


Nov 19 '05 #11
Dear Martin,
Thank you your help
I have followed and changed it. And i can run it. however,
when i press the Button2 ....which it nothing happen.....it seem haven't run
the doscroll()....
help please..
Thanks..
^_^
Alan
"Martin Carolan" <mc******@gmail.com> 秎ン
news:21*********************@news.cable.ntlworld.c om い级糶...
Hello Alan,

In your html you need to change

<asp:Button id="Button2" style="Z-INDEX: 101; LEFT: 352px; POSITION:
absolute; TOP: 912px" runat="server" Text="Button"
onClick="doscroll()"></asp:Button>

to

<asp:Button id="Button2" style="Z-INDEX: 101; LEFT: 352px; POSITION:
absolute; TOP: 912px" runat="server" Text="Button"></asp:Button>

Martin.
Dear Martin,
I put the Button2.Attributes.Add("onClick", "doscroll()"); in
webForm2.aspx.cs as below
private void Button2_Click(object sender, System.EventArgs e)
{
Button2.Attributes.Add("onClick", "doscroll()");
}

and in html

<script language="javascript">
function doscroll(){
x=documen.body.scrollHeight;
x=x+999;
self.scrollTo(0,100);}</script>
<h2>
<asp:Button id="Button2" style="Z-INDEX: 101; LEFT: 352px;
POSITION:
absolute; TOP: 912px" runat="server" Text="Button"
onClick="doscroll()"></asp:Button></h2>
after i try to run it...show the error message
"CS0117: 'ASP.WebForm2_aspx' not include 'doscroll' define / declare
"Martin Carolan" <mc******@gmail.com> 秎ン
news:20*********************@news.cable.ntlworld.c om い级糶...
Hello Alan,

What error do you get (if any) when trying that method?

Martin.

i tried it...
but it seems still not work........
"Martin Carolan" <mc******@gmail.com> 秎ン
news:17*********************@news.cable.ntlworld.c om い级糶...
> Hello Alan,
>
> in your code just add
>
> button1.Attributes.Add("onclick", "doscroll()");
>
> That should work.
>
>> i would like to know how can i use this script in Asp:Button?
>> thanks
>> "Martin Carolan" <mc******@gmail.com> 秎ン
>> news:17*********************@news.cable.ntlworld.c om い级糶...
>>> Hello Peter,
>>>
>>> try this:
>>>
>>> <script language="javascript">
>>> function doscroll(){
>>> x=document.body.scrollHeight;
>>> x=x+99999
>>> window.scrollTo(0,x);
>>> }
>>> </script>
>>> then in your button's tag add onclick="doscroll()"
>>>> You could try using the window.scrollTo() method in JavaScript.
>>>>
>>>> "Alan Ho" <gt*********@yahoo.com.hk> wrote in message
>>>> news:ui**************@TK2MSFTNGP09.phx.gbl...
>>>>
>>>>> Cheers~
>>>>>


Nov 19 '05 #12
Hello Alan,

Can you send me the html from the view source? (i.e. in your browser after
it's been processed on the server)

Martin.
Dear Martin,
Thank you your help
I have followed and changed it. And i can run it. however,
when i press the Button2 ....which it nothing happen.....it seem
haven't run
the doscroll()....
help please..
Thanks..
^_^
Alan
"Martin Carolan" <mc******@gmail.com> 秎ン
news:21*********************@news.cable.ntlworld.c om い级糶...
Hello Alan,

In your html you need to change

<asp:Button id="Button2" style="Z-INDEX: 101; LEFT: 352px; POSITION:
absolute; TOP: 912px" runat="server" Text="Button"
onClick="doscroll()"></asp:Button>

to

<asp:Button id="Button2" style="Z-INDEX: 101; LEFT: 352px; POSITION:
absolute; TOP: 912px" runat="server" Text="Button"></asp:Button>

Martin.
Dear Martin,
I put the Button2.Attributes.Add("onClick", "doscroll()"); in
webForm2.aspx.cs as below
private void Button2_Click(object sender, System.EventArgs e)
{
Button2.Attributes.Add("onClick", "doscroll()");
}
and in html

<script language="javascript">
function doscroll(){
x=documen.body.scrollHeight;
x=x+999;
self.scrollTo(0,100);}</script>
<h2>
<asp:Button id="Button2" style="Z-INDEX: 101; LEFT: 352px;
POSITION:
absolute; TOP: 912px" runat="server" Text="Button"
onClick="doscroll()"></asp:Button></h2>
after i try to run it...show the error message
"CS0117: 'ASP.WebForm2_aspx' not include 'doscroll' define / declare
"Martin Carolan" <mc******@gmail.com> 秎ン
news:20*********************@news.cable.ntlworld.c om い级糶...
Hello Alan,

What error do you get (if any) when trying that method?

Martin.

> i tried it...
> but it seems still not work........
> "Martin Carolan" <mc******@gmail.com> 秎ン
> news:17*********************@news.cable.ntlworld.c om い级糶...
>> Hello Alan,
>>
>> in your code just add
>>
>> button1.Attributes.Add("onclick", "doscroll()");
>>
>> That should work.
>>
>>> i would like to know how can i use this script in Asp:Button?
>>> thanks
>>> "Martin Carolan" <mc******@gmail.com> 秎ン
>>> news:17*********************@news.cable.ntlworld.c om い级糶...
>>>> Hello Peter,
>>>>
>>>> try this:
>>>>
>>>> <script language="javascript">
>>>> function doscroll(){
>>>> x=document.body.scrollHeight;
>>>> x=x+99999
>>>> window.scrollTo(0,x);
>>>> }
>>>> </script>
>>>> then in your button's tag add onclick="doscroll()"
>>>>> You could try using the window.scrollTo() method in
>>>>> JavaScript.
>>>>>
>>>>> "Alan Ho" <gt*********@yahoo.com.hk> wrote in message
>>>>> news:ui**************@TK2MSFTNGP09.phx.gbl...
>>>>>
>>>>>> Cheers~
>>>>>>


Nov 19 '05 #13
sent it
thanks
"Martin Carolan" <mc******@gmail.com> 秎ン
news:21*********************@news.cable.ntlworld.c om い级糶...
Hello Alan,

Can you send me the html from the view source? (i.e. in your browser after
it's been processed on the server)

Martin.
Dear Martin,
Thank you your help
I have followed and changed it. And i can run it. however,
when i press the Button2 ....which it nothing happen.....it seem
haven't run
the doscroll()....
help please..
Thanks..
^_^
Alan
"Martin Carolan" <mc******@gmail.com> 秎ン
news:21*********************@news.cable.ntlworld.c om い级糶...
Hello Alan,

In your html you need to change

<asp:Button id="Button2" style="Z-INDEX: 101; LEFT: 352px; POSITION:
absolute; TOP: 912px" runat="server" Text="Button"
onClick="doscroll()"></asp:Button>

to

<asp:Button id="Button2" style="Z-INDEX: 101; LEFT: 352px; POSITION:
absolute; TOP: 912px" runat="server" Text="Button"></asp:Button>

Martin.

Dear Martin,
I put the Button2.Attributes.Add("onClick", "doscroll()"); in
webForm2.aspx.cs as below
private void Button2_Click(object sender, System.EventArgs e)
{
Button2.Attributes.Add("onClick", "doscroll()");
}
and in html

<script language="javascript">
function doscroll(){
x=documen.body.scrollHeight;
x=x+999;
self.scrollTo(0,100);}</script>
<h2>
<asp:Button id="Button2" style="Z-INDEX: 101; LEFT: 352px;
POSITION:
absolute; TOP: 912px" runat="server" Text="Button"
onClick="doscroll()"></asp:Button></h2>
after i try to run it...show the error message
"CS0117: 'ASP.WebForm2_aspx' not include 'doscroll' define / declare
"Martin Carolan" <mc******@gmail.com> 秎ン
news:20*********************@news.cable.ntlworld.c om い级糶...
> Hello Alan,
>
> What error do you get (if any) when trying that method?
>
> Martin.
>
>> i tried it...
>> but it seems still not work........
>> "Martin Carolan" <mc******@gmail.com> 秎ン
>> news:17*********************@news.cable.ntlworld.c om い级糶...
>>> Hello Alan,
>>>
>>> in your code just add
>>>
>>> button1.Attributes.Add("onclick", "doscroll()");
>>>
>>> That should work.
>>>
>>>> i would like to know how can i use this script in Asp:Button?
>>>> thanks
>>>> "Martin Carolan" <mc******@gmail.com> 秎ン
>>>> news:17*********************@news.cable.ntlworld.c om い级糶...
>>>>> Hello Peter,
>>>>>
>>>>> try this:
>>>>>
>>>>> <script language="javascript">
>>>>> function doscroll(){
>>>>> x=document.body.scrollHeight;
>>>>> x=x+99999
>>>>> window.scrollTo(0,x);
>>>>> }
>>>>> </script>
>>>>> then in your button's tag add onclick="doscroll()"
>>>>>> You could try using the window.scrollTo() method in
>>>>>> JavaScript.
>>>>>>
>>>>>> "Alan Ho" <gt*********@yahoo.com.hk> wrote in message
>>>>>> news:ui**************@TK2MSFTNGP09.phx.gbl...
>>>>>>
>>>>>>> Cheers~
>>>>>>>


Nov 19 '05 #14
Do you want this button to perform a postback? If not, then you might try
just using a standard HTML button <input type="button" ...> and attaching
the client-side onclick event to the tag.

The implementation for this will be different if the button posts back to
the server.

"Alan Ho" <gt*********@yahoo.com.hk> wrote in message
news:u#**************@TK2MSFTNGP15.phx.gbl...
i would like to know how can i use this script in Asp:Button?
thanks
"Martin Carolan" <mc******@gmail.com> 秎ン
news:17*********************@news.cable.ntlworld.c om い级糶...
Hello Peter,

try this:

<script language="javascript">
function doscroll(){
x=document.body.scrollHeight;
x=x+99999
window.scrollTo(0,x);
}
</script>

then in your button's tag add onclick="doscroll()"
You could try using the window.scrollTo() method in JavaScript.

"Alan Ho" <gt*********@yahoo.com.hk> wrote in message
news:ui**************@TK2MSFTNGP09.phx.gbl...

> Cheers~
>



Nov 19 '05 #15
If you want to jump to a certain point in a page, you can set a named
anchor on your page, then reference it with an href tag. This is a
straight HTML method.

-------------------------
<a name="top">Top of Page</a><br/>
<a href="#bottom">Go To bottom of Page</a>
<br/><!--Add enough HTML to make the scroll evident-->
<br/>
<a href="#top">Go to Top</a><br/>
<a name="bottom">Bottom of Page</a>
-------------------------
Hope this helps,

jo

Nov 19 '05 #16

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Tom Youngquist | last post: by
6 posts views Thread by Paul Turley | last post: by
reply views Thread by Henke | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.