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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:11:02+00:00 2026-05-15T08:11:02+00:00

In my asp.net web app, I create a popup window with a button. When

  • 0

In my asp.net web app, I create a popup window with a button. When that button is clicked, I want to set the value of an asp:TextBox (id=TextBox1) contained in the parent window. However, it doesn’t work like all the examples I’ve read indicate.

I’ve tried the following lines of code in my javascript onclick handler:

  1. window.opener.document.getElementById(‘<%= TextBox1.ClientID %>’).value = “abc”;
  2. window.opener.document.getElementById(“TextBox1”).value = “abc”;
  3. window.opener.document.getElementById(“ctl00_ContentPlaceHolder1_TextBox1”).value = “abc”;

Only example 3 works. All the stuff I’ve read indicates that #1 is the preferred method, but I can’t seem to make it work at all. Does anyone have any ideas what I’m doing wrong?

I’ve tried this in Firefox, Chrome and IE.

Thanks

  • 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-15T08:11:02+00:00Added an answer on May 15, 2026 at 8:11 am

    Is this line of JavaScript contained in the markup for the popup window itself? If so, the server-side code for that won’t be aware that TextBox1 exists on the server-side code for the parent window, and won’t be able to determine its ClientID property. You either need to pass that client ID to the popup window somehow (querystring, cookie, session, whatever) or hard code it. Alternatively, you may be able to put this line of JavaScript in a function on your parent page, and then call something along the lines of window.opener.functionName().

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

Sidebar

Related Questions

I want to create a notebook in asp.net web/app, which has prefix of Username
I've created an web authentication app using c# & asp.net and want to bounce
I'm a newbie with ASP.NET web applications. When I create an ASP.NET web app
We are trying to create an ASP.NET web app using the apple-mobile-web-app-capable meta-tag to
I am developing a MySQL Web App using ASP.net and I have heard that
I have an asp.net web app that uses forms-based authentication, a SqlMembershipProvider (using an
I want to backup my existing ASP.net web app before updating it. Therefore I
The ASP.NET web app project I'm currently working on is getting slower over time
We're writing an asp.net web app on IIS 6 and are planning on storing
I'm writing an asp.net web app. and i've hit a bit of a brick

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.