Saturday, March 31, 2012
Strange Behavior for Pages Named Default.aspx
I like to create and track page view events, increment counters, etc.
I do this in a block on each page, like this...
protected void Page_Load(object sender, EventArgs e)
{
if(!this.Page.IsPostBack)
{
Event.Write(EventSource.UserActivity,EventType.Informational,"My
event text");
Counter.Hit(WebPage.MyPage);
}
}
Now, for the problem. I noticed that many events are being written
twice, and many counters are being incremented twice when viewing the
page only once. When I set a breakpoint inside the code block above,
for any page named "Default.aspx" (no matter where it is in the folder
structure) the lines inside the code block execute twice. If I rename
the page to something else, they execute only once, as expected.
Does anyone know what causes this? How can I fix it?Hi Joey,
Seems page events are fired twice because event handler is assigned two
times - by the AutoWireupEvent directive and by your code by adding the
handler explicitely (vb.net AddHandler or Handles clauses)
Milosz
"Joey" wrote:
> I have several asp.net 2.0 apps written in VS2005 in C#. For each one,
> I like to create and track page view events, increment counters, etc.
> I do this in a block on each page, like this...
> protected void Page_Load(object sender, EventArgs e)
> {
> if(!this.Page.IsPostBack)
> {
> Event.Write(EventSource.UserActivity,EventType.Informational,"My
> event text");
> Counter.Hit(WebPage.MyPage);
> }
> }
> Now, for the problem. I noticed that many events are being written
> twice, and many counters are being incremented twice when viewing the
> page only once. When I set a breakpoint inside the code block above,
> for any page named "Default.aspx" (no matter where it is in the folder
> structure) the lines inside the code block execute twice. If I rename
> the page to something else, they execute only once, as expected.
> Does anyone know what causes this? How can I fix it?
>
On Jun 27, 5:38 pm, Milosz Skalecki [MCAD] <mily...@.DONTLIKESPAMwp.pl>
wrote:
> Hi Joey,
> Seems page events are fired twice because event handler is assigned two
> times - by the AutoWireupEvent directive and by your code by adding the
> handler explicitely (vb.net AddHandler or Handles clauses)
> --
> Milosz
>
> "Joey" wrote:
>
>
>
> - Show quoted text -
My code does not explicitly assign any event handlers.
Hi again Joey,
I hope you are well. Could you please paste both aspx page and code beside
so we could have a look?
--
Milosz
"Joey" wrote:
> On Jun 27, 5:38 pm, Milosz Skalecki [MCAD] <mily...@.DONTLIKESPAMwp.pl>
> wrote:
> My code does not explicitly assign any event handlers.
>
Strange Behavior for Pages Named Default.aspx
I like to create and track page view events, increment counters, etc.
I do this in a block on each page, like this...
protected void Page_Load(object sender, EventArgs e)
{
if(!this.Page.IsPostBack)
{
Event.Write(EventSource.UserActivity,EventType.Inf ormational,"My
event text");
Counter.Hit(WebPage.MyPage);
}
}
Now, for the problem. I noticed that many events are being written
twice, and many counters are being incremented twice when viewing the
page only once. When I set a breakpoint inside the code block above,
for any page named "Default.aspx" (no matter where it is in the folder
structure) the lines inside the code block execute twice. If I rename
the page to something else, they execute only once, as expected.
Does anyone know what causes this? How can I fix it?Hi Joey,
Seems page events are fired twice because event handler is assigned two
times - by the AutoWireupEvent directive and by your code by adding the
handler explicitely (vb.net AddHandler or Handles clauses)
--
Milosz
"Joey" wrote:
Quote:
Originally Posted by
I have several asp.net 2.0 apps written in VS2005 in C#. For each one,
I like to create and track page view events, increment counters, etc.
I do this in a block on each page, like this...
>
protected void Page_Load(object sender, EventArgs e)
{
if(!this.Page.IsPostBack)
{
Event.Write(EventSource.UserActivity,EventType.Inf ormational,"My
event text");
Counter.Hit(WebPage.MyPage);
}
}
>
Now, for the problem. I noticed that many events are being written
twice, and many counters are being incremented twice when viewing the
page only once. When I set a breakpoint inside the code block above,
for any page named "Default.aspx" (no matter where it is in the folder
structure) the lines inside the code block execute twice. If I rename
the page to something else, they execute only once, as expected.
>
Does anyone know what causes this? How can I fix it?
>
>
On Jun 27, 5:38 pm, Milosz Skalecki [MCAD] <mily...@.DONTLIKESPAMwp.pl>
wrote:
Quote:
Originally Posted by
Hi Joey,
>
Seems page events are fired twice because event handler is assigned two
times - by the AutoWireupEvent directive and by your code by adding the
handler explicitely (vb.net AddHandler or Handles clauses)
>
--
Milosz
>
>
>
"Joey" wrote:
Quote:
Originally Posted by
I have several asp.net 2.0 apps written in VS2005 in C#. For each one,
I like to create and track page view events, increment counters, etc.
I do this in a block on each page, like this...
>
Quote:
Originally Posted by
protected void Page_Load(object sender, EventArgs e)
{
if(!this.Page.IsPostBack)
{
Event.Write(EventSource.UserActivity,EventType.Inf ormational,"My
event text");
Counter.Hit(WebPage.MyPage);
}
}
>
Quote:
Originally Posted by
Now, for the problem. I noticed that many events are being written
twice, and many counters are being incremented twice when viewing the
page only once. When I set a breakpoint inside the code block above,
for any page named "Default.aspx" (no matter where it is in the folder
structure) the lines inside the code block execute twice. If I rename
the page to something else, they execute only once, as expected.
>
Quote:
Originally Posted by
Does anyone know what causes this? How can I fix it?- Hide quoted text -
>
- Show quoted text -
My code does not explicitly assign any event handlers.
Hi again Joey,
I hope you are well. Could you please paste both aspx page and code beside
so we could have a look?
--
Milosz
"Joey" wrote:
Quote:
Originally Posted by
On Jun 27, 5:38 pm, Milosz Skalecki [MCAD] <mily...@.DONTLIKESPAMwp.pl>
wrote:
Quote:
Originally Posted by
Hi Joey,
Seems page events are fired twice because event handler is assigned two
times - by the AutoWireupEvent directive and by your code by adding the
handler explicitely (vb.net AddHandler or Handles clauses)
--
Milosz
"Joey" wrote:
Quote:
Originally Posted by
I have several asp.net 2.0 apps written in VS2005 in C#. For each one,
I like to create and track page view events, increment counters, etc.
I do this in a block on each page, like this...
Quote:
Originally Posted by
protected void Page_Load(object sender, EventArgs e)
{
if(!this.Page.IsPostBack)
{
Event.Write(EventSource.UserActivity,EventType.Inf ormational,"My
event text");
Counter.Hit(WebPage.MyPage);
}
}
Quote:
Originally Posted by
Now, for the problem. I noticed that many events are being written
twice, and many counters are being incremented twice when viewing the
page only once. When I set a breakpoint inside the code block above,
for any page named "Default.aspx" (no matter where it is in the folder
structure) the lines inside the code block execute twice. If I rename
the page to something else, they execute only once, as expected.
Quote:
Originally Posted by
Does anyone know what causes this? How can I fix it?- Hide quoted text -
- Show quoted text -
>
My code does not explicitly assign any event handlers.
>
>
Tuesday, March 13, 2012
strange problem since migrating to server 2003
Once you get to the screen, none of the buttons work. Does not respond to
events period.
After the first time it happened, I simply recompiled and everything was
back to normal. Now that I have deployed a new version, random screens
refuse to respond to events.
The only difference is that we have migrated to server 2003. This never
happened (at least not this kind of problem) with 2000. Sorry I can't be
more specific, but that is what's been happening.Followup.
This is only a problem with IE, not with Netscape or FireFox.
And it's not just my machine. And it's consistent.
So why does Microsoft's OWN browser fail to work?
> Some screens of the web application simply do not respond to events
period.
> Once you get to the screen, none of the buttons work. Does not respond to
> events period.
> After the first time it happened, I simply recompiled and everything was
> back to normal. Now that I have deployed a new version, random screens
> refuse to respond to events.
> The only difference is that we have migrated to server 2003. This never
> happened (at least not this kind of problem) with 2000. Sorry I can't be
> more specific, but that is what's been happening.
>
Looks like it's another instance of the latest ASP.NET service pack problem.
It is reported by many. Look for example at yesterday's thread re: ASP.NET
problem.
Eliyahu
"David C" <nospam@.nospam.com> wrote in message
news:hQxbd.7357$Kl3.3874@.twister.socal.rr.com...
> Followup.
> This is only a problem with IE, not with Netscape or FireFox.
> And it's not just my machine. And it's consistent.
> So why does Microsoft's OWN browser fail to work?
>
> period.
to
be
>
Are you hitting the web application from Internet Explorer on Windows
2003?
IE on 2003 is locked down - will not run ActiveX, will not run
JavaScript. Not executing JavaScript will break any asp.net form.
These are the default settings.
I would not advise turning off the hardened security features,
instead, add the server(s) with the asp.net application to the list of
trusted sites in IE.
Scott
http://www.OdeToCode.com/blogs/scott/
On Thu, 14 Oct 2004 16:06:47 GMT, "David C" <nospam@.nospam.com> wrote:
>Some screens of the web application simply do not respond to events period.
>Once you get to the screen, none of the buttons work. Does not respond to
>events period.
>After the first time it happened, I simply recompiled and everything was
>back to normal. Now that I have deployed a new version, random screens
>refuse to respond to events.
>The only difference is that we have migrated to server 2003. This never
>happened (at least not this kind of problem) with 2000. Sorry I can't be
>more specific, but that is what's been happening.
>
strange problem since migrating to server 2003
Once you get to the screen, none of the buttons work. Does not respond to
events period.
After the first time it happened, I simply recompiled and everything was
back to normal. Now that I have deployed a new version, random screens
refuse to respond to events.
The only difference is that we have migrated to server 2003. This never
happened (at least not this kind of problem) with 2000. Sorry I can't be
more specific, but that is what's been happening.Followup.
This is only a problem with IE, not with Netscape or FireFox.
And it's not just my machine. And it's consistent.
So why does Microsoft's OWN browser fail to work?
> Some screens of the web application simply do not respond to events
period.
> Once you get to the screen, none of the buttons work. Does not respond to
> events period.
> After the first time it happened, I simply recompiled and everything was
> back to normal. Now that I have deployed a new version, random screens
> refuse to respond to events.
> The only difference is that we have migrated to server 2003. This never
> happened (at least not this kind of problem) with 2000. Sorry I can't be
> more specific, but that is what's been happening.
Looks like it's another instance of the latest ASP.NET service pack problem.
It is reported by many. Look for example at yesterday's thread re: ASP.NET
problem.
Eliyahu
"David C" <nospam@.nospam.com> wrote in message
news:hQxbd.7357$Kl3.3874@.twister.socal.rr.com...
> Followup.
> This is only a problem with IE, not with Netscape or FireFox.
> And it's not just my machine. And it's consistent.
> So why does Microsoft's OWN browser fail to work?
> > Some screens of the web application simply do not respond to events
> period.
> > Once you get to the screen, none of the buttons work. Does not respond
to
> > events period.
> > After the first time it happened, I simply recompiled and everything was
> > back to normal. Now that I have deployed a new version, random screens
> > refuse to respond to events.
> > The only difference is that we have migrated to server 2003. This never
> > happened (at least not this kind of problem) with 2000. Sorry I can't
be
> > more specific, but that is what's been happening.
Are you hitting the web application from Internet Explorer on Windows
2003?
IE on 2003 is locked down - will not run ActiveX, will not run
JavaScript. Not executing JavaScript will break any asp.net form.
These are the default settings.
I would not advise turning off the hardened security features,
instead, add the server(s) with the asp.net application to the list of
trusted sites in IE.
--
Scott
http://www.OdeToCode.com/blogs/scott/
On Thu, 14 Oct 2004 16:06:47 GMT, "David C" <nospam@.nospam.com> wrote:
>Some screens of the web application simply do not respond to events period.
>Once you get to the screen, none of the buttons work. Does not respond to
>events period.
>After the first time it happened, I simply recompiled and everything was
>back to normal. Now that I have deployed a new version, random screens
>refuse to respond to events.
>The only difference is that we have migrated to server 2003. This never
>happened (at least not this kind of problem) with 2000. Sorry I can't be
>more specific, but that is what's been happening.