Click to See Complete Forum and Search --> : Opening a popup window for data entry in .NET


beacon-dartmouth
May 6th, 2004, 09:11 AM
I have a page with labels, dropdown lists, and buttons, which needs to be always visible in the browser. When the user clicks a 'modify' button on this page, a web form with text boxes will open up in the form of a new popup window, so that changes can be made and submitted from this smaller popup window. Ideally, the main page should be re-loaded in the original browser window reflecting the latest udpates after the popup window is closed.

I am passing variables to the popup and the code below doesn't quite behave as I wanted it to.

As it is right now, I'm calling the appDetailEdit,aspx twice, but I don't know enough to write an inline javascript statement so that it opens up a popup window, passes the values I need to it, while keeping the main page in the original browser window, which will reload automatically when the form in the popup window is submitted.

Thank you.


Sub bClick1( s As Object, e As EventArgs )
Context.Items.Add( "Application_ID", lblAppID.Text )
Context.Items.Add( "Name", lblName.Text )
Context.Items.Add( "Acronym", lblAcronym.Text )
Context.Items.Add( "Program_Area_Name", lblProgArea.Text )
Context.Items.Add( "Usage_start_Date", lblStartDate.Text )
Context.Items.Add( "Description", lblDesc.Text )
Context.Items.Add( "Field_Detail", lblFieldDet.Text )
Context.Items.Add( "DivisionName", lblDivisionID.Text )
Context.Items.Add( "BureauName", lblBureauID.Text )
Response.write("<script language='JavaScript'>window.open
('appDetailEdit.aspx','PopUp','location=no,toolbar=no,status=no,m
enubar=no,scrollbars=yes,resizable=yes')<" & "/script>")
server.transfer( "appDetailEdit.aspx", true )

End Sub

Sonu Kapoor
May 8th, 2004, 10:23 AM
Change the url in the javascript window to something like this:
appDetailEdit.aspx?Var1=Value1&Var2=Value2...
Then you can retrieve the values with:
Response.QueryString["Var1"];
And to reload the parent window you can use the javascript function like this:
window.opener.location.reload()

Sonu

beacon-dartmouth
May 10th, 2004, 11:14 AM
thank you sonu, i'll work on your suggestion.

my only worry is that the description field I have may cause the querystring to truncate data after its maximum character limit is reached. As a concept it's quite doable, though, and it clears a few doubts I had about what can and cannot be done in a .NET environment.

b-d

Sonu Kapoor
May 10th, 2004, 11:16 AM
Well, try my suggestion and let me know if it does work. If not then we can try to find something else.

Sonu