468,291 Members | 1,436 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

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 2824
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Duane Lambe | last post: by
reply views Thread by Alex Moskalyuk | last post: by
reply views Thread by 23s | last post: by
1 post views Thread by Badass Scotsman | last post: by
4 posts views Thread by reycri | last post: by
1 post views Thread by usgog | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.