#include file vs iframe or is there a better way

Posted by Laurence Burke on Stack Overflow See other posts from Stack Overflow or by Laurence Burke
Published on 2010-04-12T14:45:59Z Indexed on 2010/04/12 14:52 UTC
Read the original article Hit count: 741

Filed under:
|
|
|

ok simple question about including large mostly static html and asp.net code I am using as of right now #include and I was wondering if iframes would be a better way of handling what I wish to do or is there a better way to do it. here is the current way i'm handling the includes

default.aspx

    <head id="YafHead" runat="server">
    <meta id="YafMetaDescription" runat="server" name="description" content="Yet Another Forum.NET -- A bulletin board system written in ASP.NET" />
    <meta id="YafMetaKeywords" runat="server" name="keywords" content="Yet Another Forum.net, Forum, ASP.NET, BB, Bulletin Board, opensource" />
    <title>Forums</title>
    <style type="text/css">
     .sbutton 
     {
    background-color:#361800;
    border:medium none;
    border-collapse:collapse;
    color:#FFFFFF;
    font-family:Tahoma,Arial,Helvetica;
    font-size:10px;
    font-weight:bold;
    vertical-align:middle;
    }
   </style> 
   <link href="images/favicon.ico" type="image/ico" rel="shortcut icon" /> 
    <link rel="stylesheet" href="navTopStyle.css" type="text/css" media="screen" />
    </head>
    <body style="margin: 0">
    <form id="form1" runat="server" enctype="multipart/form-data">
    <table align="center" style="background-color: #ffffff" cellpadding="0" cellspacing="0"
        width="790px">
        <tr>
            <td>
                <!--#include file="CComHeader.html"-->
            </td>
        </tr>
        <tr>
            <td>
                <YAF:Forum runat="server" ID="forum"></YAF:Forum>
            </td>
        </tr>
    </table>
    </form>
    </body>
    </html>

CComHeader.html

                <table cellpadding="0" cellspacing="0" width="790px">
                <tr>
                    <td align="left">
                        <img src="images/smokechair.jpg" alt="Cigar.com" /><img src="images/cigarcomTitle.gif"
                            alt="Cigar.com" />
                    </td>
                    <td align="right">
                        <table width="310px" height="73px" cellpadding="0" cellspacing="0" style="padding-right: 6px">
                            <tr>
                                <td width="109px" class="welcome" align="left">
                                Welcome to Cigar.com
                                </td>
                                <td width="195px" class="welcome" align="left">
                                    <div runat="server" id="divUser">
                                        <table cellpadding="0" cellspacing="0" align="right">
                                            <tr>
                                                <td width="126px" align="left">
                                                    <asp:Label ID="lblUserName" CssClass="welcome" runat="server"></asp:Label></td>
                                                <td width="65px" align="left">
                                                    <a href="http://www.cigar.com/cs/languages/en-US/docs/faq.aspx">Help</a></td>
                                            </tr>
                                        </table>
                                    </div>
                                    <div runat="server" id="divGuest">
                                        <a href="OutsideLogin.aspx">Sign In</a> | <a href="OutsideLogin.aspx">Join</a> |
                                        <a href="http://www.cigar.com/cs/languages/en-US/docs/faq.aspx">Help</a>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <table cellpadding="0" cellspacing="0" >
                                        <tr>
                                            <td width="234px" align="right">
                                                <asp:DropDownList ID="ddlCriteria" runat="server">
                                                    <asp:ListItem>Posts</asp:ListItem>

                                                    <asp:ListItem>Posted By</asp:ListItem>
                                                </asp:DropDownList>
                                            <asp:TextBox Width="120px" ID="txtSearch" runat="server"></asp:TextBox>
                                            </td>
                                            <td width="70px" align="center">
                                                        <asp:Button ID="btnSearch" runat="server" Text="Search" CssClass="sbutton" OnClick="btnSearch_Click" />

                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                    <!--#include file="commonTabBar.html" -->

                    </td>
                </tr>
            </table>

commonTabBar.html

 <%-- CommonTabBar firebugged from Cigar.com--%>
