Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > firing button click event before page load event.....????

Reply
Thread Tools

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

 
 
GauravGupta
Guest
Posts: n/a
 
      06-29-2007
i want to know that is it posible to call button click event before
page load event on post back....
please help me....

 
Reply With Quote
 
 
 
 
Mike
Guest
Posts: n/a
 
      06-29-2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
>i want to know that is it posible to call button click event before
> page load event on post back....
> please help me....
>



 
Reply With Quote
 
 
 
 
GauravGupta
Guest
Posts: n/a
 
      06-30-2007
On Jun 29, 7:04 pm, "Mike" <(E-Mail Removed)> 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" <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed) oups.com...
>
>
>
> >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...

 
Reply With Quote
 
Mike
Guest
Posts: n/a
 
      07-02-2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> On Jun 29, 7:04 pm, "Mike" <(E-Mail Removed)> 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" <(E-Mail Removed)> wrote in message
>>
>> news:(E-Mail Removed) oups.com...
>>
>>
>>
>> >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...
>



 
Reply With Quote
 
Shilpa1234 Shilpa1234 is offline
Junior Member
Join Date: Jan 2012
Posts: 1
 
      01-19-2012
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
image button click event fires before click event of button Purvi T ASP .Net 0 10-19-2004 06:19 AM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net Building Controls 1 05-28-2004 06:23 AM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net 2 05-25-2004 11:45 PM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net Datagrid Control 0 05-25-2004 01:45 AM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net Web Controls 0 05-25-2004 01:45 AM



Advertisments