If I have Two pages like this :
- Parent.aspx
- Child.aspx
The parent page Contains a textbox(txt_grm
) and a button ,when the user click the button i execute the following code :
Session["grm"] = txt_grm.Text;
string queryString = "Child.aspx";//Popup window
string newWin = "window.open('" + queryString + "');";
ClientScript.RegisterStartupScript(this.GetType(), "pop", newWin, true);
Now the Child page(popup) contains a link button
with a specific text .
How to call a javascript function in the parent page from the child page given the link button text as a parameter to this function then close the child page?
Say the link button in my child page :
<asp:LinkButton ID="lkSelect" runat="server" Font-Names="Tahoma" Font-Size="8" ><%# Eval("Cell_Data") %></asp:LinkButton>
I want to call the following javascript function in my parent page and close my child :
function DrawPaths(room) {
for (var i in engin.pois) {
if (engin.pois[i].getName(engin.getLanguage()) == room) {
engin.showPath(engin.pois[i].getNode(), engin.pois[i]);
break;
}
}
engin.showFloor(getFloor(), callback)
}
Note : room
param is the link button text .