ASP .NET 1.1 DropDownList working in FireFox, not IE 7

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mwalts
    New Member
    • May 2007
    • 38

    ASP .NET 1.1 DropDownList working in FireFox, not IE 7

    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
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    It could be just something as dumb as a caching issue. I can't think of another way the backend code would cause different reactions from firefox/IE. Web design code yes, backend code no.
    Try setting the page to not be cached and see if it helps?

    Comment

    • drhowarddrfine
      Recognized Expert Expert
      • Sep 2006
      • 7434

      #3
      Just a note as I'm passing through. Your doctype is invalid and puts IE into quirks mode. Although new pages should always use a strict doctype, if you must use transitional, use this one:

      <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
      "http://www.w3.org/TR/html4/loose.dtd">

      Comment

      • mwalts
        New Member
        • May 2007
        • 38

        #4
        Thanks for the replies. I'll try that doc type, I'll admit, I just let VS 2003 put in its default.

        I think it might have been a caching issue as well. I ended up adding localhost to the safe sites list and that did it, it now works... not sure why though.

        Thanks again for the help.

        -mwalts

        Comment

        Working...