Web Popup window (with datagrid) from Web custom c

Results 1 to 2 of 2

Thread: Web Popup window (with datagrid) from Web custom c

  1. #1
    Join Date
    Dec 1969

    Default Web Popup window (with datagrid) from Web custom c

    I was wondering if I can easily create a web based popup that contains a datagrid that allows me to select items from it and pass the details back?<BR><BR>I want to be able to create the popup from within a web custom control and pass the selected item back to it from the popup.<BR><BR>Can this be done easily??<BR>Is there some sample code to do this??<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Web Popup window (with datagrid) from Web cust

    Unfortunately ASP.Net does not deal well with multiple windows or frames. It has to do with ASP.Net being centered around the Page object. That said, although you won&#039;t be able to use the great ASP.Net you&#039;re used to, you can still get the job done using something that feels more like classic ASP.<BR><BR>A quick interjection - would it be possible to use a div (panel)? I know a lot of times where I originally thought I&#039;d use a separate window I instead found a way to use a div with toggling visibility and z-index.<BR><BR>Ok, on with what I was saying. One way would be to use some clientside javascript to point to the other window. You could construct a querystring to pass the datagrid selection to the original window. Generally I do this like:<BR><BR>protected btnSelect_Click(object sender, EventArgs e)<BR>{<BR> Page.Response.Write("&#060;script language=&#039;JavaScript&#039;&#062;");<BR> Page.Response.Write("windowname.location.href = &#039;" + myHref + myQuerystring + "&#039;;");<BR>}<BR><BR>Once you get that querystring to ASP.Net, you should know what to do.<BR><BR>One thing to watch out for is the escaping when Response.Writing the javascript. It always takes me several minutes to get this working. So if your window doesn&#039;t refresh, examine the Response.Write lines. You might have to split them over more lines or something. Perhaps the next poster could help on that issue!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts