Mike Diehl's WebLog

Much aBlog about nothing...

ASP.NET and popup pages...

I'm not an ASP.NET expert by any means, so I post this question to the Blogsphere...

I have a student who is a Lotus Notes developer, who commonly uses javascript to open a “popup window” from the browser as a dialog box, have the user select some values, and post those results (somehow) back to the calling page. This is easily enough done in Windows Forms, but is there a corresponding paradigm in ASP.NET?

We've been talking about postbacks and linking to different pages, but never any parent/child or dialog type page to page relationships. I think the paradigm for ASP.NET applications is just different.

Is that right? Or can it be done (easily)?

Mike

Published Wednesday, February 11, 2004 3:03 PM by MikeD
Filed under:

Comments

# re: ASP.NET and popup pages...@ Wednesday, February 11, 2004 4:08 PM

Timely question: http://aspnet.4guysfromrolla.com/articles/021104-1.aspx

Subscribe to the great 4Guys RSS feed:
http://aspnet.4guysfromrolla.com/rss/rss.aspx

# re: ASP.NET and popup pages...@ Wednesday, February 11, 2004 4:25 PM

This probably does what you need:

http://www.metabuilders.com/Tools/DialogWindow.aspx

# re: ASP.NET and popup pages...@ Wednesday, February 11, 2004 4:29 PM

I'd agree you should go with the MetaBuilders deal if that does what you need.

I've worked with a function that sets form fields on the window.opener form, which is essentially what the Metabuilders control does. Here's a simple function that does this:

function SetImageId(imageID,imageSrc) {
var i, inp = self.location.search.substr(1);
var queryString = new Object();
if (inp.length > 0) {
var ary = inp.replace(/\+/g, " ").split("&");
for (i in ary) {
ary[i] = unescape(ary[i]).split("=");
queryString[ary[i][0]] = ary[i][1];
}
}

var form = queryString["formname"];
var field = queryString["fieldname"];
var field2 = queryString["imagename"];
var srcString = 'uploads/images/' + imageSrc;

eval("window.opener.document." + form + "." + field + ".value='" + imageID + "';");
eval("window.opener.document." + form + "." + field2 + ".src='" + srcString + "';");
window.close();
}

# re: ASP.NET and popup pages...@ Wednesday, February 11, 2004 11:44 PM

Is the question "how to do this" or "is this the right thing to do" ?

by Joel

# re: ASP.NET and popup pages...@ Wednesday, May 26, 2004 11:30 AM

dgdgdgd

by dfdf

# re: ASP.NET and popup pages...@ Saturday, August 07, 2004 7:28 PM

http://dotnetjunkies.com/WebLog/stefandemetz/archive/2004/07/17/19594.aspx