Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have been playing around with Moz

Status
Not open for further replies.

Paladine

Technical User
Sep 16, 2001
26
CA
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!

Code:
<%@ Page Language=&quot;C#&quot; %>
<script runat=&quot;server&quot;>

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

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

I have added/modified the Web.Config file to accept Netscape browser (included Mozilla) and the page renders somewhat better, but still not as slick as in IE6.

Anyone have a solution? Recommendation?
_________________
Paladine
 
The key would be to replace this:
Code:
<p align=&quot;center&quot;>
<asp:Label id=&quot;lblHeader&quot; runat=&quot;server&quot; head=&quot;head&quot; height=&quot;25px&quot; width=&quot;100%&quot; backcolor=&quot;Black&quot; forecolor=&quot;White&quot; font-bold=&quot;true&quot; text=&quot;ASPWEB Login Page&quot; tooltip=&quot;Welcome to ASPWEB Login Page&quot;>ASPWEB Login Page</asp:Label>
</p>
with this:
Code:
<div id=&quot;lblHeader&quot;>ASPWEB Login Page</div>
and add this into your <head> section:
Code:
<style type=&quot;text/css&quot;>
<!--
  body {
    color: black;
    background-color: white;
  }

  #lblHeader {
    height: 25px;
    width: 100%;
    color: white;
    background-color: black;
    font-weight: bold;
    text-align: center;
  }
-->
</style>
Now it looks the same in IE, but *better* in Mozilla.

What's happening is that ASP.NET is generating a &quot;label&quot; on the fly (that actually ends up being a <span>). The problem is thus:
1) ASP.NET generates a lot of elements that are either IE specific, or have been deprecated by the W3C (2) Mozilla is a much more standards-conforming browser and is less forgiving than IE.

Take a peek at what ASP actually ends up sending to the browser and you will discover many things you can tidy up without actually using ASP.NET controls.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top