Return of the double postback bug
-
Many of you know this bug from ASP.NET 1.x. They said they fixed it, but for some reason we were hitting the same issue on a page with ASP.NET 2.0. After a long and hard search I found something like this:
<%@ Page Language="C#" AutoEventWireup="true" %>
<script runat="server" type="text/C#">
void Page_Load(object sender, EventArgs e)
{
System.Diagnostics.Trace.WriteLine("Postback!");
}
</script><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<img src="" />
</div>
</form>
</body>
</html>Note the IMG element with the empty S
-
Many of you know this bug from ASP.NET 1.x. They said they fixed it, but for some reason we were hitting the same issue on a page with ASP.NET 2.0. After a long and hard search I found something like this:
<%@ Page Language="C#" AutoEventWireup="true" %>
<script runat="server" type="text/C#">
void Page_Load(object sender, EventArgs e)
{
System.Diagnostics.Trace.WriteLine("Postback!");
}
</script><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<img src="" />
</div>
</form>
</body>
</html>Note the IMG element with the empty S
leppie wrote:
IMG element with the empty SRC attribute
Ha! It does request on the same page?
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
-
leppie wrote:
IMG element with the empty SRC attribute
Ha! It does request on the same page?
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
Yes :( In both IE and FF...
**
xacc.ide-0.2.0.57 - now with C# 2.0 parser and seamless VS2005 solution support!
**
-
Many of you know this bug from ASP.NET 1.x. They said they fixed it, but for some reason we were hitting the same issue on a page with ASP.NET 2.0. After a long and hard search I found something like this:
<%@ Page Language="C#" AutoEventWireup="true" %>
<script runat="server" type="text/C#">
void Page_Load(object sender, EventArgs e)
{
System.Diagnostics.Trace.WriteLine("Postback!");
}
</script><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<img src="" />
</div>
</form>
</body>
</html>Note the IMG element with the empty S
Is this the default page? Specifying
src=""
means that it will simply reuse the page URL's base folder, i.e. it's a relative URL with no relative part. You'll get one run of the page for anything on the page with an empty URL. If it's not the default page the default page will be run instead. This is entirely according to the HTML spec and has nothing to do with ASP.NET.Stability. What an interesting concept. -- Chris Maunder
-
Is this the default page? Specifying
src=""
means that it will simply reuse the page URL's base folder, i.e. it's a relative URL with no relative part. You'll get one run of the page for anything on the page with an empty URL. If it's not the default page the default page will be run instead. This is entirely according to the HTML spec and has nothing to do with ASP.NET.Stability. What an interesting concept. -- Chris Maunder
It can be any page! (there might be a difference between IE and FF here) The point is, it was a subtle bug :p
**
xacc.ide-0.2.0.57 - now with C# 2.0 parser and seamless VS2005 solution support!
**
-
Many of you know this bug from ASP.NET 1.x. They said they fixed it, but for some reason we were hitting the same issue on a page with ASP.NET 2.0. After a long and hard search I found something like this:
<%@ Page Language="C#" AutoEventWireup="true" %>
<script runat="server" type="text/C#">
void Page_Load(object sender, EventArgs e)
{
System.Diagnostics.Trace.WriteLine("Postback!");
}
</script><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<img src="" />
</div>
</form>
</body>
</html>Note the IMG element with the empty S
-
My own IDE of course :p
**
xacc.ide-0.2.0.57 - now with C# 2.0 parser and seamless VS2005 solution support!
**
-
My own IDE of course :p
**
xacc.ide-0.2.0.57 - now with C# 2.0 parser and seamless VS2005 solution support!
**
-
It does do basic C++, nothing as pretty as the C# support :p
**
xacc.ide-0.2.0.57 - now with C# 2.0 parser and seamless VS2005 solution support!
**
-
http://userfiles.wdevs.com/leppie/xacc.cpp.png[^] There's a sample :p Just hightlight the text (duh), and do copy to HTML, and it will have the code ready to be pasted in CP :p Most browserbased editor picks up on the normal copy, and no need to go via 'copy to HTML', also works well in Word :p
**
xacc.ide-0.2.0.57 - now with C# 2.0 parser and seamless VS2005 solution support!
**
-
It does do basic C++, nothing as pretty as the C# support :p
**
xacc.ide-0.2.0.57 - now with C# 2.0 parser and seamless VS2005 solution support!
**
-
You can also use CopySourceAsHtml[^]. Ex:
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct SystemTime
{
public short year;
public short month;
public short dayOfWeek;
public short day;
public short hour;
public short minute;
public short second;
public short milliseconds;
}
Edit: Although I don't think CSAH will do the ASPX page. I *think* it will only work on .cs pages.
Jon Sagara This is the stuff we'll drink on special occasions. To paraphrase my father-in-law, this is the kind of wine that results in kids. -- A friend Blog | Site | Articles
-
You can also use CopySourceAsHtml[^]. Ex:
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct SystemTime
{
public short year;
public short month;
public short dayOfWeek;
public short day;
public short hour;
public short minute;
public short second;
public short milliseconds;
}
Edit: Although I don't think CSAH will do the ASPX page. I *think* it will only work on .cs pages.
Jon Sagara This is the stuff we'll drink on special occasions. To paraphrase my father-in-law, this is the kind of wine that results in kids. -- A friend Blog | Site | Articles
Hmmm, I like the border, but I still prefer my 'rendering' :p
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct SystemTime
{
public short year;
public short month;
public short dayOfWeek;
public short day;
public short hour;
public short minute;
public short second;
public short milliseconds;
}**
xacc.ide-0.2.0.57 - now with C# 2.0 parser and seamless VS2005 solution support!
**