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

User Control Button Click event not firing when placed in a Web form

I have a problem (don't we all?). I have a web form with multiple modules,
some of these modules have an ASP.NET (server run) button.

OK, now I have UserControlX which has one such button (say Login). In that
user control I defined both the Command and Click events for the button and
placed a break point on it (in addition to traces). This user control is
then included in the main form within the Form element/tags. Both the user
control and the button therein have EnableViewState set.

Then on the displayed web form I press the button contained in the module
and NOTHING HAPPENS!, no break point (yes, it is in Debug mode rather than
Release). I see the Page_Load being fired initially but there is never a
post back, nor there is a firing of the button's events of the user control.

I must be missing something simple but what is it?
Nov 19 '05 #1
2 9826

Dear .Net Ed,

Is it possible you have a validator or something that is preventing the form from posting. If the page loading event is firing but not that post pack for the button make sure the button kept it's handle statement in the end of the sub routing. Sometimes copying and pasting controls around in the page causes them to loose their link to what is suppose to call them.

-Calvin Luttrell
ProjectThunder.com, Inc.
nothing is impossible

I have a problem (don't we all?). I have a web form with multiple modules,
some of these modules have an ASP.NET (server run) button.

OK, now I have UserControlX which has one such button (say Login). In that
user control I defined both the Command and Click events for the button and
placed a break point on it (in addition to traces). This user control is
then included in the main form within the Form element/tags. Both the user
control and the button therein have EnableViewState set.

Then on the displayed web form I press the button contained in the module
and NOTHING HAPPENS!, no break point (yes, it is in Debug mode rather than
Release). I see the Page_Load being fired initially but there is never a
post back, nor there is a firing of the button's events of the user control.

I must be missing something simple but what is it?


Nov 19 '05 #2
Thanks, it turned out to be a really silly typo error, looked over it so many times that it looked right...

"Calvin Luttrell" <Ca****@NOSPAM.projectthunder.com> wrote in message news:%2****************@TK2MSFTNGP14.phx.gbl...

Dear .Net Ed,

Is it possible you have a validator or something that is preventing the form from posting. If the page loading event is firing but not that post pack for the button make sure the button kept it's handle statement in the end of the sub routing. Sometimes copying and pasting controls around in the page causes them to loose their link to what is suppose to call them.

-Calvin Luttrell
ProjectThunder.com, Inc.
nothing is impossible

I have a problem (don't we all?). I have a web form with multiple modules,
some of these modules have an ASP.NET (server run) button.

OK, now I have UserControlX which has one such button (say Login). In that
user control I defined both the Command and Click events for the button and
placed a break point on it (in addition to traces). This user control is
then included in the main form within the Form element/tags. Both the user
control and the button therein have EnableViewState set.

Then on the displayed web form I press the button contained in the module
and NOTHING HAPPENS!, no break point (yes, it is in Debug mode rather than
Release). I see the Page_Load being fired initially but there is never a
post back, nor there is a firing of the button's events of the user control.

I must be missing something simple but what is it?


Nov 19 '05 #3

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

Similar topics

3
by: Scott Schade | last post by:
I have a form onto which I add a control during execution. The control is a control that I wrote. The control has a number of controls on it. I would like to click on a button on the control and...
3
by: Tim Thomas | last post by:
Hi, I am very new to .NET and am in the process of building my first web application. I will briefly describe what i am trying to achieve: I have a system where suppliers register their...
7
by: moondaddy | last post by:
I have a user control being used instead of a frame page. when the user clicks on a menu item I need to send the ID (integer value) of that menu as a parameter in the postback of the user control...
1
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a...
1
by: Troy | last post by:
I have a usercontrol placed inside a container control on the main form. The user control has an image button plus several text boxes. When I click the button, some sort of activity occurs but the...
1
by: Earl Teigrob | last post by:
PROBLEM: When a user control is loaded into a PlaceHolder control more than once, the events do not fire on the first click of a control on the dynamically loaded user control. In other words, the...
6
by: grist2mill | last post by:
I want to create a standard tool bar that appears on all pages that is a control. The toolbar has a button 'New'. What I wolud like when the user clicks on 'New' depends on the page they are on. I...
4
by: EvelynAnd Ethan | last post by:
Hi, ItemCommand event not firing from a dynamic user control ,WHERE A DATAGRID HAS BUTTON,when i click on the linkbutton first time the itemcommand event doesnt fire,second time event fires up ...
0
by: davidr | last post by:
Hi, I have a panel that I load user Control in no problem. The problem arrises when I do a post back on one of these user controls. I have button it does a click event. In this click event I...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
0
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...
0
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,...
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...

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.