?
Solved

is there a winow.open option for a hyperlink in a table?

Posted on 2006-03-31
1
Medium Priority
?
310 Views
Last Modified: 2010-04-17
Hi,

I have a table on FORM1 and one column in the table is a hyperlink. I want the hyperlink to go to another page when clicked, but when the new page closes I would like the Form1 to show again.  Does that make sense, kind of how window.open works?  Below is the hyperlink column in my code.  It's in asp.net/VB

 <asp:TemplateColumn HeaderText="Name">

                                    <ItemTemplate>
                                     <asp:Hyperlink id="Hyperlink1"                              
                                     NavigateUrl="http://localhost/IDMD/PPDDetailForm.aspx"
                                     Text='<%# DataBinder.Eval(Container.DataItem, "name") %>'
                                     
                                     Runat=server />                                

                                    </ItemTemplate>

                        </asp:TemplateColumn>
0
Comment
Question by:jm76
1 Comment
 
LVL 9

Accepted Solution

by:
Headspace earned 200 total points
ID: 16346850
why not use window.open to get the new page in the first place?  You could then reference the opening page with window.opener on close to place focus on the opener again : ).

...if you don't want a postback:  

<asp:Hyperlink id="Hyperlink1" NavigateUrl="javascript:OpenWindow()" ...etc

<script language=javascript>
     function OpenWindow()
     {
          detail_form = window.open('idmd/ppddetailform.aspx', 'detail_form');
          detail_form.focus();
      }
</script>

...or you can do the same thing from codebehind, if you don't mind a postback.  just change the link to a button (or linkbutton) and place the following within the button's click routine:

RegisterClientScriptBlock("detailWindow", "<script language='javascript'>detail_form = window.open('idmd/ppddetailform.aspx', 'detail_form'); detail_form.focus(); </script>")

...and then in the other form, something like:

<script language="Javascript">
     function OnClose()
     {
          window.opener.focus()
          window.close();
     }
</script>

wil
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question