bind textbox after button click on pop-up window

Have a main page with button, button click open pop-up window. Pop-up window also has button, on button click pop window is closing, but I also want to bind textbox on main window when button click on pop-up (want to close pop-up and bind textbox on button click on pop-up) How to do that?

Thanks for help.
LVL 1
kahvedzicAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sameer_goyalCommented:
Hi,

You can do the following:

1. On button click of the pop up window, save the value that you want to bind to the text box on Main window, in a session variable and force post back of the main window while you close the pop up window using javascript:

opener.Submit();

2. On the page load of the main window check if the IsPostBack is true and set the text box with the session variable you set on the pop up window.

Hope it helps. Let me know.

kahvedzicAuthor Commented:
This is not an option because, button click on pop-up is inserting data in sql table, and on databind event of text box i use select query to read that data.

I try this way:

on main window add one more button, on that button click I call data bound of text box

on pop up window button click I try to call main button window click (which then calls textbox data bound).

Problem is that on pop up button click I cant find button from main page (on main page I use master page).

This is code where I call button click from main page:

ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "zahtjev", "window.opener.ctl00$MainContent$Button1.Click();", True)

but problem is that I cant find button on main page.
sameer_goyalCommented:
I don't understand.
You are saying that you want to bind the textbox on main window but you don't want to execute its Data Bound Event?

Is it?
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

kahvedzicAuthor Commented:
You got it all wrong, on pop-up button click I want to call main window button click and on main button click I force databind of textbox. Problem with my soultion is that I cant point to main window button click event (I use masterpage and dont know how to point on main window button - this part of code: ctl00$MainContent$Button1)

anyway I think I have problem with this line of code on pop up window:

ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "zahtjev", "window.opener.ctl00$MainContent$Button1.Click();", True)

because I dont know how to find my button on main page with masterpage.
kahvedzicAuthor Commented:
I just find where the problem is:

ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "zahtjev", "window.opener.document.getElementById('MainContent_Button1').click();", True)

and now it is working perfectly.

Anyway thanks for effort.

Cheers.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sameer_goyalCommented:
cool. all the best..
kahvedzicAuthor Commented:
because I solve this problem by myself
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.