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

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

Cheers~
Nov 19 '05 #1
15 2208
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> ¦b¶l¥ó
news:%2****************@TK2MSFTNGP10.phx.gbl ¤¤¼¶¼g...
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> ¦b¶l¥ó
news:17*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
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> ¦b¶l¥ó
news:17*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
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> ¦b¶l¥ó
news:17*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
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> ¦b¶l¥ó
news:17*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
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> ¦b¶l¥ó
news:17*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
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> ¦b¶l¥ó
news:17*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
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> ¦b¶l¥ó
news:17*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
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> ¦b¶l¥ó
news:20*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
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> ¦b¶l¥ó
news:17*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
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> ¦b¶l¥ó
news:17*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
> 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> ¦b¶l¥ó
news:20*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
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> ¦b¶l¥ó
news:17*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
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> ¦b¶l¥ó
> news:17*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
>> 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> ¦b¶l¥ó
news:21*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
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> ¦b¶l¥ó
news:20*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
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> ¦b¶l¥ó
news:17*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
> 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> ¦b¶l¥ó
>> news:17*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
>>> 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> ¦b¶l¥ó
news:21*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
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> ¦b¶l¥ó
news:20*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
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> ¦b¶l¥ó
> news:17*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
>> 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> ¦b¶l¥ó
>>> news:17*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
>>>> 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> ¦b¶l¥ó
news:21*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
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> ¦b¶l¥ó
news:21*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
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> ¦b¶l¥ó
news:20*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
> 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> ¦b¶l¥ó
>> news:17*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
>>> 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> ¦b¶l¥ó
>>>> news:17*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
>>>>> 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> ¦b¶l¥ó
news:17*********************@news.cable.ntlworld.c om ¤¤¼¶¼g...
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Nick Li | last post by:
Hi, I need to create a html page so that "Back" button(or some other button) is disabled in IE browser. I would appreciate your help. Nick Li
1
by: Tom Youngquist | last post by:
Does anyone know the command to "imitate" the "Back" button on a browser in .NET. I have looked in the Redirect but can't seem to find anything. I can re-direct to a specific page but my users...
6
by: Paul Turley | last post by:
Does anyone have some sample script to "press" a button or image button when the user presses the Enter key? I see this behavior on a lot of web pages but I'm not finding any samples. Thx --...
0
by: Henke | last post by:
Hi, I have done some research about my problem I have when using the "back button" in IE to go back to a page with two dropdown lists. The both dropdown lists are populated with data. The...
7
by: Venus | last post by:
Hello, I am trying to generate a dynamic form at runtime and would like to do it using "<asp: ..." form elements as follows Build up the string that is placed somewhere in the HTML code the...
3
by: Olivier Verdin | last post by:
Hi, I am developing a multi-language application in ASP.NET in c#. I am using a file field html control to upload an image. I would like to change the text on the button "browse" that comes...
3
by: felecha | last post by:
I'm something of a rookie at .Net. I know I can set TabIndex for controls in a GroupBox, and tab my way over to a button so it's "Active" and will be clicked by hitting the Enter key. But isn't...
1
by: Agnes | last post by:
I use vb.net to preview the report (it is designed by cyrstal report), and there is "X" button on the left hand side of "refresh", when I mouse on"X" button , it said "close current view" However,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.