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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:13:45+00:00 2026-06-15T20:13:45+00:00

in my asp.net application I have a page That has two iframes. Above these

  • 0

in my asp.net application I have a page That has two iframes. Above these frames are a few link buttons. When these buttons are hit, they should change the src of the two iframes. Listed below is the client side code and javascript I am using to do this. The issue is when any of these buttons are hit, instead of just changing the src of one of the iframes, the whole page refreshes. (i can tell this is refreshing because the link buttons are not available till you log in on the first page shown in the main frame, after you log in the buttons become visible via a call to the parent – window.parent.loginSuccess() ). If one of them is then clicked, it sends you back to the log in page in the iframe and the buttons are are no longer visible.) Here is the code, does anyone see why this is happening? Thank you for your help.

<body id="bodysty">
<div id="fstyle" class="daform">
    <form id="form1" runat="server">
    <div id="master">
    <div id="topthing"> <asp:LinkButton ID="lbtnControlPanel" onclientclick="CPhit()" runat="server" style="display:none">Control Panel</asp:LinkButton> <asp:LinkButton ID="lbtnAddClient" runat="server" onclientclick="AddClientHit()" style="display:none">Add Client</asp:LinkButton> <asp:LinkButton ID="lbtnManageClients" runat="server" onclientclick="ManageClientsHit()" style="display:none">Manage Clients</asp:LinkButton> <asp:LinkButton ID="lbtnAdmin" runat="server" onclientclick="ManageClientsHit()" style="display:none">Admin Options</asp:LinkButton></div>
    <div id="leftcontrol">
    <iframe id="LeftIframe" runat="server" ></iframe>
        </div>
    <div id="mainbodyform">

    <iframe id="ContentIframe" runat="server" src="Login.aspx" class="mainiframe" ></iframe>
    </div>
    </div>
    </form>
    </div>
</body>
</html>
<script language="javascript">
    function CPhit() {
        document.getElementById("ContentIframe").src = "LoginNotes.aspx";
    }
    function AddClientHit() {
        document.getElementById("ContentIframe").src = "NewCustomer.aspx";
    }
    function loginSuccess() {
        document.getElementById('lbtnControlPanel').style.display = 'inherit'
        document.getElementById('lbtnAddClient').style.display = 'inherit'
        document.getElementById('lbtnManageClients').style.display = 'inherit'
        document.getElementById('lbtnAdmin').style.display = 'inherit'
    }
</script>

There is no code in the codebehind that deals with this page, its simply for navigation. Any ideas? Thank you for your help.

  • 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-15T20:13:46+00:00Added an answer on June 15, 2026 at 8:13 pm

    You need to cancel the default click action of the item you are clicking on.

    Simple way is to return false on the click event.

    onclientclick="CPhit(); return false;" 
    

    better way is preventDefault()

    • 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, and the
I have an ASP.Net application running under IIS 6. A simple page has two
I have a ASP.NET web application which has more than 100 pages. Each page
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
I'm having a strange problem here... I have an ASP.NET 3.5 application that has
I have an asp.net MVC application that has one section /admin locked down via

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.