Rigaman
asked on
popup window
I need a good example of popup window. I have a page with a datagrid and hyperlink columns to the popup window with a datagrid. I need to retrieve information from the grid in a popup window to the edited text on a grid in a main page. Any ideas?
hi rigaman,
ur problem can be solved in the following way...
instead of creating a hyperlink column create a template column...
and in the item bound event of the grid
void grid_ItemDataBound(.....)
{
DataGridItem DGItem = e.Item;
string html=string.Empty;
if(e.Item.ItemIndex>=0)
{
//(assume 5 is the template column for hyperlink)
DGItem.Cells[5].Text="<a class='DocLink' href=\"javascript:PoPupWIN ('" + DGItem.Cells
[6].Text + "')\"></a> ";
}
}
and in the html part create a javascript like this
function openNewWindow(param1)
{
open ('PopWindow.aspx?email='+ param1,'','');
}
hope this will work
jeebu
ur problem can be solved in the following way...
instead of creating a hyperlink column create a template column...
and in the item bound event of the grid
void grid_ItemDataBound(.....)
{
DataGridItem DGItem = e.Item;
string html=string.Empty;
if(e.Item.ItemIndex>=0)
{
//(assume 5 is the template column for hyperlink)
DGItem.Cells[5].Text="<a class='DocLink' href=\"javascript:PoPupWIN
[6].Text + "')\"></a> ";
}
}
and in the html part create a javascript like this
function openNewWindow(param1)
{
open ('PopWindow.aspx?email='+ param1,'','');
}
hope this will work
jeebu
ASKER
I need to pass parameters from popup window to a page that generated popup
QUES:I need to pass parameters from popup window to a page that generated popup
ans:
in the button for closing the popup write the code like this
Response.Write("<script language='javascript'> opener.functionname(\"" + param1+ "\",\"" + strNames + "\");self.close();</script >")
this will call the function called "functionname" in the page that generated the popup and param1 will be the parameter for that function
hope this will work
jeebu
ans:
in the button for closing the popup write the code like this
Response.Write("<script language='javascript'> opener.functionname(\"" + param1+ "\",\"" + strNames + "\");self.close();</script
this will call the function called "functionname" in the page that generated the popup and param1 will be the parameter for that function
hope this will work
jeebu
ASKER
For some reason I can't even refresh page that opened popup window from popup window using
Response.Write("<script language='javascript'> opener.location.reload;</s cript>") I've downloaded 6 samples that return values from popup windows and all of them run with errors is there anything in IE settings?
Response.Write("<script language='javascript'> opener.location.reload;</s
What error is being returned?
can u write that error returned
jeebu
jeebu
ASKER
I mostly get an error: Class doesn't support Automation
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
However if you're using JavaScript to pop open the window then you can use:
window.opener.formName.tex
you may want to double check the case on that. Or you can simply Google it and find the proper code. Also it may be good to make sure it works both in IE and Firefox. The above works for IE for sure, not sure about Firefox.
Happy Coding