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

Auto scroll the page?

Hi All,
i have problem to scroll the page the the specific section of the page after
click a command button.

I have tried using <a name="f"> and use response.redirect("xxxx.aspx?#f").
Although it works but i dont wan to reload the page.

I also used hyperlink to goto the "f" section. It works good without fire an
event (which cause reload page) but, the problem, i wan to click on a command
button and not the hyperlink.

So, how to accomplish it by clicking only the command button and direct me
to the "f" section without fire any event.

Any ideas? guiline?

Thank you in advance.
Best regards,
OCurnos
Nov 19 '05 #1
5 2977
Hi,

As far as my understanding, you are using asp.net command button to scroll
the page. If so, use HTML button instead.

And in page_Init event, add the following code.

(Let us say name of the HTML Button is btnScroll)

Protected void Page_Init(object sender, EventArgs e)

{

btnScroll.Attributes.Add("Href","xyz.aspx?#f");

}

I hope this will help you.

Regards,

Pavan
"Daniel" <Da****@discussions.microsoft.com> wrote in message
news:4F**********************************@microsof t.com...
Hi All,
i have problem to scroll the page the the specific section of the page
after
click a command button.

I have tried using <a name="f"> and use response.redirect("xxxx.aspx?#f").
Although it works but i dont wan to reload the page.

I also used hyperlink to goto the "f" section. It works good without fire
an
event (which cause reload page) but, the problem, i wan to click on a
command
button and not the hyperlink.

So, how to accomplish it by clicking only the command button and direct me
to the "f" section without fire any event.

Any ideas? guiline?

Thank you in advance.
Best regards,
OCurnos

Nov 19 '05 #2
Hi Pavan,
the code is not working ?? am i miss something??

thank you

"Pavan" wrote:
Hi,

As far as my understanding, you are using asp.net command button to scroll
the page. If so, use HTML button instead.

And in page_Init event, add the following code.

(Let us say name of the HTML Button is btnScroll)

Protected void Page_Init(object sender, EventArgs e)

{

btnScroll.Attributes.Add("Href","xyz.aspx?#f");

}

I hope this will help you.

Regards,

Pavan
"Daniel" <Da****@discussions.microsoft.com> wrote in message
news:4F**********************************@microsof t.com...
Hi All,
i have problem to scroll the page the the specific section of the page
after
click a command button.

I have tried using <a name="f"> and use response.redirect("xxxx.aspx?#f").
Although it works but i dont wan to reload the page.

I also used hyperlink to goto the "f" section. It works good without fire
an
event (which cause reload page) but, the problem, i wan to click on a
command
button and not the hyperlink.

So, how to accomplish it by clicking only the command button and direct me
to the "f" section without fire any event.

Any ideas? guiline?

Thank you in advance.
Best regards,
OCurnos


Nov 19 '05 #3
Daniel,

If you'd like some already working code I have a "ScrollToElement" method in
a Javascript component that I give away free on my website (everything there
is free). If you click on the "Code Library" link at the top of
www.aboutfortunate.com and then click the "Javascript" button in the menu on
the left you can download all source code for the component as a Visual
Studio.Net 2003 project. Even if you don't want to use the whole javascript
component (it has a lot of other useful scripts in it) you could always
strip out the ScrollToElement code. It lets you specify what control on the
page to scroll to, or you can give it a page element name as a string in
case you want to scroll to something that isn't a .Net control.

There is also a help file that explains/gives examples of use of all
controls available on my website.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Daniel" <Da****@discussions.microsoft.com> wrote in message
news:67**********************************@microsof t.com...
Hi Pavan,
the code is not working ?? am i miss something??

thank you

"Pavan" wrote:
Hi,

As far as my understanding, you are using asp.net command button to
scroll
the page. If so, use HTML button instead.

And in page_Init event, add the following code.

(Let us say name of the HTML Button is btnScroll)

Protected void Page_Init(object sender, EventArgs e)

{

btnScroll.Attributes.Add("Href","xyz.aspx?#f");

}

I hope this will help you.

Regards,

Pavan
"Daniel" <Da****@discussions.microsoft.com> wrote in message
news:4F**********************************@microsof t.com...
> Hi All,
> i have problem to scroll the page the the specific section of the page
> after
> click a command button.
>
> I have tried using <a name="f"> and use
> response.redirect("xxxx.aspx?#f").
> Although it works but i dont wan to reload the page.
>
> I also used hyperlink to goto the "f" section. It works good without
> fire
> an
> event (which cause reload page) but, the problem, i wan to click on a
> command
> button and not the hyperlink.
>
> So, how to accomplish it by clicking only the command button and direct
> me
> to the "f" section without fire any event.
>
> Any ideas? guiline?
>
> Thank you in advance.
> Best regards,
> OCurnos


Nov 19 '05 #4
Thanks Justin.

"S. Justin Gengo" wrote:
Daniel,

If you'd like some already working code I have a "ScrollToElement" method in
a Javascript component that I give away free on my website (everything there
is free). If you click on the "Code Library" link at the top of
www.aboutfortunate.com and then click the "Javascript" button in the menu on
the left you can download all source code for the component as a Visual
Studio.Net 2003 project. Even if you don't want to use the whole javascript
component (it has a lot of other useful scripts in it) you could always
strip out the ScrollToElement code. It lets you specify what control on the
page to scroll to, or you can give it a page element name as a string in
case you want to scroll to something that isn't a .Net control.

There is also a help file that explains/gives examples of use of all
controls available on my website.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Daniel" <Da****@discussions.microsoft.com> wrote in message
news:67**********************************@microsof t.com...
Hi Pavan,
the code is not working ?? am i miss something??

thank you

"Pavan" wrote:
Hi,

As far as my understanding, you are using asp.net command button to
scroll
the page. If so, use HTML button instead.

And in page_Init event, add the following code.

(Let us say name of the HTML Button is btnScroll)

Protected void Page_Init(object sender, EventArgs e)

{

btnScroll.Attributes.Add("Href","xyz.aspx?#f");

}

I hope this will help you.

Regards,

Pavan
"Daniel" <Da****@discussions.microsoft.com> wrote in message
news:4F**********************************@microsof t.com...
> Hi All,
> i have problem to scroll the page the the specific section of the page
> after
> click a command button.
>
> I have tried using <a name="f"> and use
> response.redirect("xxxx.aspx?#f").
> Although it works but i dont wan to reload the page.
>
> I also used hyperlink to goto the "f" section. It works good without
> fire
> an
> event (which cause reload page) but, the problem, i wan to click on a
> command
> button and not the hyperlink.
>
> So, how to accomplish it by clicking only the command button and direct
> me
> to the "f" section without fire any event.
>
> Any ideas? guiline?
>
> Thank you in advance.
> Best regards,
> OCurnos


Nov 19 '05 #5
You're welcome.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Daniel" <Da****@discussions.microsoft.com> wrote in message
news:62**********************************@microsof t.com...
Thanks Justin.

"S. Justin Gengo" wrote:
Daniel,

If you'd like some already working code I have a "ScrollToElement" method
in
a Javascript component that I give away free on my website (everything
there
is free). If you click on the "Code Library" link at the top of
www.aboutfortunate.com and then click the "Javascript" button in the menu
on
the left you can download all source code for the component as a Visual
Studio.Net 2003 project. Even if you don't want to use the whole
javascript
component (it has a lot of other useful scripts in it) you could always
strip out the ScrollToElement code. It lets you specify what control on
the
page to scroll to, or you can give it a page element name as a string in
case you want to scroll to something that isn't a .Net control.

There is also a help file that explains/gives examples of use of all
controls available on my website.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Daniel" <Da****@discussions.microsoft.com> wrote in message
news:67**********************************@microsof t.com...
> Hi Pavan,
> the code is not working ?? am i miss something??
>
> thank you
>
> "Pavan" wrote:
>
>> Hi,
>>
>> As far as my understanding, you are using asp.net command button to
>> scroll
>> the page. If so, use HTML button instead.
>>
>> And in page_Init event, add the following code.
>>
>> (Let us say name of the HTML Button is btnScroll)
>>
>> Protected void Page_Init(object sender, EventArgs e)
>>
>> {
>>
>> btnScroll.Attributes.Add("Href","xyz.aspx?#f");
>>
>> }
>>
>> I hope this will help you.
>>
>> Regards,
>>
>> Pavan
>>
>>
>> "Daniel" <Da****@discussions.microsoft.com> wrote in message
>> news:4F**********************************@microsof t.com...
>> > Hi All,
>> > i have problem to scroll the page the the specific section of the
>> > page
>> > after
>> > click a command button.
>> >
>> > I have tried using <a name="f"> and use
>> > response.redirect("xxxx.aspx?#f").
>> > Although it works but i dont wan to reload the page.
>> >
>> > I also used hyperlink to goto the "f" section. It works good without
>> > fire
>> > an
>> > event (which cause reload page) but, the problem, i wan to click on
>> > a
>> > command
>> > button and not the hyperlink.
>> >
>> > So, how to accomplish it by clicking only the command button and
>> > direct
>> > me
>> > to the "f" section without fire any event.
>> >
>> > Any ideas? guiline?
>> >
>> > Thank you in advance.
>> > Best regards,
>> > OCurnos
>>
>>
>>


Nov 19 '05 #6

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

Similar topics

1
by: Glabbeek | last post by:
I'm changing the layout of my site. Instead of using tables, I will use DIVs. It's working fine, except for 1 thing: In IE6 some DIVs are not the correct width. Mozilla and Opera are showing the...
5
by: Duane Lambe | last post by:
Hi - just a quick question, I hope it's simple enough that a visual example isn't required. I have an internal site, everything's the way I want it, but there's an anomoly in both Opera and...
0
by: Alex Moskalyuk | last post by:
I am using System.Windows.Forms.TextBox to publish some real-time data that's coming off the external devices. My data is fed into the TextBox with proper precautions not to exceed the MaxSize...
0
by: 23s | last post by:
Is there any way I can send a vertical value to a form's scroll position? I have a full-screen form that, at launch, contains an empty tab sheet. At run time, the user can dynamically append a...
1
by: Badass Scotsman | last post by:
Hello, I have an application which should never allow the back button to be pushed without refreshing the previous page. For example: Step 1: User fills in form.html and presses submit ...
4
by: reycri | last post by:
I have a page that works as I intend in IE but not in Firefox: <html> <head> <title>Overflow Test</title> </head> <body style='overflow:hidden; margin:0; padding:0;'> <table border='0'...
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....
1
by: Jake Barnes | last post by:
I searched comp.lang.javascript on Google Groups but I didn't find an answer when I searched for "viewport" or "viewport div" or any combination of words using "viewport" so now I think I'm...
1
by: pravinnweb | last post by:
can anyone tell me how to set auto height to outer div that is in green box id "gray-background" it should increase relatively to inner div "smbox" here is the css and html code it should work in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.