Link to home
Create AccountLog in
Avatar of kahvedzic
kahvedzicFlag for Bosnia and Herzegovina

asked on

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.
Avatar of sameer_goyal
Flag of India image


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:


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.

Avatar of kahvedzic


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.
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?
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.
Avatar of kahvedzic
Flag of Bosnia and Herzegovina image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
cool. all the best..
because I solve this problem by myself