firing button click event before page load event.....????

Discussion in 'ASP .Net' started by GauravGupta, Jun 29, 2007.

  1. GauravGupta

    GauravGupta Guest

    i want to know that is it posible to call button click event before
    page load event on post back....
    please help me....
    GauravGupta, Jun 29, 2007
    #1
    1. Advertising

  2. GauravGupta

    Mike Guest

    why would you want to fire a button click even when the page loads?

    just put the button click code in the page load event from the start. Or
    create a seperate method that the page_load and the button click event can
    both call.


    "GauravGupta" <> wrote in message
    news:...
    >i want to know that is it posible to call button click event before
    > page load event on post back....
    > please help me....
    >
    Mike, Jun 29, 2007
    #2
    1. Advertising

  3. GauravGupta

    GauravGupta Guest

    On Jun 29, 7:04 pm, "Mike" <> wrote:
    > why would you want to fire a button click even when the page loads?
    >
    > just put the button click code in the page load event from the start. Or
    > create a seperate method that the page_load and the button click event can
    > both call.
    >
    > "GauravGupta" <> wrote in message
    >
    > news:...
    >
    >
    >
    > >i want to know that is it posible to call button click event before
    > > page load event on post back....
    > > please help me....- Hide quoted text -

    >
    > - Show quoted text -


    i am displaying a table in page load whose data is fetched from
    database .
    it also check what data is to be displayed from data base by a session
    variable.
    and i have few button which change the session variable value.
    when i click on some button page load is called before button click
    event,
    so data which is displayed is according to previous session not the
    session changed by button click.
    therefore i want that some how i call button click event before page
    load event....
    or is there any other alternative...
    GauravGupta, Jun 30, 2007
    #3
  4. GauravGupta

    Mike Guest

    then just pass that session to a method that loads the data when the page
    first loads, then when the user makes a change call that same method with
    the data value

    something like this:
    page_onLoad()
    {
    //if page is loaded for the first time, load your data
    if(!Postback())
    {
    loadData(data value);
    }
    }

    //load data
    void loadData(string datavalue)
    {
    //here is were you would put your code to load your data and pass the
    datavalue to your proc

    }

    //when the user clicks the button, call the loadData method and pass the
    value to the method
    button_onClick()
    {
    loadData(datavalue);
    }



    "GauravGupta" <> wrote in message
    news:...
    > On Jun 29, 7:04 pm, "Mike" <> wrote:
    >> why would you want to fire a button click even when the page loads?
    >>
    >> just put the button click code in the page load event from the start. Or
    >> create a seperate method that the page_load and the button click event
    >> can
    >> both call.
    >>
    >> "GauravGupta" <> wrote in message
    >>
    >> news:...
    >>
    >>
    >>
    >> >i want to know that is it posible to call button click event before
    >> > page load event on post back....
    >> > please help me....- Hide quoted text -

    >>
    >> - Show quoted text -

    >
    > i am displaying a table in page load whose data is fetched from
    > database .
    > it also check what data is to be displayed from data base by a session
    > variable.
    > and i have few button which change the session variable value.
    > when i click on some button page load is called before button click
    > event,
    > so data which is displayed is according to previous session not the
    > session changed by button click.
    > therefore i want that some how i call button click event before page
    > load event....
    > or is there any other alternative...
    >
    Mike, Jul 2, 2007
    #4
  5. GauravGupta

    Shilpa1234

    Joined:
    Jan 19, 2012
    Messages:
    1
    PostBack Issue

    Whether it is possible to call radbutton click event before pageload . i need to execute button click event first in user control page befor pageload.so please help me to solve my issue.Please replay as soon as possible

    Thank you
    Shilpa
    Shilpa1234, Jan 19, 2012
    #5
    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. Purvi T
    Replies:
    0
    Views:
    830
    Purvi T
    Oct 19, 2004
  2. jorge
    Replies:
    2
    Views:
    1,263
    jorge
    May 26, 2004
  3. GauravGupta
    Replies:
    2
    Views:
    1,648
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    Jul 1, 2007
  4. jorge
    Replies:
    1
    Views:
    411
    Teemu Keiski
    May 28, 2004
  5. jorge
    Replies:
    0
    Views:
    329
    jorge
    May 25, 2004
Loading...

Share This Page