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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:42:55+00:00 2026-05-31T16:42:55+00:00

I have an IFrame embedding a youtube video. I want to create a textbox

  • 0

I have an IFrame embedding a youtube video. I want to create a textbox where user (admins) can paste a new src (URL) of video and the IFrame take the new source. Here is what I have so far:

protected void Edited_Click(object sender, EventArgs e)
    {
       // HtmlControl frame1 = (HtmlControl)this.FindControl("frame1");
        string url = TextBox1.Text;
        frame1.Attributes["src"] = url;

    }

And in the html code is the Iframe:

<div id="video">
    <iframe title="YouTube video player" runat="server" width="420" 
            frameborder="1" style="height: 265px; float: left; 
            text-align: center;" id="frame1" 
        name="frame1" align="middle"></iframe>
       <br />
       </div>

I don’t set any src in the beginning but when I paste a URL in the textbox and hit the button, the Iframe doesn’t displays anything.

  • 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-31T16:42:56+00:00Added an answer on May 31, 2026 at 4:42 pm

    You need to do this on the client browser, not server-side. I would suggest something like:

    // (Add inside script element in head of page html)
    
    window.onload = function() {
        document.getElementById('<id of input>').onchange = function() {
            changeFrameUrl();
        }
    };
    
    function changeFrameUrl() {
            var inputVal = document.getElementById('<id of input>').value;
            document.getElementById('<id of iframe>').src = inputVal;
    }
    

    Hope this helps – it’s off the top of my head though, so don’t diss me if it doesn’t work first time!

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

Sidebar

Related Questions

I have an iFrame and I want the user to be able to grab
i know i can have iframe in a html page, say parent.htm, and i
I have a iframe that i want to open pdf's into from a list
I have an IFrame with a Table enclosed within it. I want to display
I have an iframe in a tab with a hidden element, and I want
I have iframe (cross domain) with src from Facebook, Twitter or etc. I need
I have iframe based facebook app, I just want to do is that whenever
Regarding the Youtube API Blog they are experimenting with their new HTML5 Video Player.
I have an iframe <iframe src=preloader.gif id=graphFrame...></iframe> . I would like to centre the
I have iframe inside the column of <asp:table> . I want to get the

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.