I can confirm this behaviour.
Create a simple webform with a server side TextEdit
control and a server side Button control with an OnClick
handler.
Run the app, click on the TextEdit control and press the
Enter button. The page OnLoad handler as expected, but the
button's OnClick handler will not.
However, if you then add a second TextEdit control to the
page, the OnClick will execute! But if you then hide the
second TextEdit control, it will not be rendered on the
WebPage and then the OnClick will not execute.
If you use an HTML Input control (not server side) instead
as the second text edit control then it will work again.
But if use a hidden HTML Input control (type=hidden) it
stops working again.
However if you add the HTML Input control and give it
style="VISIBILITY: hidden" then it will work!
This behaviour is present in both VS2002 and VS2003.
I do not have a satisfactory explanation about this
behaviour. I can only find some obscure jscript work
around hacks on the net. This issue has been around since
day one and I can't believe that an MCP claims ignorance
about this now.
This issue alone has delayed the rollout of one my ASP.Net
apps for over a month and has cost us a lot of time and
money.
This is a general comment, But I yet to complete a 12
month project in 3 months. Does anyone actually believe
this "do more with less" nonsense? I apologize for my
cynicism, but I have yet to meet anyone who can honestly
claim that ASP.NET has made them more productive. In fact,
I've never missed so many deadlines since I've started
using it because of issues like this.
Regards,
Deepthroat
>-----Original Message-----
>
>Hi
>
>Based on my understanding, you have 2 web form application
(Asp.net
>application), almost the same, when click button(enter
button), one
>application fires click event, while the other did not
fire.
>
>I think your problem is somewhat strange, both your
button click events
>should fire.
>Are your buttons server side button controls?(with
attribute runat=server).
>Only server side control will fire the server side event.
>For your second application, when you click enter button,
does the
>page_load event fire?(You can determine this through set
breakpoint in you
>Page_Load event)
>
>Best regards,
>Jeffrey Tan
>Microsoft Online Partner Support
>Get Secure! - www.microsoft.com/security
>This posting is provided "as is" with no warranties and
confers no rights.
>
>.
>