I'm having a problem I can't reproduce in a simple example. If I create a
class that inherits button and click on it in a web page, if I override the
OnClick method, on clicking, any code is executed, and any breakpoints
within it are hit. This exepcted behavior works in simple test projects
under a lot of different conditions.
OK so I put the exact same button inheritor in the live project that I'm
working on, and... the overriden OnClick method is *not* hit. No code
executes, no breakpoints are hit within it, and I have no idea why. Since I
cannot simply reproduce the problem (and therefore have no code I can
reasonably post) I was hoping someone might, off the top of their head, give
me a few guesses as to why this is happening, or offer a suggestion for
diagnosing the problem.
TIA,
Paul 8 2226
I assume you mean OnClick on the Server?
Does the page even reload? Is Page_Load being called?
Is the submit on the client executed?
No validators in the way?
"PJ6" <no****@nowhere.net> wrote in message
news:Ob**************@TK2MSFTNGP14.phx.gbl... I'm having a problem I can't reproduce in a simple example. If I create a class that inherits button and click on it in a web page, if I override the OnClick method, on clicking, any code is executed, and any breakpoints within it are hit. This exepcted behavior works in simple test projects under a lot of different conditions.
OK so I put the exact same button inheritor in the live project that I'm working on, and... the overriden OnClick method is *not* hit. No code executes, no breakpoints are hit within it, and I have no idea why. Since I cannot simply reproduce the problem (and therefore have no code I can reasonably post) I was hoping someone might, off the top of their head, give me a few guesses as to why this is happening, or offer a suggestion for diagnosing the problem.
TIA, Paul
Server OnClick.
The page reloads, which I verified with a breakpoint.
I'm not emitting or concerned with any clientside code for this particular
problem.
No validators.
Paul
"Remy Blaettler" <rb********@hotmail.com> wrote in message
news:eg**************@TK2MSFTNGP09.phx.gbl... I assume you mean OnClick on the Server? Does the page even reload? Is Page_Load being called? Is the submit on the client executed?
No validators in the way?
"PJ6" <no****@nowhere.net> wrote in message news:Ob**************@TK2MSFTNGP14.phx.gbl... I'm having a problem I can't reproduce in a simple example. If I create
a class that inherits button and click on it in a web page, if I override the OnClick method, on clicking, any code is executed, and any
breakpoints within it are hit. This exepcted behavior works in simple test projects under a lot of different conditions.
OK so I put the exact same button inheritor in the live project that I'm working on, and... the overriden OnClick method is *not* hit. No code executes, no breakpoints are hit within it, and I have no idea why.
Since I cannot simply reproduce the problem (and therefore have no code I can reasonably post) I was hoping someone might, off the top of their head, give me a few guesses as to why this is happening, or offer a suggestion for diagnosing the problem.
TIA, Paul
Check the "__EVENTTARGET" property in the Page_Load method.
string target = Request["__EVENTTARGET"];
This should contain the name of your button.
Remy Blaettler www.collaboral.com
Target shows as nothing... but I get nothing for when it works, too.
Paul
"Remy" <rb********@hotmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com... Check the "__EVENTTARGET" property in the Page_Load method.
string target = Request["__EVENTTARGET"];
This should contain the name of your button.
Remy Blaettler www.collaboral.com
If I dynamically add a button - not OnLoad, but from the click event of
another button, that button's click event is completely ignored server-side.
Is this a bug? Is there a way to get it to work?
Paul
"PJ6" <no****@nowhere.net> wrote in message
news:eI**************@TK2MSFTNGP15.phx.gbl... Target shows as nothing... but I get nothing for when it works, too.
Paul
"Remy" <rb********@hotmail.com> wrote in message news:11**********************@g14g2000cwa.googlegr oups.com... Check the "__EVENTTARGET" property in the Page_Load method.
string target = Request["__EVENTTARGET"];
This should contain the name of your button.
Remy Blaettler www.collaboral.com
Oh, man. I see why now. Boy do I hate web development.
Paul
"PJ6" <no****@nowhere.net> wrote in message
news:Ow**************@TK2MSFTNGP12.phx.gbl... If I dynamically add a button - not OnLoad, but from the click event of another button, that button's click event is completely ignored server-side. Is this a bug? Is there a way to get it to work?
Paul
"PJ6" <no****@nowhere.net> wrote in message news:eI**************@TK2MSFTNGP15.phx.gbl... Target shows as nothing... but I get nothing for when it works, too.
Paul
"Remy" <rb********@hotmail.com> wrote in message news:11**********************@g14g2000cwa.googlegr oups.com... Check the "__EVENTTARGET" property in the Page_Load method.
string target = Request["__EVENTTARGET"];
This should contain the name of your button.
Remy Blaettler www.collaboral.com
and, what was the issue?
--
Remy Blaettler
Helping you collaborate better! www.collaboral.com
"PJ6" <no****@nowhere.net> wrote in message
news:eI**************@TK2MSFTNGP12.phx.gbl... Oh, man. I see why now. Boy do I hate web development.
Paul
"PJ6" <no****@nowhere.net> wrote in message news:Ow**************@TK2MSFTNGP12.phx.gbl... If I dynamically add a button - not OnLoad, but from the click event of another button, that button's click event is completely ignored server-side. Is this a bug? Is there a way to get it to work?
Paul
"PJ6" <no****@nowhere.net> wrote in message news:eI**************@TK2MSFTNGP15.phx.gbl... Target shows as nothing... but I get nothing for when it works, too.
Paul
"Remy" <rb********@hotmail.com> wrote in message news:11**********************@g14g2000cwa.googlegr oups.com... Check the "__EVENTTARGET" property in the Page_Load method.
string target = Request["__EVENTTARGET"];
This should contain the name of your button.
Remy Blaettler www.collaboral.com
See my later post "on method for handling dynamic control events", which
should read "one method for handling dynamic control events". I thought my
solution was cool enough to share, though I'm sure someone's thought of it
before.
Paul
"Remy Blaettler" <rb********@hotmail.com> wrote in message
news:u3**************@TK2MSFTNGP15.phx.gbl... and, what was the issue?
-- Remy Blaettler Helping you collaborate better! www.collaboral.com
"PJ6" <no****@nowhere.net> wrote in message news:eI**************@TK2MSFTNGP12.phx.gbl... Oh, man. I see why now. Boy do I hate web development.
Paul
"PJ6" <no****@nowhere.net> wrote in message news:Ow**************@TK2MSFTNGP12.phx.gbl... If I dynamically add a button - not OnLoad, but from the click event of another button, that button's click event is completely ignored server-side. Is this a bug? Is there a way to get it to work?
Paul
"PJ6" <no****@nowhere.net> wrote in message news:eI**************@TK2MSFTNGP15.phx.gbl... Target shows as nothing... but I get nothing for when it works, too.
Paul
"Remy" <rb********@hotmail.com> wrote in message news:11**********************@g14g2000cwa.googlegr oups.com... > Check the "__EVENTTARGET" property in the Page_Load method. > > string target = Request["__EVENTTARGET"]; > > This should contain the name of your button. > > Remy Blaettler > www.collaboral.com >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Vern |
last post by:
I'd like the default text to show up in designer, and allow it to be changed
to something else. I was able to change some of the other properties, but
for some reason I'm having trouble with the...
|
by: IntraRELY |
last post by:
I need to attach the following 2 little scripts to an ASP.NET Button. I am
having an issue with running both of the Attributes.Add. I can only get on
to work at once. I have also tried to put them...
|
by: Carlo Marchesoni |
last post by:
I have a button that opens a new Window (some kind of search-window), which is fired using JavaScript (btnSearch.Attributes=".....";)
Now I need to run some code behind code BEFORE this JavaScript...
|
by: Sedef |
last post by:
Hi,
i'm trying to create a custom Button user control which will be derived from System.Web.UI.WebControls.Button. the normal server side Button class creates some client side javascript code for...
|
by: hb |
last post by:
Hi,
I have a asp:button btnGo. When clicking this button,
the code will parse a asp:table to find a specific ID
under certain conditions. Once the ID is found, the code
need to keep the current...
|
by: John Boy |
last post by:
Hi,
Can anyone help. This is really doing my nut in. 3 years ASP exp. and
now doing .DOT which is a step in the wrong direction.
Basically I am left with the code of a guy who has left. When I...
|
by: Mick Doherty |
last post by:
Steps to reproduce:
Inherit from button.
Add button to project's form.
Run project.
Make button Default.
Press and Hold SpaceBar (so button is pressed)
Move Mouse.
Release SpaceBar.
|
by: libsfan01 |
last post by:
Hi all
is it possible to onclick of a button in one form submit that form and
also submit another form on the same page, both with the same 'action'
location? or is it only possible to send one...
|
by: Tom |
last post by:
The included code block demonstrates programmatically clicking a
non-derived ToolStripButton in the OnShown() method.
When I derive a button from ToolStripButton and override the _private_...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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...
|
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...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
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...
|
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,...
| |