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

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

i want to know that is it posible to call button click event before
page load event on post back....
please help me....

Jun 29 '07 #1
3 21023
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" <ga*************@gmail.comwrote in message
news:11**********************@m37g2000prh.googlegr 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....

Jun 29 '07 #2
On Jun 29, 7:04 pm, "Mike" <M...@community.nospam.comwrote:
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" <gaurav.gupta...@gmail.comwrote in message

news:11**********************@m37g2000prh.googlegr 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...

Jun 30 '07 #3
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" <ga*************@gmail.comwrote in message
news:11**********************@x35g2000prf.googlegr oups.com...
On Jun 29, 7:04 pm, "Mike" <M...@community.nospam.comwrote:
>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" <gaurav.gupta...@gmail.comwrote in message

news:11**********************@m37g2000prh.googleg roups.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...

Jul 2 '07 #4

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

Similar topics

1
by: Bob Erwin | last post by:
Hey, I have an interesting problem that I need some assistance for... It is my understanding that when you click a button on an ASP.NET page, it will actually run the page load first and then...
1
by: WFB | last post by:
Hi, I have a base class from which all of my pages derive (ABCBasePage). For example, ABCCustomerSelect Inherits ABCPasePage. I would now like to have ABCPocketSelect which should inherit from...
0
by: Frank 'Olorin' Rizzi | last post by:
Hello everyone. This is quite convoluted, but I'll try to make it simple. I have a couple of bottom-line questions (I guess): 1~ what happens between the Page_Load routine in the code behind...
1
by: Magdelin | last post by:
Hi, I have a BasePage class from which all other ASPX pages of the project is inherited. The BasePage class implements Page_Load event handler. All child pages have its AutoEventWireUp property...
1
by: thedotnetarchitect | last post by:
Can anyone tell me why my page load event is firing more then once? I have a asp.net 2.0 page with four user controls and it seems that the user controls are loading but the page load event seems...
4
by: samuelberthelot | last post by:
Hi, I'm struggling there. My page load event is called the first time the page is loaded. Then I move to another page using Response.Redirect, and when I click the back button of the browser I...
1
by: bigijoseph | last post by:
Please help : page load event is not firing. -------------------------------------------------------------------------------- Hi, I am a new to .net. I am trying to learn it. I tried the...
4
by: parez | last post by:
Hi, Whats the winforms equivalent of asp.net page load event? I am trying to clear a status message field every time a user clicks on any of the buttons..
1
by: hemantkamb | last post by:
Hi…. I have created one website with Master and content page . I have taken TreeView Control on master page. And I wants that when I click to tree node the value of tree node is added to...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.