Help on FireFox!

Last post 08-17-2007 2:02 PM by eric@in4matrix.com. 9 replies.

Sort Posts:

  • Help on FireFox!

    07-31-2007, 2:02 PM
    • Member
      30 point Member
    • mikew
    • Member since 02-19-2006, 4:00 PM
    • Posts 18

    Hi,

    I am in the process of completing a web development using Asp.Net Ajax and the ajax controls.  Late in the development, I found out I need to support Firefox as well as IE.  I ran some tests and found that most things do not appear to work.  Most, I am using the UpdatePanel, ModalPopupExtender and DropDownExtender.  The only thing that sort of works is that the drop down does drop down, but clicking on the items does not fire the event.  The ModalPopup call to Show() seems to have no effect also.  I cannot run this deeply enough to find out if the update panel is doing its work correctly or not.

    Reading through this forum, it seems that Firefox is supported so I'm wondering what I'm doing wrong.

     Any help is appreciated!  Thanks.

     Mike

  • Re: Help on FireFox!

    08-01-2007, 9:18 PM
    • Member
      30 point Member
    • mikew
    • Member since 02-19-2006, 4:00 PM
    • Posts 18

    I've narrowed this problem down some.  It seems to be a problem with the UpdatePanel.  Specifically, if I call the Update method it fails:

    //ReportBorderRegionPropertyUpdatePanel.Update();
    ReportBorderRegionPopup.Show();

    When I commented out the above line, the ModalPopup worked.  I could go around and do this to the various ModalPopups, but I depend on the Update to change the contents of the main UpdatePanel when the ModalPopup completes.  So, this still does not work.

     Thanks again.  Mike

  • Re: Help on FireFox!

    08-06-2007, 3:49 AM
    Answer

    Hi Mikew,

    Microsoft Ajax Library has a layer named "Browser Compatibility". It will make your ajax-enbled application works on the main browser including Firefox,so I don't think it is caused by the browser.

    Based on your description, I'm afraid that we cannot write a sample to reproduce your problem,so it's hard to indicate the exact root cause.However,  my suggestions are:

    1. Confirm if a simple ajax-enabled application can work properly on your machine.
    2. Use client method to invoke the asynchronous post. such as __doPostBack('UpdatePanel.ClientID','').

    If your problem has been resolved or been resolved by following the suggestion, please don't forget to mark it as "answered" or "resovled".Otherwise, please share your sample or we cannot troubleshoot in your shoes. Thanks

    Best Regards,

    Jonathan

    Jonathan Shen
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: Help on FireFox!

    08-16-2007, 8:48 PM
    • Member
      30 point Member
    • mikew
    • Member since 02-19-2006, 4:00 PM
    • Posts 18

    Hi Jonathan,

    Thanks for your response.

    As to the "Browser Compatibility", I know that is the plan, but I also know that my app works (or at least seems to work) perfectly in IE, but almost nothing functions in Firefox.

    Answer to question 1:  I've tried to go back and create a simple Ajax app that is along the same lines as my troubled app and it works without problems.  I've been adding a little more and a little more to it in order to get to the point where something works in IE but not Firefox.  Let me just say that in my non-simple code, the UpdatePanel has a ModalPopupExtender and some of the Panels that are extended have some controls that are bound to an object data source.  One of them has a GridView and and others have DropDownLists.  All in all, there are probably 10 UpdatePanels in the .aspx as I've wrapped each modal popup in one of these plus there are a few for the main form for three main areas.  Originally, when I was just starting out with the Ajax ASP.NET, I did everything in one UpdatePanel (not sure if it worked in Firefox since I didn't realize it was a requirement then), but it was a little bulky.

    Answer to question 2: I did try the __doPostBack and it seemed to work in both IE and Firefox.

    To make a long story short, I did finally get something that works in IE but not in Firefox in my simple app.  I'm not sure how relevant it is though because it has to do with a GridView getting populated.  I suppose it's possible that this is the thread that unravels the whole thing, I'll follow up with the code in case you or anyone else wants to take a crack at it.

     

    Thanks again, Mike.

  • Re: Help on FireFox!

    08-16-2007, 9:17 PM
    • Member
      30 point Member
    • mikew
    • Member since 02-19-2006, 4:00 PM
    • Posts 18

    Here's the code I used to get a difference between IE and Firefox with a GridView:

     

    The ASPX page just contains a ASCX control:

     

    <%@ Page Language="C#" AutoEventWireup="true" Codebehind="AjaxTest.aspx.cs" Inherits="abc.AjaxTest" %>
    
    <%@ Register TagPrefix="ajaxtest" TagName="AjaxTestControl" Src="~/AjaxTestControl.ascx" %>
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
    <!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">
            <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
            </asp:ScriptManager>
            <div>
                <ajaxtest:AjaxTestControl id="AjaxTestControl" runat="server" />
            </div>
        </form>
    </body>
    </html>
    
      

    The ASPX.CS:

     

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    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;
    
    namespace abc
    {
        public partial class AjaxTest : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
    
            }
    
            protected void Button1_Click(object sender, EventArgs e)
            {
            }
        }
    }
    
     

    The ASPX.Designer.cs:

     

    //------------------------------------------------------------------------------
    // <auto-generated>
    //     This code was generated by a tool.
    //     Runtime Version:2.0.50727.832
    //
    //     Changes to this file may cause incorrect behavior and will be lost if
    //     the code is regenerated.
    // </auto-generated>
    //------------------------------------------------------------------------------
    
    namespace abc {
        
        
        /// <summary>
        /// AjaxTest class.
        /// </summary>
        /// <remarks>
        /// Auto-generated class.
        /// </remarks>
        public partial class AjaxTest {
            
            /// <summary>
            /// form1 control.
            /// </summary>
            /// <remarks>
            /// Auto-generated field.
            /// To modify move field declaration from designer file to code-behind file.
            /// </remarks>
            protected global::System.Web.UI.HtmlControls.HtmlForm form1;
            
            /// <summary>
            /// ScriptManager1 control.
            /// </summary>
            /// <remarks>
            /// Auto-generated field.
            /// To modify move field declaration from designer file to code-behind file.
            /// </remarks>
            protected global::System.Web.UI.ScriptManager ScriptManager1;
            
            /// <summary>
            /// AjaxTestControl control.
            /// </summary>
            /// <remarks>
            /// Auto-generated field.
            /// To modify move field declaration from designer file to code-behind file.
            /// </remarks>
            protected global::abc.AjaxTestControl AjaxTestControl;
        }
    }
    
     

    The ASCX control:

     

    <%@ Control Language="C#" AutoEventWireup="true" Codebehind="AjaxTestControl.ascx.cs"
        Inherits="abc.AjaxTestControl" %>
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
    <div id="selectionForm" style="border-top: solid 1px black; border-bottom: solid 1px black;
        padding: 2px 2px 2px 2px">
        <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
        </asp:ScriptManagerProxy>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:Button ID="Button1" runat="server" Text="Really show it" OnClick="Button1_Click" />
                <asp:LinkButton ID="LinkButton1" runat="server" OnClick="Button1_Click">Show Popup</asp:LinkButton>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="conditional">
        <ContentTemplate>
            <asp:Panel Style="display: none" ID="Panel1" runat="server">
                <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
                <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="ObjectDataSource1"
                    DataTextField="Name" DataValueField="Name">
                </asp:DropDownList><asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetPersonSet"
                    TypeName="VersaTrans.ReportEditingLogic.Person"></asp:ObjectDataSource>
                <asp:Button ID="Button2" runat="server" Text="Button" />
            </asp:Panel>
            <asp:Button ID="Dummy6" runat="server" Text="Button" Style="display: none" />
        <cc1:ModalPopupExtender ID="ModalPopupExtender2" runat="server" popupdraghandlecontrolid="Label1"
        popupcontrolid="Panel1" targetcontrolid="Dummy6">
        </cc1:ModalPopupExtender>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdatePanel ID="SequenceUpdatePanel" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:Panel Style="display: none" ID="SequencePanel" runat="server" SkinID="outline">
                <table>
                    <tbody>
                        <tr>
                            <td>
                                <asp:Label ID="SequenceHeader" runat="server" SkinID="header2" Text="Sequence Items:"
                                    Width="250px"></asp:Label></td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="SequenceErrorLabel" runat="server" SkinID="error" Style="padding-right: 50px;
                                    padding-left: 50px; padding-bottom: 2px; padding-top: 2px" Text="Label" Visible="False"
                                    Width="100%"></asp:Label></td>
                        </tr>
                        <tr>
                            <td style="height: 187px" valign="top">
                                <asp:GridView ID="SequenceItemList" runat="server" AutoGenerateColumns="False" DataSourceID="SequenceItemSource"
                                    Width="100%">
                                    <Columns>
                                        <asp:BoundField DataField="ComponentIndex" HeaderText="ComponentIndex" SortExpression="ComponentIndex"
                                            Visible="False" />
                                        <asp:BoundField DataField="Name" HeaderText="Name" ShowHeader="False" SortExpression="Name" />
                                        <asp:TemplateField ShowHeader="False">
                                            <ItemTemplate>
                                                <asp:LinkButton ID="PrevSequenceButton" runat="server" CommandArgument='<%# Eval("ComponentIndex") %>'
                                                    OnClick="PrevSequenceButton_Click">Previous</asp:LinkButton>
                                                <asp:LinkButton ID="NextSequenceButton" runat="server" CommandArgument='<%# Eval("ComponentIndex") %>'
                                                    OnClick="NextSequenceButton_Click">Next</asp:LinkButton>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                                <asp:ObjectDataSource ID="SequenceItemSource" runat="server" SelectMethod="GetReportItemsTest"
                                    TypeName="abc.TestList"></asp:ObjectDataSource>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" colspan="2">
                                <asp:Button ID="Button3" runat="server" Text="Close" Width="75px" /></td>
                        </tr>
                    </tbody>
                </table>
            </asp:Panel>
            <asp:Button Style="display: none" ID="Dummy4" Text="Dummy4" runat="server"></asp:Button>
            <cc1:ModalPopupExtender ID="SequencePopup" runat="server" PopupDragHandleControlID="SequenceHeader"
                PopupControlID="SequencePanel" TargetControlID="Dummy4">
            </cc1:ModalPopupExtender>
        </ContentTemplate>
    </asp:UpdatePanel>
    
     

    The ASCX.CS:

     

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    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;
    
    namespace abc
    {
        public partial class AjaxTestControl : System.Web.UI.UserControl
        {
            public int ComponentIndex = 5;
    
            protected void Page_Load(object sender, EventArgs e)
            {
    
            }
    
            protected void Button1_Click(object sender, EventArgs e)
            {
                Label1.Text = "Hello!!!";
                TextBox2.Text = "Yeah right";
                SequenceUpdatePanel.Update();
                SequencePopup.Show();
            }
    
            protected void PrevSequenceButton_Click(object sender, EventArgs e)
            {
    
            }
    
            protected void NextSequenceButton_Click(object sender, EventArgs e)
            {
    
            }
        }
    }
     

    The ASCX.Designer.cs:

     

    //------------------------------------------------------------------------------
    // <auto-generated>
    //     This code was generated by a tool.
    //     Runtime Version:2.0.50727.832
    //
    //     Changes to this file may cause incorrect behavior and will be lost if
    //     the code is regenerated.
    // </auto-generated>
    //------------------------------------------------------------------------------
    
    namespace abc {
        
        
        /// <summary>
        /// AjaxTestControl class.
        /// </summary>
        /// <remarks>
        /// Auto-generated class.
        /// </remarks>
        public partial class AjaxTestControl {
            
            /// <summary>
            /// ScriptManagerProxy1 control.
            /// </summary>
            /// <remarks>
            /// Auto-generated field.
            /// To modify move field declaration from designer file to code-behind file.
            /// </remarks>
            protected global::System.Web.UI.ScriptManagerProxy ScriptManagerProxy1;
            
            /// <summary>
            /// UpdatePanel1 control.
            /// </summary>
            /// <remarks>
            /// Auto-generated field.
            /// To modify move field declaration from designer file to code-behind file.
            /// </remarks>
            protected global::System.Web.UI.UpdatePanel UpdatePanel1;
            
            /// <summary>
            /// Button1 control.
            /// </summary>
            /// <remarks>
            /// Auto-generated field.
            /// To modify move field declaration from designer file to code-behind file.
            /// </remarks>
            protected global::System.Web.UI.WebControls.Button Button1;
            
            /// <summary>
            /// LinkButton1 control.
            /// </summary>
            /// <remarks>
            /// Auto-generated field.
            /// To modify move field declaration from designer file to code-behind file.
            /// </remarks>
            protected global::System.Web.UI.WebControls.LinkButton LinkButton1;
            
            /// <summary>
            /// UpdatePanel2 control.
            /// </summary>
            /// <remarks>
            /// Auto-generated field.
            /// To modify move field declaration from designer file to code-behind file.
            /// </remarks>
            protected global::System.Web.UI.UpdatePanel UpdatePanel2;
            
            /// <summary>
            /// Panel1 control.
            /// </summary>
            /// <remarks>
            /// Auto-generated field.
            /// To modify move field declaration from designer file to code-behind file.
            /// </remarks>
            protected global::System.Web.UI.WebControls.Panel Panel1;
            
            /// <summary>
            /// Label1 control.
            /// </summary>
            /// <remarks>
            /// Auto-generated field.
            /// To modify move field declaration from designer file to code-behind file.
            /// </remarks>
            protected global::System.Web.UI.WebControls.Label Label1;
            
            /// <summary>
            /// TextBox2 control.
            /// </summary>
            /// <remarks>
            /// Auto-generated field.
            /// To modify move field declaration from designer file to code-behind file.
            /// </remarks>
            protected global::System.Web.UI.WebControls.TextBox TextBox2;
            
            /// <summary>
            /// DropDownList1 control.
            /// </summary>
            /// <remarks>
            /// Auto-generated field.
            /// To modify move field declaration from designer file to code-behind file.
            /// </remarks>
            protected global::System.Web.UI.WebControls.DropDownList DropDownList1;
            
            /// <summary>
            /// ObjectDataSource1 control.
            /// </summary>
            /// <remarks>
            /// Auto-generated field.
            /// To modify move field declaration from designer file to code-behind file.
            /// </remarks>
            protected global::System.Web.UI.WebControls.ObjectDataSource ObjectDataSource1;
            
            /// <summary>
            /// Button2 control.
            /// </summary>
            /// <remarks>
            /// Auto-generated field.
            /// To modify move field declaration from designer file to code-behind file.
            /// </remarks>
            protected global::System.Web.UI.WebControls.Button Button2;
            
            /// <summary>
            /// Dummy6 control.
            /// </summary>
            /// <remarks>
            /// Auto-generated field.
            /// To modify move field declaration from designer file to code-behind file.
            /// </remarks>
            protected global::System.Web.UI.WebControls.Button Dummy6;
            
            /// <summary>
            /// ModalPopupExtender2 control.
            /// </summary>
            /// <remarks>
            /// Auto-generated field.
            /// To modify move field declaration from designer file to code-behind file.
            /// </remarks>
            protected global::AjaxControlToolkit.ModalPopupExtender ModalPopupExtender2;
            
            /// <summary>
            /// SequenceUpdatePanel control.
            /// </summary>
            /// <remarks>
            /// Auto-generated field.
            /// To modify move field declaration from designer file to code-behind file.
            /// </remarks>
            protected global::System.Web.UI.UpdatePanel SequenceUpdatePanel;
            
            /// <summary>
            /// SequencePanel control.
            /// </summary>
            /// <remarks>
            /// Auto-generated field.
            /// To modify move field declaration from designer file to code-behind file.
            /// </remarks>
            protected global::System.Web.UI.WebControls.Panel SequencePanel;
            
            /// <summary>
            /// SequenceHeader control.
            /// </summary>
            /// <remarks>
            /// Auto-generated field.
            /// To modify move field declaration from designer file to code-behind file.
            /// </remarks>
            protected global::System.Web.UI.WebControls.Label SequenceHeader;
            
            /// <summary>
            /// SequenceErrorLabel control.
            /// </summary>
            /// <remarks>
            /// Auto-generated field.
            /// To modify move field declaration from designer file to code-behind file.
            /// </remarks>
            protected global::System.Web.UI.WebControls.Label SequenceErrorLabel;
            
            /// <summary>
            /// SequenceItemList control.
            /// </summary>
            /// <remarks>
            /// Auto-generated field.
            /// To modify move field declaration from designer file to code-behind file.
            /// </remarks>
            protected global::System.Web.UI.WebControls.GridView SequenceItemList;
            
            /// <summary>
            /// SequenceItemSource control.
            /// </summary>
            /// <remarks>
            /// Auto-generated field.
            /// To modify move field declaration from designer file to code-behind file.
            /// </remarks>
            protected global::System.Web.UI.WebControls.ObjectDataSource SequenceItemSource;
            
            /// <summary>
            /// Button3 control.
            /// </summary>
            /// <remarks>
            /// Auto-generated field.
            /// To modify move field declaration from designer file to code-behind file.
            /// </remarks>
            protected global::System.Web.UI.WebControls.Button Button3;
            
            /// <summary>
            /// Dummy4 control.
            /// </summary>
            /// <remarks>
            /// Auto-generated field.
            /// To modify move field declaration from designer file to code-behind file.
            /// </remarks>
            protected global::System.Web.UI.WebControls.Button Dummy4;
            
            /// <summary>
            /// SequencePopup control.
            /// </summary>
            /// <remarks>
            /// Auto-generated field.
            /// To modify move field declaration from designer file to code-behind file.
            /// </remarks>
            protected global::AjaxControlToolkit.ModalPopupExtender SequencePopup;
        }
    }
    
     

    And finally, the class that feeds the object data source.

     
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Web;
    
    namespace abc
    {
        /// <summary>
        /// Class used to organize the components within a container for displaying in the UI.
        /// </summary>
        public class TestList
        {
            private string name;
            /// <summary>
            /// The item name.
            /// </summary>
            public string Name
            {
                get { return name; }
                set { name = value; }
            }
    
            private int componentIndex;
            /// <summary>
            /// The index of the item in the list.
            /// </summary>
            public int ComponentIndex
            {
                get { return componentIndex; }
                set { componentIndex = value; }
            }
    
            public static List GetReportItemsTest()
            {
                List list = new List();
    
                TestList emptyItem = new TestList();
                emptyItem.Name = "Blah1";
                list.Add(emptyItem);
                emptyItem = new TestList();
                emptyItem.Name = "Blah2";
                list.Add(emptyItem);
                return list;
            }
    
        }
    
    
    }
    
     
  • Re: Help on FireFox!

    08-16-2007, 9:21 PM
    • Member
      30 point Member
    • mikew
    • Member since 02-19-2006, 4:00 PM
    • Posts 18

    That took up a lot of space ... sorry.  Is there a better way to post code here?

     Mike

  • Re: Help on FireFox!

    08-16-2007, 9:27 PM
    • Member
      30 point Member
    • mikew
    • Member since 02-19-2006, 4:00 PM
    • Posts 18

    For those who just want to see what the screenshots look like:

     

    Thanks, Mike

  • Re: Help on FireFox!

    08-16-2007, 9:48 PM

    Hi Mike, 

    mikew:

    That took up a lot of space ... sorry.  Is there a better way to post code here?

    I have noticed your new post.  Would you please modify the source code provided above?   It is recommended to post your code by clicking the last icon in toolbar of the HtmlEditor. Please select the language before the code be posted.By the way, it is not recommended to add the line numbers to your source code. 

    Best regards,

    Jonathan

     

    Jonathan Shen
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: Help on FireFox!

    08-16-2007, 11:55 PM
    • Member
      30 point Member
    • mikew
    • Member since 02-19-2006, 4:00 PM
    • Posts 18

    It's updated.  Thanks for the advice.

     

    Mike

  • Re: Help on FireFox!

    08-17-2007, 2:02 PM

     There are definitely cross browser issues.  I am having an issue with the DropDownExtender in FireFox.  After the page first loads, FireFox appears to request the page again.  It only happens when I have the DropDownExtender on the page.  It works find in IE.  Does anyone have any information on that being a known issue or any work-arounds?  (And not using IE only).

Page 1 of 1 (10 items)
Microsoft Communities