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

  • Home
  • SEARCH
  • 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 944271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:33:57+00:00 2026-05-15T22:33:57+00:00

Ok, I know everyone thinks IFrames are bad an I know that. But I

  • 0

Ok, I know everyone thinks IFrames are bad an I know that. But I am “required” to use one for a rare case.

So the question I have is when you have an .aspx page that contains an IFrame and then in that IFrame another .aspx page, if you want that .aspx page inside that IFrame to be able to work with JS, should you:

1) Put all your JS in the main .aspx and somehow reference that code from the inner .aspx to the main .aspx to call JS methods that reside in the main .aspx? Meaning should I be thinking about this backwards in that I put all JS even if it’s really for the inner .aspx in the main .aspx and then try to make calls from that inner .aspx and reference those JS methods somehow? Because right now I’m having trouble grabbing the ClientID for .aspx controls when I have JS inside the inner .aspx and that .aspx also has asp.net web controls that I’m trying to set a JS var to its clientID..normal stuff here but it’s not working because every time I test that var in JS it’s just spitting back the server-side ID, not the runtime rewritten ID that the naming container in the control spits out.

I also see the problem in that you’d have to somehow get the jQuery library if using a library like this somehow referenced to your .aspx that sits in the IFrame. You wouldn’t want to load the jQuery library twice (once in your main and once in your Iframe’s .aspx) so that further makes me tend to believe that this option is how I need to go so that the inner .aspx somehow references the main .aspx’s reference to the jQuery library that I’ve included in my master page. The main .aspx is tied to that master page.

2) Put the main .aspx related JS of course in the main .aspx and put the inner .aspx related JS in the inner .aspx file. But then again I run into problems as stated.

This is a lot to read but I don’t know how else to explain this problem and situation where I’m trying to figure out what people are doing about this when using IFrames.

  • 1 1 Answer
  • 1 View
  • 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-15T22:33:58+00:00Added an answer on May 15, 2026 at 10:33 pm

    You can reference anything in your main page from any iframe by using top, as in top.getElementById('maindiv');

    From the main page, you access the frame by its name or index from the frames array.

    Both frame and parent must be vended from the same domain to cross-communicate in this way.

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

Sidebar

Related Questions

Ok I know everyone is going to tell me not to use RegEx for
i hope that everyone here know the php 'variable variable' syntax: $color = 'red';
Hello everyone don't know why this code works on windows but not on linux
Sorry in advance everyone for this question as I know the cascading select boxes
I have been trying to use localstorage to store Jquery-min but I am unable
I know everyone who reads the question will think Firebug! right away. Maybe some
I know this must be a fairly simple question, but I haven't managed to
I know everyone has problems with their footers, and I have traversed many with
Before I start I would just like everyone know that I did indeed spend
Everyone know about Google Analytics tracking code. It's a javascript code similar to one

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.