DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   ASP.NET (http://www.daniweb.com/forums/forum18.html)
-   -   ASP.NET and Mozilla - Issues! (http://www.daniweb.com/forums/thread769.html)

Paladine Aug 2nd, 2003 8:19 pm
ASP.NET and Mozilla - Issues!
 
I have been playing around with Mozzila, and find it too be a rather nice speedy browser, but I do ASP.NET programming and such and seem to have some issues with ASP.NET pages displaying properly.

It seems to be with regards to coloring, I guess ASP controls as well
, since those are the things I have colored.


See example code below!

<%@ Page Language="C#" %>
<script runat="server">

    // Insert page code here
    //
   
    void Submit_Click_1(object sender, EventArgs e) {
        if (txtPassword.Text == "test")
        {
            Session["UserName"] = txtName.Text;
            //Response.Redirect("Test.aspx");
            Server.Transfer("Test.aspx");
        }
        else
        {
            lblFalse.Text = ("Incorrect Pasword Please try again");
        }
    }

</script>
<html>
<head>
</head>
<body>
    <p align="center">
        <asp:Label id="lblHeader" runat="server" head="head" height="25px" width="100%" backcolor="Black" forecolor="White" font-bold="true" text="ASPWEB Login Page" tooltip="Welcome to ASPWEB Login Page">ASPWEB
        Login Page</asp:Label>
    </p>
    <form runat="server">
        <!-- Insert content here -->
        <table cellspacing="15" align="center" sytle="font:10pt verdana;border-width:2;border-style:solid;border-color:black;">
            <tbody>
                <tr>
                    <td>
                        <b>UserName:</b>
                    </td>
                    <td>
                        <asp:TextBox id="txtName" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <b>Password:</b>
                    </td>
                    <td>
                        <asp:TextBox id="txtPassword" runat="server" TextMode="Password"></asp:TextBox>
                    </td>
                </tr>
                <tr colspan="2">
                    <td>
                        <asp:Button id="Submit" onclick="Submit_Click_1" runat="server" Text="Submit" Width="77px"></asp:Button>
                    </td>
                </tr>
            </tbody>
        </table>
    </form>
    <div align="center"><asp:Label id="lblFalse" runat="server" width="843px" backcolor="White" font-bold="True" font-size="Medium"></asp:Label>
    </div>
</body>
</html>

Anyone have a solution? Recommendation?

Paladine Aug 2nd, 2003 8:59 pm
Re: ASP.NET and Mozilla - Issues!
 
Well, I found some of the answer, but still not perfect. (see below). Anyone have any other suggestions?

What I did was add code (xml) to my web.config file in the <system.web> section


      <browserCaps>
                        <!--NETSCAPE 6 and 7 //-->
                        <case match="^Mozilla/5\.0 \([^)]*\) (Gecko/[-\d]+ )?Netscape[6|7]/(?'version'(?'major'\d+)(?'minor'\.\d+)(?'letters'\w*)).*">
                                tagwriter=System.Web.UI.HtmlTextWriter
                                browser=Netscape
                                version=${version}
                                majorversion=${major}
                                minorversion=${minor}
                                frames=true
                                tables=true
                                cookies=true
                                javascript=true
                                javaapplets=true
                                ecmascriptversion=1.5
                                w3cdomversion=1.0
                                css1=true
                                css2=true
                                xml=true
                        </case>
                        <!-- MOZILLA //-->
                        <case match="^Mozilla/(?'version'(?'major'\d+)(?'minor'\.\d+)(?'letters'\w*)).*">
                                <case match="^[5-9]\." with="${version}">
                                        tagwriter=System.Web.UI.HtmlTextWriter
                                </case>
                        </case>
                        <!--OPERA 5+//-->
                        <case match="Opera[ /](?'version'(?'major'\d+)(?'minor'\.\d+)(?'letters'\w*))">
                        <filter match="[4-9]" with="${major}">
                                    <filter match="[5-9]" with="${major}">
                                    tagwriter=System.Web.UI.HtmlTextWriter
                                    </filter>
                    </filter>
            </case>
                </browserCaps>

Tekmaven Dec 25th, 2003 4:52 pm
Re: ASP.NET and Mozilla - Issues!
 
browserCaps are the way to go. Thats the same browserCaps section I use for #Portal lol.

chiefwun Jul 15th, 2005 7:51 pm
Re: ASP.NET and Mozilla - Issues!
 
Great Tip. It worked perfect for the problem I had with listbox sizes, control placement without html tables (not asp:table) and for textbox sizing (i had already figured out column setting for those though).

Nothing else would have worked except for some table nesting structures for control placement of my asp.net web form.

Thanks a lot.

btw...is there anything for safari? I haven't actually tested it yet, but our graphic designers use Safari exclusively and they would also like to use this web application I'm building.

gary_it@yahoo.com

tgreer Jul 15th, 2005 7:57 pm
Re: ASP.NET and Mozilla - Issues!
 
browserCaps will also fix some of the HTML rendering issues. Panels will render as DIVs instead of Tables, etc. I've been meaning to write an article on browerCaps...

cambia Jul 28th, 2005 3:55 am
Re: ASP.NET and Mozilla - Issues!
 
Mozilla will render widths correctly if it comes from the style attribute or a stylesheet.

Cheers,
Steve


All times are GMT -4. The time now is 11:38 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC