W
WJ
This post is a follow up from the original post dated Oct 16, 2004 "I have
this problem, pls help!" created by Paul FI.
These bugs are rather serious and we would like to know how to get around.
Environment: Windows XP Pro. IIS-5 and Sp2.
Visual Studio.Net 2003 EA edition.
..NetFW 1.1
Here goes:
The followings are steps to reproduce two serious bugs found by Paul and
John within Asp.Net application. The application is a c# and consists of the
following items:
1. Web site: http://LocalHost/tBug
2. Four Asp.Net forms: WebForm1.Aspx (Default page), WebForm2.Aspx,
WebForm3.Aspx, and WebForm4.Aspx
Steps:
1. Create a new c-sharp (c#) Asp.Net web Project called tBug.
2. Drop a "Drop Down List Component" on WebForm1.aspx and call it "DDL", and
enable its "AutoPostBack".
3. Add 3 items to the DDL called Test1, Test2 and Test3 for their "Text"
property. Assign 1, 2 and 3 to their "Value" property accordingly.
4. Drop a Label compoment beside the DDL.
5. Drop two Button components on WebForm1 under the DDL and call them
Button1(Text=ToWebForm2) & Button2 (Text=ToWebForm3).
6. Double-Click on the WebForm1 itself and copy this code below onto your
WebForm1.onPage Load event:
private void Page_Load(object sender, System.EventArgs e)
{
if(!this.IsPostBack)
{
Label1.Text="Welcome to New tBug";
return;
}
Label1.Text="I am Back";
}
7. Double-Click on the WebForm1.DDL and copy this code below onto your
WebForm1.DDL_SelectedIndexChanged event:
private void DDL_SelectedIndexChanged(object sender, System.EventArgs
e)
{
Response.Redirect("WebForm4.aspx");
}
8. Double-Click on the WebForm1.Button1 and copy this code below onto your
WebForm1.Button1_Click event:
private void Button1_Click(object sender, System.EventArgs e)
{
Response.Redirect("WebForm2.aspx");
}
9. Double-Click on the WebForm1.Button2 and copy this code below onto your
WebForm1.Button2_Click event:
private void Button2_Click(object sender, System.EventArgs e)
{
Response.Redirect("WebForm3.aspx");
}
10. On the Solution Explorer, right-click on the "tBug" project and select
Add/New Asp.Net Form. Name it "WebForm2".
11. Repeat Step 10 above for WebForm3 and WebForm4.
12. Bringup WebForm2 and drop a Label component on its design surface and
assign "This is WebForm2" to its Text property.
13. Bringup WebForm3 and drop a Label component on its design surface and
assign "This is WebForm3" to its Text property.
14. Bringup WebForm4 and drop a Label component on its design surface and
assign "This is WebForm4" to its Text property.
15. Build the sulution and run it.
How to see the described BUGS:
16. Once the application is shown on the MS/IE, you should see the
Label1.Text has "Welcome to new tBug" as expected.
17. Select "Test2" from the DDL. This will bring you to WebForm4.aspx as
expected.
18. Click the "Back" button from the MS/IE tool bar. This will bring you
back to WebForm1.aspx as expected.
19. Click the "ToWebForm2 or 3" button on WebForm1, this should bring you to
"WebForm2 or 3" but "WebForm4" is shown instead.This is the "BUG" that Paul
FI talked about.
20. Click the "Back" button to go back to WebForm1 as expected.
21. Select "Test1" from the DDL, this should bring you to WebForm4, instead,
it shows "I am Back" on Webform1. This is a new BUG I found.
*****************************************************
Below is a complete c# code-behind for WebForm1.aspx.
*****************************************************
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace tBug
{
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.Button Button2;
protected System.Web.UI.WebControls.Label Label2;
protected System.Web.UI.WebControls.DropDownList ddl;
private void Page_Load(object sender, System.EventArgs e)
{
if(!this.IsPostBack)
{
Label1.Text="Welcome to New tBug";
return;
}
Label1.Text="I am Back";
}
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.ddl.SelectedIndexChanged += new
System.EventHandler(this.ddl_SelectedIndexChanged);
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Button2.Click += new System.EventHandler(this.Button2_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
private void ddl_SelectedIndexChanged(object sender, System.EventArgs
e)
{
Response.Redirect("WebForm4.aspx");
}
private void Button1_Click(object sender, System.EventArgs e)
{
Response.Redirect("WebForm2.aspx");
}
private void Button2_Click(object sender, System.EventArgs e)
{
Response.Redirect("WebForm3.aspx");
}
}
}
Thanks for your help,
John Webb
this problem, pls help!" created by Paul FI.
These bugs are rather serious and we would like to know how to get around.
Environment: Windows XP Pro. IIS-5 and Sp2.
Visual Studio.Net 2003 EA edition.
..NetFW 1.1
Here goes:
The followings are steps to reproduce two serious bugs found by Paul and
John within Asp.Net application. The application is a c# and consists of the
following items:
1. Web site: http://LocalHost/tBug
2. Four Asp.Net forms: WebForm1.Aspx (Default page), WebForm2.Aspx,
WebForm3.Aspx, and WebForm4.Aspx
Steps:
1. Create a new c-sharp (c#) Asp.Net web Project called tBug.
2. Drop a "Drop Down List Component" on WebForm1.aspx and call it "DDL", and
enable its "AutoPostBack".
3. Add 3 items to the DDL called Test1, Test2 and Test3 for their "Text"
property. Assign 1, 2 and 3 to their "Value" property accordingly.
4. Drop a Label compoment beside the DDL.
5. Drop two Button components on WebForm1 under the DDL and call them
Button1(Text=ToWebForm2) & Button2 (Text=ToWebForm3).
6. Double-Click on the WebForm1 itself and copy this code below onto your
WebForm1.onPage Load event:
private void Page_Load(object sender, System.EventArgs e)
{
if(!this.IsPostBack)
{
Label1.Text="Welcome to New tBug";
return;
}
Label1.Text="I am Back";
}
7. Double-Click on the WebForm1.DDL and copy this code below onto your
WebForm1.DDL_SelectedIndexChanged event:
private void DDL_SelectedIndexChanged(object sender, System.EventArgs
e)
{
Response.Redirect("WebForm4.aspx");
}
8. Double-Click on the WebForm1.Button1 and copy this code below onto your
WebForm1.Button1_Click event:
private void Button1_Click(object sender, System.EventArgs e)
{
Response.Redirect("WebForm2.aspx");
}
9. Double-Click on the WebForm1.Button2 and copy this code below onto your
WebForm1.Button2_Click event:
private void Button2_Click(object sender, System.EventArgs e)
{
Response.Redirect("WebForm3.aspx");
}
10. On the Solution Explorer, right-click on the "tBug" project and select
Add/New Asp.Net Form. Name it "WebForm2".
11. Repeat Step 10 above for WebForm3 and WebForm4.
12. Bringup WebForm2 and drop a Label component on its design surface and
assign "This is WebForm2" to its Text property.
13. Bringup WebForm3 and drop a Label component on its design surface and
assign "This is WebForm3" to its Text property.
14. Bringup WebForm4 and drop a Label component on its design surface and
assign "This is WebForm4" to its Text property.
15. Build the sulution and run it.
How to see the described BUGS:
16. Once the application is shown on the MS/IE, you should see the
Label1.Text has "Welcome to new tBug" as expected.
17. Select "Test2" from the DDL. This will bring you to WebForm4.aspx as
expected.
18. Click the "Back" button from the MS/IE tool bar. This will bring you
back to WebForm1.aspx as expected.
19. Click the "ToWebForm2 or 3" button on WebForm1, this should bring you to
"WebForm2 or 3" but "WebForm4" is shown instead.This is the "BUG" that Paul
FI talked about.
20. Click the "Back" button to go back to WebForm1 as expected.
21. Select "Test1" from the DDL, this should bring you to WebForm4, instead,
it shows "I am Back" on Webform1. This is a new BUG I found.
*****************************************************
Below is a complete c# code-behind for WebForm1.aspx.
*****************************************************
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace tBug
{
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.Button Button2;
protected System.Web.UI.WebControls.Label Label2;
protected System.Web.UI.WebControls.DropDownList ddl;
private void Page_Load(object sender, System.EventArgs e)
{
if(!this.IsPostBack)
{
Label1.Text="Welcome to New tBug";
return;
}
Label1.Text="I am Back";
}
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.ddl.SelectedIndexChanged += new
System.EventHandler(this.ddl_SelectedIndexChanged);
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Button2.Click += new System.EventHandler(this.Button2_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
private void ddl_SelectedIndexChanged(object sender, System.EventArgs
e)
{
Response.Redirect("WebForm4.aspx");
}
private void Button1_Click(object sender, System.EventArgs e)
{
Response.Redirect("WebForm2.aspx");
}
private void Button2_Click(object sender, System.EventArgs e)
{
Response.Redirect("WebForm3.aspx");
}
}
}
Thanks for your help,
John Webb