954,136 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

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&#40;object sender, EventArgs e&#41; &#123;
        if &#40;txtPassword.Text == "test"&#41;
        &#123;
            Session&#91;"UserName"&#93; = txtName.Text;
            //Response.Redirect&#40;"Test.aspx"&#41;;
            Server.Transfer&#40;"Test.aspx"&#41;;
        &#125;
        else
        &#123;
            lblFalse.Text = &#40;"Incorrect Pasword Please try again"&#41;;
        &#125;
    &#125;

</script>
<html>
<head>
</head>
<body>
    <p align="center">
        <asp&#58;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&#58;Label>
    </p>
    <form runat="server">
        <!-- Insert content here -->
        <table cellspacing="15" align="center" sytle="font&#58;10pt verdana;border-width&#58;2;border-style&#58;solid;border-color&#58;black;">
            <tbody>
                <tr>
                    <td>
                        <b>UserName&#58;</b> 
                    </td>
                    <td>
                        <asp&#58;TextBox id="txtName" runat="server"></asp&#58;TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <b>Password&#58;</b> 
                    </td>
                    <td>
                        <asp&#58;TextBox id="txtPassword" runat="server" TextMode="Password"></asp&#58;TextBox>
                    </td>
                </tr>
                <tr colspan="2">
                    <td>
                        <asp&#58;Button id="Submit" onclick="Submit_Click_1" runat="server" Text="Submit" Width="77px"></asp&#58;Button>
                    </td>
                </tr>
            </tbody>
        </table>
    </form>
    <div align="center"><asp&#58;Label id="lblFalse" runat="server" width="843px" backcolor="White" font-bold="True" font-size="Medium"></asp&#58;Label>
    </div>
</body>
</html>


Anyone have a solution? Recommendation?

Paladine
Master Poster
Team Colleague
824 posts since Feb 2003
Reputation Points: 211
Solved Threads: 27
 

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 section

<browserCaps>
			<!--NETSCAPE 6 and 7 //-->
			<case match="^Mozilla/5\.0 \&#40;&#91;^&#41;&#93;*\&#41; &#40;Gecko/&#91;-\d&#93;+ &#41;?Netscape&#91;6|7&#93;/&#40;?'version'&#40;?'major'\d+&#41;&#40;?'minor'\.\d+&#41;&#40;?'letters'\w*&#41;&#41;.*">
				tagwriter=System.Web.UI.HtmlTextWriter
				browser=Netscape
				version=$&#123;version&#125;
				majorversion=$&#123;major&#125;
				minorversion=$&#123;minor&#125;
				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/&#40;?'version'&#40;?'major'\d+&#41;&#40;?'minor'\.\d+&#41;&#40;?'letters'\w*&#41;&#41;.*">
				<case match="^&#91;5-9&#93;\." with="$&#123;version&#125;">
					tagwriter=System.Web.UI.HtmlTextWriter
				</case>
			</case>
			<!--OPERA 5+//-->
			 <case match="Opera&#91; /&#93;&#40;?'version'&#40;?'major'\d+&#41;&#40;?'minor'\.\d+&#41;&#40;?'letters'\w*&#41;&#41;">
		         <filter match="&#91;4-9&#93;" with="$&#123;major&#125;">
				     <filter match="&#91;5-9&#93;" with="$&#123;major&#125;">
			             tagwriter=System.Web.UI.HtmlTextWriter
				     </filter>
	             </filter>
             </case>
		</browserCaps>
Paladine
Master Poster
Team Colleague
824 posts since Feb 2003
Reputation Points: 211
Solved Threads: 27
 

browserCaps are the way to go. Thats the same browserCaps section I use for #Portal lol.

Tekmaven
Software Architect
Moderator
1,274 posts since Feb 2002
Reputation Points: 322
Solved Threads: 28
 

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.

[email]gary_it@yahoo.com[/email]

chiefwun
Newbie Poster
1 post since Jul 2005
Reputation Points: 10
Solved Threads: 1
 

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...

tgreer
Made Her Cry
Team Colleague
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
 

Mozilla will render widths correctly if it comes from the style attribute or a stylesheet.

Cheers,
Steve

cambia
Newbie Poster
17 posts since Jul 2005
Reputation Points: 10
Solved Threads: 3
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You