473,774 Members | 2,129 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is it possible to call button click event before page load on postback

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 #1
2 3119
On Jun 30, 1:55 pm, GauravGupta <gaurav.gupta.. .@gmail.comwrot e:
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...
this is basic nature of web programming. fetched data in if(!
ispostbacl){} block
it may help...can you please copy paste some code here

nahid
http://nahidulkibria.blogspot.com/
http://kaz.com.bd
Jun 30 '07 #2
GauravGupta wrote:
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...
The control events happens after the Load event, and you can't change that.

Display the data in the PreRender event instead, as that happens after
the control events.

--
Göran Andersson
_____
http://www.guffa.com
Jul 1 '07 #3

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

Similar topics

13
4757
by: Samantha Smit | last post by:
Hi, I am trying to create a simple asp page that has one command button that updates a database. The URL of the page is like this: http://MyServer.com/Update.asp?UserName=Tom My asp code is like this: %@ Language=VBScript %> <!--#include file="includes/openconnection.asp"-->
8
5445
by: Lee | last post by:
Hi,I'm trying to have a button that fires a click event only once. What is the best way to do so that after the first button click, any the following clicks will be ignored.
6
1402
by: Karl Hungus | last post by:
Im using an xsl transformation so its not practical to use controls in the usual way, but I would still like to call methods in my codebehind class. usually Id just use onclick="<eventHandler>" say for something like a button control is there a way to manually call a method defined in a codebehind class, but is not called by a standard control? I looked at the __doPostBack() function that .net generates but it seemed impenetrable.
4
3394
by: Ryan Ternier | last post by:
I have a button event: Public Sub SwitchItem(ByVal sender As System.Object, ByVal e As System.EventArgs) Dim btnTest As New Button Dim astrTest As String() btnTest = CType(sender, Button) astrTest = btnTest.ClientID.Split("_") strControlsToEdit = astrTest(2)
4
1695
by: TJ | last post by:
Hi, There is one aspx web page that contains usercontrol. In aspx page and usercontrol , there is each submit button... Here is what I want... I want to process something depending on each page's IsPostBack property... For exmple.... when I click the submit button which is in usercontrol, ASPX page should
2
3419
by: Samy | last post by:
Hi There, I have a user control with buttons on it which I use on a aspx page (parent page). On a button click, a modal dialog(aspx page) opens up and the user enters some info in the modal dialog and clicks the save button on it. The info is saved to the DB and the parent page is refreshed. Everything works fine but for some reason the page load is called twice. I have set the AutoEventWireUp = false on every page. Also I have load event...
2
3922
by: SteveSu | last post by:
Hi! I want to make a postback when the user hits the escape-button on the keyboard and redirect the user to another page. But the response.redirect does not work for me in this "context". I´m trying to do like this: <body onkeydown="MyRedirect()">
4
8472
by: Bob | last post by:
Hi, I'm working with VWD and i defined programmatically a button (in code-behind) with an ID. So I expect to see beside "Page Events" and "Form1" my button "b1" in order to use the Click event. But it doesnt' appear. After saving the code-behind file, i only see "Page Events" and "Form1". If i define the button declarativally, i see it. But i need to define it programmatically. Can anybody tell me how to do? I also tried with...
2
2816
by: chrisp | last post by:
I have an ASP.NET 2 page with a button that causes a credit card transaction to be authorised. The authorisation procedure may take a few seconds and so I want to prevent the user from clicking the button again (or at least detect that an authorisation is already in progress and do nothing) while the first authorisation is in progress. Can someone help me out? I've tried the following but none of the solutions work: 1) Disabling the...
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10267
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10106
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9914
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7463
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4012
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.