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 8996553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:46:11+00:00 2026-06-15T23:46:11+00:00

In my asp.net application i have a page that has two iframes, and the

  • 0

In my asp.net application i have a page that has two iframes, and the main page being displayed inside this iframe contains a button. When this button is hit, it calls a javascript function which takes part of the URL and calls a javascript function in the parent window. When the function from the parent is hit, it should change the src of the iframe to a different page – this is not happening. The main iframe has an id ContentIframe and the side iframe has an id LeftIframe. When this is hit – the left side iframe src is changed to nothing, and this works because the left side display does not show what was previously there. The call to change the iframe src for the content frame happens, and the codebehind even loads ( i am able to tell by placing tracepoints in the pageload in the code behind) – but the page is never displayed in the iframe, the previous page with the origional button we clicked is still being displayed. Does anyone know why this would happen? Heres my code

The button

<asp:Button ID="btnEditClient" onclientclick="editClient();" runat="server" Text="Edit Client Info" />

editClient javascript function

function editClient() {
var location = window.location.href;
var idindex = location.indexOf("clientid");
idindex = idindex + 9;
var id = location.slice(idindex, location.length);
window.parent.redir('client', id);

}

redir parent javascript function

function redir(type, id) {
    if (type = 'client') {
        document.getElementById('ContentIframe').src = "NewCustomer.aspx?clientid=" + id;
        document.getElementById('LeftIframe').src = "";

    }
}

If I were to add the following line below the LeftIframe src change above

document.getElementById('ContentIframe').disabled = true; 

The ContentIframe will not show at all. Also as stated above, the pageload for the NewCustomer.aspx page is hit as I could tell by using breakpoints. Thanks again!

edit – after the call to change the src, looking at the developer tools, here is the form in the iframe, still says the previous pages items – not sure if this will help or not – maybe the method=post may have to do with this?

<form id="form1" action="NewClientSummary.aspx?clientid=13" method="post">
  • 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-06-15T23:46:12+00:00Added an answer on June 15, 2026 at 11:46 pm

    The problem is that <asp:Button> is rendered as a submit button. This means that clicking it will submit the form and the form in the frame is probably directed to the same page. (default action)

    Either use ordinary button:

    <button type="button" id="btnEditClient" onclick="editClient();">Edit Client Info</button>
    

    Or if you need it server side, just cancel the default action of the button by returning false:

    <asp:Button ID="btnEditClient" onclientclick="editClient(); return false;" runat="server" Text="Edit Client Info" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in my asp.net application I have a page That has two iframes. Above these
I have an ASP.Net application running under IIS 6. A simple page has two
I'm doing an asp.net application with one page. In this page, I have one
I have a ASP.NET web application which has more than 100 pages. Each page
I have a web application in Asp.Net. I've created my master page and inside
I am developing an ASP.NET MVC application that has two kind of pages: (1)
I have an ASP.NET MVC application that has a jQuery Treeview and a jQuery
I have an ASP.NET web application I'm running with VS2010 that has session timeout
I'm developing an ASP.NET application with C# and Ajax. I have a page that
We have an legacy application (mixture of classic ASP and ASP.net) that has a

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.