I've done somthing similar with a selection pop-up box.
I use javascript on my main form to open a popup box. Then, when the user
selects their option, I use javasrcript to access a textbox on my parent
form, insert the text, then also use javascript to fire then postback event
on the main form, passing it the name of a submit button so any associated
events can be fired.
To access the controls on the parent form, I used:
window.opener.document.all.textboxname.value
and
window.opener.__doPostBack('buttonname', '')
I made the javascript dynamic as well... here is the javascript I created
for the popup window
// register javascript
if(!Page.IsClientScriptBlockRegistered("fillAndClose"))
{
string script = @"<script language=""javascript"">" + "\r\n";
script += "function fillAndClose(empid){\r\n";
script += "window.opener.document.all." +
Request.QueryString["textbox"] + ".value=empid;\r\n";
script += "window.opener.__doPostBack('" +
Request.QueryString["button"] + "','');\r\n";
script += "window.close();}\r\n";
script += "</script>\r\n";
this.Page.RegisterClientScriptBlock("fillAndClose", script);
}
So, if I just pass in the name of the textbox and the name of the button in
a querystring, the popup window will use those on the main form.
HTH,
-Cliff
EMW said:
Hi,
Is it possible with VB.NET and Javascript to popup a window, after a
buttonclick, in which the user writes some text in a textbox and then when
that window is closed with a button, the text is posted back to the aspx
program?
If it is possible, please let me know some articles about this?
thanks,
Eric