<div class="CommonTabBar">

    <script language="javascript">
        function tabOver(e) {
            if (e.className != 'CommonSimpleTabStripSelectedTab')
                e.className = 'CommonSimpleTabStripTabHover';
        }
        function tabOut(e) {
            if (e.className != 'CommonSimpleTabStripSelectedTab')
                e.className = 'CommonSimpleTabStripTab';
        }
        function tabOverSub(e) {
            if (e.className != 'CommonSimpleTabStripSelectedTabSub')
                e.className = 'CommonSimpleTabStripTabHoverSub';
        }
        function tabOutSub(e) {
            if (e.className != 'CommonSimpleTabStripSelectedTabSub')
                e.className = 'CommonSimpleTabStripTabSub';
        }
    </script>

    <table border="0" cellpadding="0" cellspacing="0">
        <tbody>
            <tr valign="middle">
                <td class="CommonSimpleTabStripTab" style="padding: 0px">
                    &nbsp;
                </td>
                <td class="CommonSimpleTabStripTab" onmouseover="tabOver(this);" onmouseout="tabOut(this);"
                    onclick="window.location = 'http://www.cigar.com/index.asp'">
                    <a style="float: right; display: block; height: 30px; line-height: 30px; padding-left: 12px;
                        padding-right: 12px; vertical-align: middle;" href="http://www.cigar.com/index.asp">
                        Home</a>
                </td>
                <td class="CommonSimpleTabStripTab" onmouseover="tabOver(this); document.getElementById('ComDropDown2').style.display = 'inline';"
                    onmouseout="tabOut(this); document.getElementById('ComDropDown2').style.display = 'none';">
                    <a style="float: right; display: block; height: 30px; line-height: 30px; padding-left: 12px;
                        padding-right: 12px; vertical-align: middle;" href="http://www.cigar.com/cigars/index.asp">
                        Cigars</a>
                    <div id="ComDropDown2" style="border: 1px solid rgb(71, 42, 24); margin: 28px 0px 0px;
                        display: none; background-color: rgb(235, 230, 208); color: rgb(71, 42, 24);
                        position: absolute; float: left; z-index: 200;" onmouseover="document.getElementById('ComDropDown2').style.display = 'inline';"
                        onmouseout="document.getElementById('ComDropDown2').style.display = 'none';">
                        <ul style="margin: 0px; padding: 0px; width: 100px;">
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/cigars/index.asp'"><a href="http://www.cigar.com/cigars/index.asp"
                                    style="line-height: 25px; color: rgb(71, 42, 24);" id="BrandsLink">Brands </a>
                            </li>
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/cigars/privatelabel.asp?brand=419'">
                                <a href="http://www.cigar.com/cigars/privatelabel.asp?brand=419" style="line-height: 25px;
                                    color: rgb(71, 42, 24);" id="SamplersLink">Aging Room </a></li>
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/cigars/samplers.asp'"><a href="http://www.cigar.com/cigars/samplers.asp"
                                    style="line-height: 25px; color: rgb(71, 42, 24);" id="SamplersLink">Samplers
                                </a></li>
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/cigars/suggestions.asp'"><a href="http://www.cigar.com/cigars/suggestions.asp"
                                    style="line-height: 25px; color: rgb(71, 42, 24);" id="SuggestionsLink">Suggestions
                                </a></li>
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/DailyDeal/ccCigarDeals.asp'"><a
                                    href="http://www.cigar.com/DailyDeal/ccCigarDeals.asp" style="line-height: 25px;
                                    color: rgb(71, 42, 24);" id="SuggestionsLink">Suggestions </a></li>
                        </ul>
                    </div>
                </td>
                <td class="CommonSimpleTabStripTab" onmouseover="tabOver(this); document.getElementById('ComDropDown3').style.display = 'inline';"
                    onmouseout="tabOut(this); document.getElementById('ComDropDown3').style.display = 'none';">
                    <a style="float: right; display: block; height: 30px; line-height: 30px; padding-left: 12px;
                        padding-right: 12px; vertical-align: middle;" href="http://www.cigar.com/cigars/samplers.asp">
                        Samplers</a>
                    <div id="ComDropDown3" style="border: 1px solid rgb(71, 42, 24); margin: 28px 0px 0px;
                        display: none; background-color: rgb(235, 230, 208); color: rgb(71, 42, 24);
                        position: absolute; float: left; z-index: 200;" onmouseover="document.getElementById('ComDropDown3').style.display = 'inline';"
                        onmouseout="document.getElementById('ComDropDown3').style.display = 'none';">
                        <ul style="margin: 0px; padding: 0px; width: 100px;">
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/cigars/viewsamplers.asp?subcatid=samp_var'">
                                <a href="http://www.cigar.com/cigars/viewsamplers.asp?subcatid=samp_var" style="line-height: 25px;
                                    color: rgb(71, 42, 24);" id="Variety SamplersLink">Variety Samplers </a>
                            </li>
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/cigars/viewsamplers.asp?subcatid=gift_samp'">
                                <a href="http://www.cigar.com/cigars/viewsamplers.asp?subcatid=gift_samp" style="line-height: 25px;
                                    color: rgb(71, 42, 24);" id="Gift SamplersLink">Gift Samplers </a></li>
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/cigars/createSampler.asp'"><a href="http://www.cigar.com/cigars/createSampler.asp"
                                    style="line-height: 25px; color: rgb(71, 42, 24);" id="Custom SamplerLink">Custom
                                    Sampler </a></li>
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/cigars/viewsamplers.asp?subcatid=Feat%20Samp'">
                                <a href="http://www.cigar.com/cigars/viewsamplers.asp?subcatid=Feat%20Samp" style="line-height: 25px;
                                    color: rgb(71, 42, 24);" id="Featured SamplersLink">Featured Samplers </a>
                            </li>
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/cigars/YouPickOffer.asp'"><a href="http://www.cigar.com/cigars/YouPickOffer.asp"
                                    style="line-height: 25px; color: rgb(71, 42, 24);" id="Brand SamplersLink">U Pick
                                    2 Offer </a></li>
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/cigars/exclusiveCustomSampler.asp'">
                                <a href="http://www.cigar.com/cigars/exclusiveCustomSampler.asp" style="line-height: 25px;
                                    color: rgb(71, 42, 24);" id="Brand SamplersLink">Gurkha Sampler </a></li>
                        </ul>
                    </div>
                </td>
                <td class="CommonSimpleTabStripTab" onmouseover="tabOver(this); document.getElementById('ComDropDown4').style.display = 'inline';"
                    onmouseout="tabOut(this); document.getElementById('ComDropDown4').style.display = 'none';">
                    <a style="float: right; display: block; height: 30px; line-height: 30px; padding-left: 12px;
                        padding-right: 12px; vertical-align: middle;" href="http://www.cigar.com/gifts/index.asp">
                        Gifts</a>
                    <div id="ComDropDown4" style="border: 1px solid rgb(71, 42, 24); margin: 28px 0px 0px;
                        display: none; background-color: rgb(235, 230, 208); color: rgb(71, 42, 24);
                        position: absolute; float: left; z-index: 200;" onmouseover="document.getElementById('ComDropDown4').style.display = 'inline';"
                        onmouseout="document.getElementById('ComDropDown4').style.display = 'none';">
                        <ul style="margin: 0px; padding: 0px; width: 100px;">
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/gifts/viewgifts.asp?subcatid=gift_sets'">
                                <a href="http://www.cigar.com/gifts/viewgifts.asp?subcatid=gift_sets" style="line-height: 25px;
                                    color: rgb(71, 42, 24);" id="Gift SetsLink">Best Sellers </a></li>
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/cigars/viewsamplers.asp?subcatid=gift_samp'">
                                <a href="http://www.cigar.com/cigars/viewsamplers.asp?subcatid=gift_samp" style="line-height: 25px;
                                    color: rgb(71, 42, 24);" id="Gift SamplersLink">Gift Samplers </a></li>
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/accessories/index.asp'"><a href="http://www.cigar.com/accessories/index.asp"
                                    style="line-height: 25px; color: rgb(71, 42, 24);" id="AccesoriesLink">Accesories
                                </a></li>
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/club/index.asp'"><a href="http://www.cigar.com/club/index.asp"
                                    style="line-height: 25px; color: rgb(71, 42, 24);" id="Cigar of the MonthLink">Cigar
                                    of the Month </a></li>
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/gifts/certificates.asp'"><a href="http://www.cigar.com/gifts/certificates.asp"
                                    style="line-height: 25px; color: rgb(71, 42, 24);" id="Cigar of the MonthLink">Gift
                                    Certificates </a></li>
                        </ul>
                    </div>
                </td>
                <td class="CommonSimpleTabStripTab" onmouseover="tabOver(this); document.getElementById('ComDropDown5').style.display = 'inline';"
                    onmouseout="tabOut(this); document.getElementById('ComDropDown5').style.display = 'none';">
                    <a style="float: right; display: block; height: 30px; line-height: 30px; padding-left: 12px;
                        padding-right: 12px; vertical-align: middle;" href="http://www.cigar.com/accessories/index.asp">
                        Accessories</a>
                    <div id="ComDropDown5" style="border: 1px solid rgb(71, 42, 24); margin: 28px 0px 0px;
                        display: none; background-color: rgb(235, 230, 208); color: rgb(71, 42, 24);
                        position: absolute; float: left; z-index: 200;" onmouseover="document.getElementById('ComDropDown5').style.display = 'inline';"
                        onmouseout="document.getElementById('ComDropDown5').style.display = 'none';">
                        <ul style="margin: 0px; padding: 0px; width: 100px;">
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_hum'">
                                <a href="http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_hum" style="line-height: 25px;
                                    color: rgb(71, 42, 24);" id="HumidorsLink">Humidors </a></li>
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_cutt'">
                                <a href="http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_cutt"
                                    style="line-height: 25px; color: rgb(71, 42, 24);" id="CuttersLink">Cutters
                                </a></li>
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_lite'">
                                <a href="http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_lite"
                                    style="line-height: 25px; color: rgb(71, 42, 24);" id="LightersLink">Lighters


                                </a></li>
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_case'">
                                <a href="http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_case"
                                    style="line-height: 25px; color: rgb(71, 42, 24);" id="CasesLink">Cases </a>
                            </li>
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_humf'">
                                <a href="http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_humf"
                                    style="line-height: 25px; color: rgb(71, 42, 24);" id="HumidificationLink">Humidification
                                </a></li>
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_book'">
                                <a href="http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_book"
                                    style="line-height: 25px; color: rgb(71, 42, 24);" id="BooksLink">Books </a>
                            </li>
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_ash'">
                                <a href="http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_ash" style="line-height: 25px;
                                    color: rgb(71, 42, 24);" id="AshtraysLink">Ashtrays </a></li>
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_misc'">
                                <a href="http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_misc"
                                    style="line-height: 25px; color: rgb(71, 42, 24);" id="OtherLink">Other </a>
                            </li>
                        </ul>
                    </div>
                </td>
                <td class="CommonSimpleTabStripTab" onmouseover="tabOver(this);" onmouseout="tabOut(this);"
                    onclick="window.location = 'http://www.cigar.com/sales/index.asp'">
                    <a style="float: right; display: block; height: 30px; line-height: 30px; padding-left: 12px;
                        padding-right: 12px; vertical-align: middle;" href="http://www.cigar.com/sales/index.asp">
                        Sales</a>
                </td>
                <td class="CommonSimpleTabStripTab" onmouseover="tabOver(this); document.getElementById('ComDropDown8').style.display = 'inline';"
                    onmouseout="tabOut(this); document.getElementById('ComDropDown8').style.display = 'none';">
                    <a style="float: right; display: block; height: 30px; line-height: 30px; padding-left: 12px;
                        padding-right: 12px; vertical-align: middle;" href="http://www.cigar.com/cs/">Community</a>
                    <div id="ComDropDown8" style="border: 1px solid rgb(71, 42, 24); margin: 28px 0px 0px;
                        display: none; background-color: rgb(235, 230, 208); color: rgb(71, 42, 24);
                        position: absolute; float: left; z-index: 200;" onmouseover="document.getElementById('ComDropDown8').style.display = 'inline';"
                        onmouseout="document.getElementById('ComDropDown8').style.display = 'none';">
                        <ul style="margin: 0px; padding: 0px; width: 100px;">
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/cs/forums/'"><a href="http://www.cigar.com/cs/forums/"
                                    style="line-height: 25px; color: rgb(71, 42, 24);" id="ForumsLink">Forums </a>
                            </li>
                            <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
                                list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
                                onclick="window.location = 'http://www.cigar.com/cs/blogs/'"><a href="http://w

© Stack Overflow or respective owner

Related posts about html

Related posts about ASP.NET