Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 729009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:44:52+00:00 2026-05-14T06:44:52+00:00

ok simple question about including large mostly static html and asp.net code I am

  • 0

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

    <%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" %>

    <%@ Import Namespace="YAF.Classes.Core" %>


<script runat="server">

    protected void Page_Load(object sender, System.EventArgs e)
    {

        btnSearch.Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(btnSearch, "") + ";this.disabled = true;"); 
        if (forum.PageUserID != 1)
        {
            Page.FindControl("divGuest").Visible = false;
            Page.FindControl("divUser").Visible = true;
            lblUserName.Text = forum.PageUserName;
        }
        else
        {
            Page.FindControl("divGuest").Visible = true;
            Page.FindControl("divUser").Visible = false;
            lblUserName.Text = null;
        }

    }
    public void Page_Error(object sender, System.EventArgs e)
    {
        Exception x = Server.GetLastError();
        YAF.Classes.Data.DB.eventlog_create(YafServices.InitializeDb.Initialized ? (int?)YafContext.Current.PageUserID : null, this, x);
        YAF.Classes.Core.CreateMail.CreateLogEmail(x);
    }


    protected void btnSearch_Click(object sender, EventArgs e)
    {
        if (txtSearch.Text.Length > 4)
        {
            if(ddlCriteria.SelectedValue == "Posts")
                Response.Redirect("default.aspx?g=search&search=" + txtSearch.Text);
            if(ddlCriteria.SelectedValue == "Posted By")
                Response.Redirect("default.aspx?g=search&postedby=" + txtSearch.Text);
        }

    }
</script>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <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

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

Redid the example I was trying to make this into a UC but I ran into a problem with the server script and it not allowing me to obfuscate it more.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T06:44:52+00:00Added an answer on May 14, 2026 at 6:44 am

    There’s no reason to use IFRAMEs in this scenario. Their disadvantages are:

    • They are fixed in size
    • They don’t count for the SEO on your page
    • You can’t access the DOM for items in them (to do scripting)

    So I would “include” a file. With ASP.NET your best bet is User Controls or Master Pages.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 450k
  • Answers 450k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It only works if you wrap your whole page inside… May 15, 2026 at 8:41 pm
  • Editorial Team
    Editorial Team added an answer The 'thing' list is excepting a Guid value. You should… May 15, 2026 at 8:41 pm
  • Editorial Team
    Editorial Team added an answer The attributes are SQL types, hence the following are supported:… May 15, 2026 at 8:41 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.