Auto scroll the page?

Discussion in 'ASP .Net' started by =?Utf-8?B?RGFuaWVs?=, Sep 30, 2005.

  1. 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
    =?Utf-8?B?RGFuaWVs?=, Sep 30, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?RGFuaWVs?=

    Pavan Guest

    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" <> wrote in message
    news:...
    > 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
    Pavan, Sep 30, 2005
    #2
    1. Advertising

  3. 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" <> wrote in message
    > news:...
    > > 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

    >
    >
    >
    =?Utf-8?B?RGFuaWVs?=, Sep 30, 2005
    #3
  4. 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" <> wrote in message
    news:...
    > 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" <> wrote in message
    >> news:...
    >> > 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

    >>
    >>
    >>
    S. Justin Gengo, Sep 30, 2005
    #4
  5. 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" <> wrote in message
    > news:...
    > > 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" <> wrote in message
    > >> news:...
    > >> > 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
    > >>
    > >>
    > >>

    >
    >
    >
    =?Utf-8?B?RGFuaWVs?=, Oct 3, 2005
    #5
  6. You're welcome.

    --
    Sincerely,

    S. Justin Gengo, MCP
    Web Developer / Programmer

    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzsche
    "Daniel" <> wrote in message
    news:...
    > 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" <> wrote in message
    >> news:...
    >> > 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" <> wrote in message
    >> >> news:...
    >> >> > 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
    >> >>
    >> >>
    >> >>

    >>
    >>
    >>
    S. Justin Gengo, Oct 3, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. nicholas
    Replies:
    0
    Views:
    440
    nicholas
    Dec 7, 2004
  2. Kevin
    Replies:
    1
    Views:
    9,522
    Roland
    Feb 5, 2005
  3. Sathiamoorthy

    Enable Scroll up and scroll down in CR-report

    Sathiamoorthy, Nov 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    892
    zobalee
    Nov 28, 2006
  4. linkswanted
    Replies:
    1
    Views:
    901
  5. Replies:
    1
    Views:
    178
    scripts.contact
    Jun 20, 2007
Loading...

Share This Page