D
DBLWizard
Howdy All,
I need some help I can't believe this is bug in Visual Studio 2005 and
hasn't been reported yet, but I have recreated it on two different
machines with the same result. I created a brand new website using VS
2005 and the default.aspx page looks like this:
<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="WebForm1.aspx.cs" Inherits="Pgi.Hub.WebForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Image ID="imgTest" runat="server" />
<asp:Label ID="Label1" runat="server" Text="PageCount:"/>
<asp:Label ID="Label2" runat="server" />
</div>
</form>
</body>
</html>
And the Default.aspx.cs page looks like this:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["Default"] == null)
{
Session["Default"] = 0;
}
Session["Default"] = (int)Session["Default"] + 1;
Label2.Text = Session["Default"].ToString();
}
}
The first time the page loads it displays PageCount:1 if you hit
refresh again it shows PageCount:3. If you put a break point in the
Page_Load it will hit the break point twice each time you load the
page. This seems to be tied to the Image control, because you can
remove the <ASP:Image ...> entry from the page and it only loads
once. Also it seems to be a ghost page because the the second time
through the Label2.Text is set to 2 but the page that displays only
says 1.
I would appreciate any feedback or thoughts on what I'm doing wrong or
if there is some way around this and the best way to report it to
Microsoft if I'm not wrong.
Thanks
dbl
I need some help I can't believe this is bug in Visual Studio 2005 and
hasn't been reported yet, but I have recreated it on two different
machines with the same result. I created a brand new website using VS
2005 and the default.aspx page looks like this:
<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="WebForm1.aspx.cs" Inherits="Pgi.Hub.WebForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Image ID="imgTest" runat="server" />
<asp:Label ID="Label1" runat="server" Text="PageCount:"/>
<asp:Label ID="Label2" runat="server" />
</div>
</form>
</body>
</html>
And the Default.aspx.cs page looks like this:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["Default"] == null)
{
Session["Default"] = 0;
}
Session["Default"] = (int)Session["Default"] + 1;
Label2.Text = Session["Default"].ToString();
}
}
The first time the page loads it displays PageCount:1 if you hit
refresh again it shows PageCount:3. If you put a break point in the
Page_Load it will hit the break point twice each time you load the
page. This seems to be tied to the Image control, because you can
remove the <ASP:Image ...> entry from the page and it only loads
once. Also it seems to be a ghost page because the the second time
through the Label2.Text is set to 2 but the page that displays only
says 1.
I would appreciate any feedback or thoughts on what I'm doing wrong or
if there is some way around this and the best way to report it to
Microsoft if I'm not wrong.
Thanks
dbl