473,320 Members | 1,828 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,320 software developers and data experts.

PostBack and events

Hi,

I'm having a page with:

Private Sub Page_Load(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles MyBase.Load

containing the body of my source code.
And also a button with the onclick event:

Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click

If I click the button the debugger is stopping at the
Page_Load function instead at Button1_Click! Why this? I
expected it to stop at Button1_Click, changing a value and
then loading the page again by using
Server.Transfer(webform1.aspx) !

I hope somebody can help me!

Thanks in advance

Steve
Nov 18 '05 #1
2 913

"Steve" <an*******@discussions.microsoft.com> wrote in message
news:0b****************************@phx.gbl...
Hi,

I'm having a page with:

Private Sub Page_Load(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles MyBase.Load

containing the body of my source code.
And also a button with the onclick event:

Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click

If I click the button the debugger is stopping at the
Page_Load function instead at Button1_Click! Why this? I
expected it to stop at Button1_Click, changing a value and
then loading the page again by using
Server.Transfer(webform1.aspx) !

I hope somebody can help me!

Thanks in advance

Steve


The Page_Load even will fire "before" your Button1_click event. It is does
not go to the click event after the Page_Load event, then you may check to
make sure your event hook it still set correctly.
--
Rocky Moore
www.HintsAndTips.com
Nov 18 '05 #2
I hope this is not duplicated, I posted a reply but did not see it show up
while others did. So if this is a duplicate, sorry!
--

The Page_Load even will fire "before" your Button1_click event. If is does
not go to the click event after the Page_Load event, then you may check to
make sure your event hook it still set correctly.
--
Rocky Moore
www.HintsAndTips.com
"Steve" <an*******@discussions.microsoft.com> wrote in message
news:0b****************************@phx.gbl...
Hi,

I'm having a page with:

Private Sub Page_Load(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles MyBase.Load

containing the body of my source code.
And also a button with the onclick event:

Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click

If I click the button the debugger is stopping at the
Page_Load function instead at Button1_Click! Why this? I
expected it to stop at Button1_Click, changing a value and
then loading the page again by using
Server.Transfer(webform1.aspx) !

I hope somebody can help me!

Thanks in advance

Steve

Nov 18 '05 #3

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

Similar topics

6
by: V | last post by:
I have found that when I have a composite control that uses the CreateChildControls method, on a regular page load, Page_Load executes before CreateChildControls, but on a postback it is the...
10
by: Krista Lemieux | last post by:
I'm new to ASP.NET and I'm not use to the way things are handled with this technology. I've been told that when I have a control, I should only bind the data to it once, and not on each post back...
2
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control...
4
by: AIM48 | last post by:
Hi. We have a framework that we work with for our project. So far we have had very good success – basically the frame work wraps many day to day tasks so that they are all included in the...
8
by: walesboy | last post by:
greetings - I have a btnSubmit button with a Handles btnSubmit.click which works great if all the user does is click that button. But, if the user ALSO changes a text box on the page (which...
1
by: Timbo | last post by:
Hi all, This is my first message here so i'll try and include all the information that will help you help me out, if possible. Basically I am using C# in ASP.NET 2.0 and have a Repeater...
2
by: Nathan Sokalski | last post by:
I have a DataList in which the ItemTemplate contains two Button controls that use EventBubbling. When I click either of them I receive the following error: Server Error in '/' Application....
2
by: John Kotuby | last post by:
Hi guys, I am converting a rather complicated database driven Web application from classic ASP to ASP.NET 2.0 using VB 2005 as the programming language. The original ASP application works quite...
7
by: =?Utf-8?B?TWlrZSBMb2dhbg==?= | last post by:
My environment. .Net 2.0 VS2k5 SP1, IE6 (6.0.2900.2180) I have a web content page. The page will post back twice if I am running in debug mode. However if I run through the breakpoints fast...
9
by: 200dogz | last post by:
Hi guys, I want to have a button which opens up a new window when pressed. <asp:Button ID="Button1" runat="server" Text="Open new window" /> ... Button1.Attributes.Add("OnClick",
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.