473,770 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

popup window with postback...

EMW
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
Nov 18 '05 #1
3 4550
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.d ocument.all.tex tboxname.value
and
window.opener._ _doPostBack('bu ttonname', '')

I made the javascript dynamic as well... here is the javascript I created
for the popup window

// register javascript
if(!Page.IsClie ntScriptBlockRe gistered("fillA ndClose"))
{
string script = @"<script language=""java script"">" + "\r\n";
script += "function fillAndClose(em pid){\r\n";
script += "window.opener. document.all." +
Request.QuerySt ring["textbox"] + ".value=empid;\ r\n";
script += "window.opener. __doPostBack('" +
Request.QuerySt ring["button"] + "','');\r\n ";
script += "window.close() ;}\r\n";
script += "</script>\r\n";
this.Page.Regis terClientScript Block("fillAndC lose", 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" <SomeOne@MicroS oftdotCom> wrote in message
news:40******** **************@ dreader2.news.t iscali.nl...
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

Nov 18 '05 #2
EMW
Thanks!

rg,
Eric
"Cliff Harris" <he***@myrealbo x.com> schreef in bericht
news:eA******** ******@TK2MSFTN GP09.phx.gbl...
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.d ocument.all.tex tboxname.value
and
window.opener._ _doPostBack('bu ttonname', '')

I made the javascript dynamic as well... here is the javascript I created
for the popup window

// register javascript
if(!Page.IsClie ntScriptBlockRe gistered("fillA ndClose"))
{
string script = @"<script language=""java script"">" + "\r\n";
script += "function fillAndClose(em pid){\r\n";
script += "window.opener. document.all." +
Request.QuerySt ring["textbox"] + ".value=empid;\ r\n";
script += "window.opener. __doPostBack('" +
Request.QuerySt ring["button"] + "','');\r\n ";
script += "window.close() ;}\r\n";
script += "</script>\r\n";
this.Page.Regis terClientScript Block("fillAndC lose", 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" <SomeOne@MicroS oftdotCom> wrote in message
news:40******** **************@ dreader2.news.t iscali.nl...
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


Nov 18 '05 #3
Eric,

You can popup a window with javascript call showModalDialog (...). You can
pass a url of a aspx page as a parameter. You will get a new window with a
fully functional webform inside. It can include all server- and client-side
components, perform postbacks, whatever you want. The calling window will
sit and wait until the popup closes. It will get back a parameter, which can
be the text you want to pass.

Eliyahu

"EMW" <SomeOne@MicroS oftdotCom> wrote in message
news:40******** **************@ dreader2.news.t iscali.nl...
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

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
12432
by: HarveyB | last post by:
I would like to generate non-modal popup windows from ASP.Net code-behind. I have tried using Client Side scripting like "function Test(){ window.open('test.htm',_blank, 'height=200,width=400,status=no,toolbar=no, menubar=no,location=no resizable=no scrollable=no'); but I can't seem to invoke the client side script from within a Server Side Form. I know I can use the context with to Response.redirect or Server.transfer to return a
4
3175
by: Andrew Alger | last post by:
ok i have two forms. Customer.aspx and Parent_Searh.aspx. There is a button on Customer.aspx that when executed runs javascript code to open up parent_search as a popup. After the user searches for the parent and finds the proper parent in the datagrid they then click on the accept button in the grid. Then I populate a session variable with the parent ID. I then go back to the main page and have it refresh using: ...
5
2516
by: Jay | last post by:
I have a situation where the user clicks on a button in a DataGrid to launch a popup window via javascript. In the popup window the user does some things that result in changes to the underlying database the DataGrid is using as a data source. When the popup window is closed I want to refresh the main window -- i.e., cause a postback to happen. Is this possible?
1
11582
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at http://weblogs.asp.net/asmith/archive/2003/09/15/27684.aspx but it was far more complex then I needed. (I got lost trying to figure it all out). Therefore, here goes my simple "web dialog box with parent event handler fireing" solution. ...
12
1460
by: HarveyB | last post by:
I would like to generate non-modal popup windows from ASP.Net code-behind. I have tried using Client Side scripting like "function Test(){ window.open('test.htm',_blank, 'height=200,width=400,status=no,toolbar=no, menubar=no,location=no resizable=no scrollable=no'); but I can't seem to invoke the client side script from within a Server Side Form. I know I can use the context with to Response.redirect or Server.transfer to return a
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9906
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.