I'm fairly new to ASP.NET, although I have a fair amount of C# experience.
I'm creating a SharePoint Web Part, but I'm doing the development for it locally in ASP.NET 1.1
I'm using a DropDownList control with autopostback = true in order to run code on the SelectedIndexCh anged event. Both IE 7 and FireFox are obviously loading a page again when a selection is made, but only FireFox actually shows the changes made to the page.
I tried a simple sample page and noticed the same behaviour, here it is
aspx page
<%@ Page language="c#" Codebehind="Fak eFormToCodeStea l.aspx.cs" AutoEventWireup ="false" Inherits="WebPa rtTester.FakeFo rmToCodeSteal" debug="True"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>FakeForm ToCodeSteal</title>
<meta name="GENERATOR " Content="Micros oft Visual Studio .NET 7.1">
<meta name="CODE_LANG UAGE" Content="C#">
<meta name="vs_defaul tClientScript" content="JavaSc ript">
<meta name="vs_target Schema" content="http://schemas.microso ft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING= "GridLayout ">
<form id="Form1" method="post" runat="server">
<asp:DropDownLi st id="DropDownLis t1" style="Z-INDEX: 101; LEFT: 344px; POSITION: absolute; TOP: 176px"
runat="server" Width="120px" Height="24px" AutoPostBack="T rue">
<asp:ListItem Value="The First one">The First one</asp:ListItem>
<asp:ListItem Value="The second">The second</asp:ListItem>
<asp:ListItem Value="One more">One more</asp:ListItem>
</asp:DropDownLis t>
<asp:TextBox id="TextBox1" style="Z-INDEX: 102; LEFT: 88px; POSITION: absolute; TOP: 88px" runat="server"
Width="232px"></asp:TextBox>
<asp:Label id="lbl" style="Z-INDEX: 103; LEFT: 40px; POSITION: absolute; TOP: 168px" runat="server"
Width="272px" Height="160px"> Stuff here</asp:Label>
</form>
</body>
</HTML>
aspx.cs page
using System;
using System.Collecti ons;
using System.Componen tModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Sess ionState;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.H tmlControls;
namespace WebPartTester
{
/// <summary>
/// Summary description for FakeFormToCodeS teal.
/// </summary>
public class FakeFormToCodeS teal : System.Web.UI.P age
{
protected System.Web.UI.W ebControls.Text Box TextBox1;
protected System.Web.UI.W ebControls.Labe l lbl;
protected System.Web.UI.W ebControls.Drop DownList DropDownList1;
private void Page_Load(objec t sender, System.EventArg s e)
{
// Put user code to initialize the page here
}
#region Web Form Designer generated code
override protected void OnInit(EventArg s e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeCompo nent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeCompo nent()
{
this.DropDownLi st1.SelectedInd exChanged += new System.EventHan dler(this.DropD ownList1_Select edIndexChanged) ;
this.Load += new System.EventHan dler(this.Page_ Load);
}
#endregion
private void DropDownList1_S electedIndexCha nged(object sender, System.EventArg s e)
{
lbl.Text = DropDownList1.S electedItem.Tex t + " Made it here";
}
}
}
Any help would be much appreciated
I'm creating a SharePoint Web Part, but I'm doing the development for it locally in ASP.NET 1.1
I'm using a DropDownList control with autopostback = true in order to run code on the SelectedIndexCh anged event. Both IE 7 and FireFox are obviously loading a page again when a selection is made, but only FireFox actually shows the changes made to the page.
I tried a simple sample page and noticed the same behaviour, here it is
aspx page
<%@ Page language="c#" Codebehind="Fak eFormToCodeStea l.aspx.cs" AutoEventWireup ="false" Inherits="WebPa rtTester.FakeFo rmToCodeSteal" debug="True"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>FakeForm ToCodeSteal</title>
<meta name="GENERATOR " Content="Micros oft Visual Studio .NET 7.1">
<meta name="CODE_LANG UAGE" Content="C#">
<meta name="vs_defaul tClientScript" content="JavaSc ript">
<meta name="vs_target Schema" content="http://schemas.microso ft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING= "GridLayout ">
<form id="Form1" method="post" runat="server">
<asp:DropDownLi st id="DropDownLis t1" style="Z-INDEX: 101; LEFT: 344px; POSITION: absolute; TOP: 176px"
runat="server" Width="120px" Height="24px" AutoPostBack="T rue">
<asp:ListItem Value="The First one">The First one</asp:ListItem>
<asp:ListItem Value="The second">The second</asp:ListItem>
<asp:ListItem Value="One more">One more</asp:ListItem>
</asp:DropDownLis t>
<asp:TextBox id="TextBox1" style="Z-INDEX: 102; LEFT: 88px; POSITION: absolute; TOP: 88px" runat="server"
Width="232px"></asp:TextBox>
<asp:Label id="lbl" style="Z-INDEX: 103; LEFT: 40px; POSITION: absolute; TOP: 168px" runat="server"
Width="272px" Height="160px"> Stuff here</asp:Label>
</form>
</body>
</HTML>
aspx.cs page
using System;
using System.Collecti ons;
using System.Componen tModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Sess ionState;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.H tmlControls;
namespace WebPartTester
{
/// <summary>
/// Summary description for FakeFormToCodeS teal.
/// </summary>
public class FakeFormToCodeS teal : System.Web.UI.P age
{
protected System.Web.UI.W ebControls.Text Box TextBox1;
protected System.Web.UI.W ebControls.Labe l lbl;
protected System.Web.UI.W ebControls.Drop DownList DropDownList1;
private void Page_Load(objec t sender, System.EventArg s e)
{
// Put user code to initialize the page here
}
#region Web Form Designer generated code
override protected void OnInit(EventArg s e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeCompo nent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeCompo nent()
{
this.DropDownLi st1.SelectedInd exChanged += new System.EventHan dler(this.DropD ownList1_Select edIndexChanged) ;
this.Load += new System.EventHan dler(this.Page_ Load);
}
#endregion
private void DropDownList1_S electedIndexCha nged(object sender, System.EventArg s e)
{
lbl.Text = DropDownList1.S electedItem.Tex t + " Made it here";
}
}
}
Any help would be much appreciated
Comment