Results 1 to 6 of 6

Thread: prevent Iframe refresh when in asp master page

  1. #1
    Join Date
    Nov 2006

    prevent Iframe refresh when in asp master page

    I have an iframe in a content placeholder in an asp master page. The problem I am having is that everytime I open a new page that uses the master page as a reference it causes a complete page refresh including my iframe. Does anyone know how I can prevent the refresh on the iframe page alone. The iframe has an embedded media player that I do not want refreshed as the refresh keeps starting my music over again and I want it to play continuously as users browse through the site (unless of course if they turn the music off).

  2. #2
    Join Date
    Nov 2003
    Jerryville, Tejas
    An iframe isn't the right thing to use for that. You have to put the media player in a master frame in a frameset.
    "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan

  3. #3
    Join Date
    Nov 2006
    Thanks Ray....I had thought about that but being a relatively new at web development I had read so many horror stories about framesets that I thought I would stay away from them. But, I will give it a try if this will solve my problem. Thanks so much for the reply.


  4. #4
    Join Date
    Nov 2003
    Jerryville, Tejas
    I don't recommend the use of frames (or noise on web pages) but that's the only way I know to do what you want.
    "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan

  5. #5
    Join Date
    Jul 2008

    Any updates?

    Hey guys.

    I know this thread is 2 years old, but...

    I am having the same issue where an iframe in contentform with a master page is refreshed on post backs, even those of ajax update panels (with update mode set to conditional) where the iand Mike are you thereframe is not supposed to reload.

    I will look at framesets, with which I am not familiar, but was wondering if you ever figured out what was going on here?

    Again, I have a page where I am required to have an iframe, and I'd like to use master pages, but the iframe in the contentform (which uses a master page) reloads on postbacks when it shouldn't. I put the same code in a page w/o a masterpage and the iframe does not reload on ajax postbacks.

    In any case, would appreciate any wisdom you might have gained.


  6. #6
    Join Date
    Jul 2008

    Update: My issue resolved


    I figured out my issue.

    I am doing an async postback on page load from javascript and I was passing a javascript id that didn't include the "ctl00_ContentPlaceHolder1_" which are required bc of the master page.

    In any case, not sure I made clear what my issue/resolution were, but if you have questions, don't hesitate to ping me. Code Below:

    Thanks Again,

    <%@ Page Language="C#" MasterPageFile="~/MasterPages/Test.master" AutoEventWireup="true" Inherits="Test" CodeBehind="Test.aspx.cs" EnableEventValidation="false" %>

    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
    <asp:Content ID="Content2" ContentPlaceHolderID="head" runat="Server">

    <script language="javascript" type="text/javascript">
    function PopulateFriendsTable() {
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm._doPostBack('ctl00_ContentPlaceHolder1_UpdatePanel1', '');

    // -->

    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" />
    <iframe id="ifmeX" runat="server" width="100%" height="550" frameborder="no" scrolling="no" allowtransparency="true" src="http://pieteip.com" />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" OnLoad="UpdatePanel1_Load" UpdateMode="Conditional" RenderMode="Block">
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1" DisplayAfter="1">
    <img id="imgLoading" runat="server" src="~/Images/progressbars/BigCircleGreen.gif" />
    <ajaxToolkit:AlwaysVisibleControlExtender ID="ace" runat="server" TargetControlID="UpdateProgress1" VerticalSide="Top" VerticalOffset="2" HorizontalSide="Right" HorizontalOffset="100" ScrollEffectDuration=".1" />
    <asp:Label ID="Label1" runat="server" Text="" CssClass="ctlGeneralSmall" Font-Bold="true" />
    <asp:Button ID="btnUpdateLabel" runat="server" Text="Update Label" OnClick="btnUpdateLabel_Click" />
    <table border="1" cellpadding="4" cellspacing="0" id="tblFacebookFriends" runat="server" bgcolor="whitesmoke" style="border-color: #808080;">
    <td align="center" bgcolor="#333333">
    <asp:Label ID="Label4" runat="server" Text="Friend" ForeColor="White" />
    <td align="center" bgcolor="#333333">
    <td align="center" bgcolor="#333333">
    <asp:HiddenField ID="hdnTblStatus" runat="server" EnableViewState="false" Value="" />
    <asp:Content ID="Content3" ContentPlaceHolderID="postbody" runat="Server">

    <script language="javascript">
    if ((document.getElementById('ctl00_ContentPlaceHolder1_hdnTblStatus').getAttribute('value') == null) || (document.getElementById('ctl00_ContentPlaceHolder1_hdnTblStatus').getAttribute('value') == '')){
    window.setTimeout(function() {try{PopulateFriendsTable();}catch(err){} }, 5000);


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.13701 seconds
  • Memory Usage 2,896KB
  • Queries Executed 13 (?)
More Information
Template Usage (32):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (6)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates